Versions in this module Expand all Collapse all v1 v1.0.0 Mar 18, 2020 Changes in this version + const CodeInternalJSONRPCError + const CodeInvalidParams + const CodeInvalidjsonrpcRequest + const CodeMethodNotFound + const CodeParseJSONRPCError + const CodeUnknownJSONRPCError + const ReaderBuffsize + const WriterBuffsize + const XErrorMessage + const XHeartbeat + const XMessageID + const XMessageStatusType + const XMessageType + const XMeta + const XOneway + const XSerializeType + const XServiceMethod + const XServicePath + const XVersion + var ErrServerClosed = errors.New("http: Server closed") + var RemoteConnContextKey = &contextKey + var StartRequestContextKey = &contextKey + var StartSendRequestContextKey = &contextKey + var TagContextKey = &contextKey + var UsePool bool + func HTTPRequest2RpcxRequest(r *http.Request) (*protocol.Message, error) + func RegisterMakeListener(network string, ml MakeListener) + type CORSOptions struct + AllowCredentials bool + AllowOriginFunc func(origin string) bool + AllowOriginRequestFunc func(r *http.Request, origin string) bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + Debug bool + ExposedHeaders []string + MaxAge int + OptionsPassthrough bool + func AllowAllCORSOptions() *CORSOptions + type ID struct + Name string + Number int64 + func (id *ID) MarshalJSON() ([]byte, error) + func (id *ID) String() string + func (id *ID) UnmarshalJSON(data []byte) error + type JSONRPCError struct + Code int64 + Data *json.RawMessage + Message string + func (err *JSONRPCError) JSONRPCError() string + type MakeListener func(s *Server, address string) (ln net.Listener, err error) + type OptionFn func(*Server) + func WithReadTimeout(readTimeout time.Duration) OptionFn + func WithTLSConfig(cfg *tls.Config) OptionFn + func WithWriteTimeout(writeTimeout time.Duration) OptionFn + type Plugin interface + type PluginContainer interface + Add func(plugin Plugin) + All func() []Plugin + DoPostConnAccept func(net.Conn) (net.Conn, bool) + DoPostConnClose func(net.Conn) bool + DoPostReadRequest func(ctx context.Context, r *protocol.Message, e error) error + DoPostWriteRequest func(ctx context.Context, r *protocol.Message, e error) error + DoPostWriteResponse func(context.Context, *protocol.Message, *protocol.Message, error) error + DoPreHandleRequest func(ctx context.Context, req *protocol.Message) error + DoPreReadRequest func(ctx context.Context) error + DoPreWriteRequest func(ctx context.Context) error + DoPreWriteResponse func(context.Context, *protocol.Message, *protocol.Message) error + DoRegister func(name string, rcvr interface{}, metadata string) error + DoRegisterFunction func(serviceName, fname string, fn interface{}, metadata string) error + DoUnregister func(name string) error + Remove func(plugin Plugin) + type PostConnAcceptPlugin interface + HandleConnAccept func(net.Conn) (net.Conn, bool) + type PostConnClosePlugin interface + HandleConnClose func(net.Conn) bool + type PostReadRequestPlugin interface + PostReadRequest func(ctx context.Context, r *protocol.Message, e error) error + type PostWriteRequestPlugin interface + PostWriteRequest func(ctx context.Context, r *protocol.Message, e error) error + type PostWriteResponsePlugin interface + PostWriteResponse func(context.Context, *protocol.Message, *protocol.Message, error) error + type PreHandleRequestPlugin interface + PreHandleRequest func(ctx context.Context, r *protocol.Message) error + type PreReadRequestPlugin interface + PreReadRequest func(ctx context.Context) error + type PreWriteRequestPlugin interface + PreWriteRequest func(ctx context.Context) error + type PreWriteResponsePlugin interface + PreWriteResponse func(context.Context, *protocol.Message, *protocol.Message) error + type RegisterFunctionPlugin interface + RegisterFunction func(serviceName, fname string, fn interface{}, metadata string) error + type RegisterPlugin interface + Register func(name string, rcvr interface{}, metadata string) error + Unregister func(name string) error + type Reset interface + Reset func() + type Server struct + AuthFunc func(ctx context.Context, req *protocol.Message, token string) error + DisableHTTPGateway bool + DisableJSONRPC bool + Plugins PluginContainer + func NewServer(options ...OptionFn) *Server + func (s *Server) ActiveClientConn() []net.Conn + func (s *Server) Address() net.Addr + func (s *Server) Close() error + func (s *Server) Register(rcvr interface{}, metadata string) error + func (s *Server) RegisterFunction(servicePath string, fn interface{}, metadata string) error + func (s *Server) RegisterFunctionName(servicePath string, name string, fn interface{}, metadata string) error + func (s *Server) RegisterName(name string, rcvr interface{}, metadata string) error + func (s *Server) RegisterOnShutdown(f func(s *Server)) + func (s *Server) SendMessage(conn net.Conn, servicePath, serviceMethod string, metadata map[string]string, ...) error + func (s *Server) Serve(network, address string) (err error) + func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (s *Server) SetCORS(options *CORSOptions) + func (s *Server) Shutdown(ctx context.Context) error + func (s *Server) UnregisterAll() error + type VersionTag struct + func (VersionTag) MarshalJSON() ([]byte, error) + func (VersionTag) UnmarshalJSON(data []byte) error