Documentation ¶
Index ¶
- func ServerContext(rootCtx context.Context, factory *rpcrouter.RouterFactory) context.Context
- func StartGRPCServer(rootCtx context.Context, bind string, opts ...grpc.ServerOption)
- func StartHTTPServer(rootCtx context.Context, bind string, opts ...HTTPOptionFunc)
- type GRPCSender
- type HTTPOption
- type HTTPOptionFunc
- type HTTPServer
- type JointRPC
- func (self JointRPC) Authorize(context context.Context, auth *intf.ClientAuth, ipAddr net.Addr) (*intf.Status, string)
- func (self *JointRPC) Call(context context.Context, req *intf.JSONRPCCallRequest) (*intf.JSONRPCCallResult, error)
- func (self *JointRPC) ListDelegates(context context.Context, req *intf.ListDelegatesRequest) (*intf.ListDelegatesResponse, error)
- func (self *JointRPC) ListMethods(context context.Context, req *intf.ListMethodsRequest) (*intf.ListMethodsResponse, error)
- func (self *JointRPC) Live(stream intf.JointRPC_LiveServer) error
- func (self *JointRPC) Notify(context context.Context, req *intf.JSONRPCNotifyRequest) (*intf.JSONRPCNotifyResponse, error)
- type MetricsCollector
- type StreamDispatcher
- type WSSender
- type WSServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServerContext ¶
func StartGRPCServer ¶
func StartGRPCServer(rootCtx context.Context, bind string, opts ...grpc.ServerOption)
func StartHTTPServer ¶
func StartHTTPServer(rootCtx context.Context, bind string, opts ...HTTPOptionFunc)
Types ¶
type GRPCSender ¶
type GRPCSender struct {
// contains filtered or unexported fields
}
Lives GRPCServer implements dispatch.ISender
func NewGRPCSender ¶
func NewGRPCSender(stream intf.JointRPC_LiveServer) *GRPCSender
func (GRPCSender) SendCmdMsg ¶
func (GRPCSender) SendMessage ¶
type HTTPOption ¶
type HTTPOption struct {
// contains filtered or unexported fields
}
type HTTPOptionFunc ¶
type HTTPOptionFunc func(opt *HTTPOption)
func WithTLS ¶
func WithTLS(certFile string, keyFile string) HTTPOptionFunc
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
JSONRPC HTTP Server
func NewHTTPServer ¶
func NewHTTPServer(rootCtx context.Context) *HTTPServer
func (*HTTPServer) ServeHTTP ¶
func (self *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type JointRPC ¶
type JointRPC struct {
intf.UnimplementedJointRPCServer
}
func NewJointRPCServer ¶
func NewJointRPCServer() *JointRPC
func (*JointRPC) Call ¶
func (self *JointRPC) Call(context context.Context, req *intf.JSONRPCCallRequest) (*intf.JSONRPCCallResult, error)
Call
func (*JointRPC) ListDelegates ¶
func (self *JointRPC) ListDelegates(context context.Context, req *intf.ListDelegatesRequest) (*intf.ListDelegatesResponse, error)
ListDelegates
func (*JointRPC) ListMethods ¶
func (self *JointRPC) ListMethods(context context.Context, req *intf.ListMethodsRequest) (*intf.ListMethodsResponse, error)
ListMethods
func (*JointRPC) Notify ¶
func (self *JointRPC) Notify(context context.Context, req *intf.JSONRPCNotifyRequest) (*intf.JSONRPCNotifyResponse, error)
Notify
type MetricsCollector ¶
type MetricsCollector struct {
// contains filtered or unexported fields
}
func NewMetricsCollector ¶
func NewMetricsCollector(rootCtx context.Context) *MetricsCollector
func (*MetricsCollector) Collect ¶
func (self *MetricsCollector) Collect() ([]string, error)
func (*MetricsCollector) CollectRouter ¶
func (self *MetricsCollector) CollectRouter(router *rpcrouter.Router) ([]string, error)
func (*MetricsCollector) ServeHTTP ¶
func (self *MetricsCollector) ServeHTTP(w http.ResponseWriter, r *http.Request)
type StreamDispatcher ¶
type StreamDispatcher struct {
// contains filtered or unexported fields
}
func GetStreamDispatcher ¶
func GetStreamDispatcher() *StreamDispatcher
func NewStreamDispatcher ¶
func NewStreamDispatcher() *StreamDispatcher
func (*StreamDispatcher) HandleMessage ¶
func (*StreamDispatcher) Init ¶
func (self *StreamDispatcher) Init()
type WSSender ¶
type WSSender struct {
// contains filtered or unexported fields
}
lives
func NewWSSender ¶
func (WSSender) SendCmdMsg ¶
type WSServer ¶
type WSServer struct {
// contains filtered or unexported fields
}
Websocket servo
func NewWSServer ¶
Click to show internal directories.
Click to hide internal directories.