Documentation ¶
Index ¶
- type Server
- func (s *Server) Close() (err error)
- func (s *Server) Ping(context.Context, *empty.Empty) (*empty.Empty, error)
- func (s *Server) Publish(_ context.Context, req *pb.PubReq) (resp *pb.PubResp, err error)
- func (s *Server) Serve() (err error)
- func (s *Server) Subscribe(req *pb.SubReq, stream pb.Message_SubscribeServer) (err error)
- type StatsHandler
- func (h *StatsHandler) HandleConn(ctx context.Context, s stats.ConnStats)
- func (h *StatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)
- func (h *StatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
- func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
- type Subscribers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { pb.UnimplementedMessageServer GRPCHost string `long:"grpc-host" description:"the IP to listen on for grpc" default:"0.0.0.0" env:"GRPC_HOST"` GRPCPort string `long:"grpc-port" description:"the port to listen on for grpc's insecure connections" default:"6653" env:"GRPC_PORT"` // contains filtered or unexported fields }
Server server
type StatsHandler ¶
type StatsHandler struct{}
StatsHandler Handler defines the interface for the related stats handling (e.g., RPCs, connections).
func (*StatsHandler) HandleConn ¶
func (h *StatsHandler) HandleConn(ctx context.Context, s stats.ConnStats)
HandleConn processes the Conn stats.
func (*StatsHandler) HandleRPC ¶
func (h *StatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)
HandleRPC processes the RPC stats.
func (*StatsHandler) TagConn ¶
func (h *StatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
TagConn can attach some information to the given context. The returned context will be used for stats handling. For conn stats handling, the context used in HandleConn for this connection will be derived from the context returned. For RPC stats handling,
- On server side, the context used in HandleRPC for all RPCs on this
connection will be derived from the context returned.
- On client side, the context is not derived from the context returned.
func (*StatsHandler) TagRPC ¶
func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
TagRPC can attach some information to the given context. The context used for the rest lifetime of the RPC will be derived from the returned context.