Documentation ¶
Index ¶
- func ParseParameters(responder *HandleResponder, params *json.RawMessage, v interface{}) (cancel_processing bool, paniced bool)
- type AppContextSession
- type Destructable
- type HandleResponder
- func (self *HandleResponder) Defer() error
- func (self *HandleResponder) Log(txt ...interface{})
- func (self *HandleResponder) LogRespError(code int64, txt ...interface{}) error
- func (self *HandleResponder) Reply(result interface{}) error
- func (self *HandleResponder) ReplyWithError(respErr *jsonrpc2.Error) error
- func (self *HandleResponder) RespError(code int64, txt ...interface{}) error
- type MyHttpHandler
- type RPCHandleContext
- type Server
- type ServerOptions
- type Session
- func (self *Session) Destroy()
- func (self *Session) GetSessionId() string
- func (self *Session) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request)
- func (self *Session) HandleBS(bs jsonrpc2.ObjectStream)
- func (self *Session) HandleConnection(conn net.Conn)
- func (self *Session) Log(txt ...interface{})
- type SessionOptions
- type SubscriptionMgr
- func (self *SubscriptionMgr) Log(txt ...interface{})
- func (self *SubscriptionMgr) Subscribe(remote_subscribe_command_parameter interface{}) (descriptor string, unsubscribing_descriptor string, err error)
- func (self *SubscriptionMgr) Subscriptions(descriptor string) (unsubscribing_descriptors []string, err error)
- func (self *SubscriptionMgr) Unsubscribe(descriptor string, unsubscribing_descriptor string)
- func (self *SubscriptionMgr) UnsubscribeAllDescriptors(unsubscribing_descriptor string)
- func (self *SubscriptionMgr) UnsubscribeEverything()
- type SubscriptionMgrOptions
- type SubscriptionMgrSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseParameters ¶
func ParseParameters( responder *HandleResponder, params *json.RawMessage, v interface{}, ) ( cancel_processing bool, paniced bool, )
responder - can be nil - so will not be used
Types ¶
type AppContextSession ¶
type AppContextSession interface { RPCHandle(*RPCHandleContext) Destroy() }
type Destructable ¶
type Destructable interface {
Destroy()
}
type HandleResponder ¶
type HandleResponder struct {
// contains filtered or unexported fields
}
func NewHandleResponder ¶
func (*HandleResponder) Log ¶
func (self *HandleResponder) Log(txt ...interface{})
Format message and send it using log()
func (*HandleResponder) LogRespError ¶
func (self *HandleResponder) LogRespError(code int64, txt ...interface{}) error
Format message, log it with log() and send copy as error reply to rpc
func (*HandleResponder) Reply ¶
func (self *HandleResponder) Reply(result interface{}) error
Send success reply to rpc
func (*HandleResponder) ReplyWithError ¶
func (self *HandleResponder) ReplyWithError(respErr *jsonrpc2.Error) error
Send error reply to rpc
func (*HandleResponder) RespError ¶
func (self *HandleResponder) RespError(code int64, txt ...interface{}) error
Format text, make error message and use ReplyWithError() function
type MyHttpHandler ¶
type MyHttpHandler struct {
// contains filtered or unexported fields
}
func (*MyHttpHandler) ServeHTTP ¶
func (self *MyHttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RPCHandleContext ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts *ServerOptions) (*Server, error)
type ServerOptions ¶
type ServerOptions struct { // Verbose bool Debug bool ListenAtAddresses string ListenAtAddressesWS string AsyncRequestHandling bool // AppContext AppContext CreateAppContextSession func(Destructable) (AppContextSession, error) EnableTLS bool TLSConfig *tls.Config HostStaticDir bool StaticDir string StaticDirURIPathPrefix string }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(options *SessionOptions) (*Session, error)
func (*Session) GetSessionId ¶
func (*Session) HandleBS ¶
func (self *Session) HandleBS(bs jsonrpc2.ObjectStream)
func (*Session) HandleConnection ¶
type SessionOptions ¶
type SubscriptionMgr ¶
type SubscriptionMgr struct {
// contains filtered or unexported fields
}
func NewSubscriptionMgr ¶
func NewSubscriptionMgr(options *SubscriptionMgrOptions) *SubscriptionMgr
func (*SubscriptionMgr) Log ¶
func (self *SubscriptionMgr) Log(txt ...interface{})
func (*SubscriptionMgr) Subscribe ¶
func (self *SubscriptionMgr) Subscribe( remote_subscribe_command_parameter interface{}, ) (descriptor string, unsubscribing_descriptor string, err error)
func (*SubscriptionMgr) Subscriptions ¶
func (self *SubscriptionMgr) Subscriptions(descriptor string) (unsubscribing_descriptors []string, err error)
func (*SubscriptionMgr) Unsubscribe ¶
func (self *SubscriptionMgr) Unsubscribe(descriptor string, unsubscribing_descriptor string)
func (*SubscriptionMgr) UnsubscribeAllDescriptors ¶
func (self *SubscriptionMgr) UnsubscribeAllDescriptors(unsubscribing_descriptor string)
func (*SubscriptionMgr) UnsubscribeEverything ¶
func (self *SubscriptionMgr) UnsubscribeEverything()
type SubscriptionMgrOptions ¶
type SubscriptionMgrOptions struct { // Context *Context UseAsyncHandler bool GetNewConnection func() (net.Conn, error) Authenticator func(conn *jsonrpc2.Conn) error // RemoteSubscribtionsCommand string // TODO: really needed? RemoteSubscribeCommand string GetDescriptorForParameter func(parameter interface{}) string RespHandler func( descriptor string, unsubscribing_descriptor string, request *jsonrpc2.Request, uuid_str string, ) }
type SubscriptionMgrSession ¶
type SubscriptionMgrSession struct {
// contains filtered or unexported fields
}
func NewSubscriptionMgrSession ¶
func NewSubscriptionMgrSession( mgr *SubscriptionMgr, descriptor string, parameters interface{}, ) (*SubscriptionMgrSession, error)
func (*SubscriptionMgrSession) Destroy ¶
func (self *SubscriptionMgrSession) Destroy()
Click to show internal directories.
Click to hide internal directories.