created event firing functions under server and client to replace directy bulleting enqueing

This commit is contained in:
2025-03-28 17:03:17 +09:00
parent fd28add458
commit 76cba687ed
6 changed files with 270 additions and 175 deletions

View File

@ -49,10 +49,6 @@ type json_in_client_route_update struct {
Lifetime string `json:"lifetime"`
}
type json_out_client_conn_id struct {
CId ConnId `json:"conn-id"`
}
type json_out_client_conn struct {
CId ConnId `json:"conn-id"`
ReqServerAddrs []string `json:"req-server-addrs"` // server addresses requested. may include a domain name
@ -64,11 +60,6 @@ type json_out_client_conn struct {
Routes []json_out_client_route `json:"routes,omitempty"`
}
type json_out_client_route_id struct {
CId ConnId `json:"conn-id"`
RId RouteId `json:"route-id"`
}
type json_out_client_route struct {
CId ConnId `json:"conn-id"`
RId RouteId `json:"route-id"`
@ -97,6 +88,22 @@ type json_out_client_peer struct {
CreatedMilli int64 `json:"created-milli"`
}
type json_out_client_conn_id struct {
CId ConnId `json:"conn-id"`
}
type json_out_client_route_id struct {
CId ConnId `json:"conn-id"`
RId RouteId `json:"route-id"`
}
type json_out_client_peer_id struct {
CId ConnId `json:"conn-id"`
RId RouteId `json:"route-id"`
PId PeerId `json:"peer-id"`
}
type json_out_client_stats struct {
json_out_go_stats
ClientConns int64 `json:"client-conns"`
@ -276,8 +283,8 @@ func (ctl *client_ctl_client_conns) ServeHTTP(w http.ResponseWriter, req *http.R
RId: r.Id,
ClientPeerAddr: r.PeerAddr,
ClientPeerName: r.PeerName,
ServerPeerSvcAddr: r.ServerPeerSvcAddr,
ServerPeerSvcNet: r.ServerPeerSvcNet,
ServerPeerSvcAddr: r.ServerPeerSvcAddr.Get(),
ServerPeerSvcNet: r.ServerPeerSvcNet.Get(),
ServerPeerOption: r.ServerPeerOption.String(),
Lifetime: DurationToSecString(lftdur),
LifetimeStart: lftsta.Unix(),
@ -394,8 +401,8 @@ func (ctl *client_ctl_client_conns_id) ServeHTTP(w http.ResponseWriter, req *htt
RId: r.Id,
ClientPeerAddr: r.PeerAddr,
ClientPeerName: r.PeerName,
ServerPeerSvcAddr: r.ServerPeerSvcAddr,
ServerPeerSvcNet: r.ServerPeerSvcNet,
ServerPeerSvcAddr: r.ServerPeerSvcAddr.Get(),
ServerPeerSvcNet: r.ServerPeerSvcNet.Get(),
ServerPeerOption: r.ServerPeerOption.String(),
Lifetime: DurationToSecString(lftdur),
LifetimeStart: lftsta.Unix(),
@ -475,8 +482,8 @@ func (ctl *client_ctl_client_conns_id_routes) ServeHTTP(w http.ResponseWriter, r
RId: r.Id,
ClientPeerAddr: r.PeerAddr,
ClientPeerName: r.PeerName,
ServerPeerSvcAddr: r.ServerPeerSvcAddr,
ServerPeerSvcNet: r.ServerPeerSvcNet,
ServerPeerSvcAddr: r.ServerPeerSvcAddr.Get(),
ServerPeerSvcNet: r.ServerPeerSvcNet.Get(),
ServerPeerOption: r.ServerPeerOption.String(),
Lifetime: DurationToSecString(lftdur),
LifetimeStart: lftsta.Unix(),
@ -594,8 +601,8 @@ func (ctl *client_ctl_client_conns_id_routes_id) ServeHTTP(w http.ResponseWriter
RId: r.Id,
ClientPeerAddr: r.PeerAddr,
ClientPeerName: r.PeerName,
ServerPeerSvcAddr: r.ServerPeerSvcAddr,
ServerPeerSvcNet: r.ServerPeerSvcNet,
ServerPeerSvcAddr: r.ServerPeerSvcAddr.Get(),
ServerPeerSvcNet: r.ServerPeerSvcNet.Get(),
ServerPeerOption: r.ServerPeerOption.String(),
Lifetime: DurationToSecString(lftdur),
LifetimeStart: lftsta.Unix(),
@ -683,8 +690,8 @@ func (ctl *client_ctl_client_conns_id_routes_spsp) ServeHTTP(w http.ResponseWrit
RId: r.Id,
ClientPeerAddr: r.PeerAddr,
ClientPeerName: r.PeerName,
ServerPeerSvcAddr: r.ServerPeerSvcAddr,
ServerPeerSvcNet: r.ServerPeerSvcNet,
ServerPeerSvcAddr: r.ServerPeerSvcAddr.Get(),
ServerPeerSvcNet: r.ServerPeerSvcNet.Get(),
ServerPeerOption: r.ServerPeerOption.String(),
Lifetime: DurationToSecString(lftdur),
LifetimeStart: lftsta.Unix(),
@ -946,8 +953,8 @@ func (ctl *client_ctl_client_routes) ServeHTTP(w http.ResponseWriter, req *http.
RId: r.Id,
ClientPeerAddr: r.PeerAddr,
ClientPeerName: r.PeerName,
ServerPeerSvcAddr: r.ServerPeerSvcAddr,
ServerPeerSvcNet: r.ServerPeerSvcNet,
ServerPeerSvcAddr: r.ServerPeerSvcAddr.Get(),
ServerPeerSvcNet: r.ServerPeerSvcNet.Get(),
ServerPeerOption: r.ServerPeerOption.String(),
Lifetime: DurationToSecString(lftdur),
LifetimeStart: lftsta.Unix(),