Documentation ¶
Index ¶
- Constants
- func MakeRequest[T any](c *Client, method, channel string, data any, timeout ...time.Duration) (value T, err error)
- type BaseData
- type Client
- type ClientAuthSubscriber
- type ClientOptions
- type ClientRef
- func (c *ClientRef) ReadBytes(delim byte) (value []byte, err error)
- func (c *ClientRef) ReadString(delim byte) (value string, err error)
- func (c *ClientRef) Write(b []byte) (i int, err error)
- func (c *ClientRef) WriteString(d string) (int, error)
- func (c *ClientRef) WriteStringln(d string) (int, error)
- func (c *ClientRef) Writeln(b []byte) (int, error)
- type ClientResponseCollection
- type ClientUpdateHander
- type ClientUpdateHandlerCollection
- type ClientUpdateSubscriber
- type Context
- type Options
- type Output
- type Request
- type Server
- func (s *Server) Auth(subs ...ServerAuthSubscriber)
- func (s *Server) Boot(subs ...ServerBootSubscriber)
- func (s *Server) Cleanup(subs ...ServerCleanupSubscriber)
- func (s *Server) ClientInit(handlers ...ServerClientInitHandler)
- func (s *Server) Handlers(subs ...ServerHandlerSubscriber)
- func (s *Server) IsListening() bool
- func (s *Server) Listen(errChan ...chan error)
- func (s *Server) Setup(subs ...ServerSetupSubscriber)
- func (s *Server) Stop() error
- func (s *Server) UpdateAll(args ...any)
- type ServerAuthSubscriber
- type ServerBootSubscriber
- type ServerCleanupSubscriber
- type ServerClientInitHandler
- type ServerClientInstance
- type ServerClientRef
- func (s *ServerClientRef) ReadBytes(delim byte) ([]byte, error)
- func (s *ServerClientRef) ReadString(delim byte) (string, error)
- func (s *ServerClientRef) Write(b []byte) (int, error)
- func (s *ServerClientRef) WriteString(d string) (int, error)
- func (s *ServerClientRef) WriteStringln(d string) (int, error)
- func (s *ServerClientRef) Writeln(b []byte) (int, error)
- type ServerClientUpdater
- type ServerHandler
- type ServerHandlerCollection
- func (s *ServerHandlerCollection) Get(method, channel string) (handler ServerHandler, err error)
- func (s *ServerHandlerCollection) Has(method, channel string) bool
- func (s *ServerHandlerCollection) Off(method, channel string)
- func (s *ServerHandlerCollection) On(method, channel string, handler ServerHandler) (err error)
- type ServerHandlerSubscriber
- type ServerOptions
- type ServerSetupSubscriber
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ClientOptions) *Client
func (*Client) Auth ¶
func (c *Client) Auth(subs ...ClientAuthSubscriber)
func (*Client) On ¶
func (c *Client) On(method, channel string, handler ClientUpdateHander)
func (*Client) Update ¶
func (c *Client) Update(subs ...ClientUpdateSubscriber)
type ClientAuthSubscriber ¶
type ClientOptions ¶
type ClientResponseCollection ¶
type ClientResponseCollection struct {
// contains filtered or unexported fields
}
type ClientUpdateHander ¶
type ClientUpdateHander func(out *Output)
type ClientUpdateHandlerCollection ¶
type ClientUpdateHandlerCollection struct {
// contains filtered or unexported fields
}
func (*ClientUpdateHandlerCollection) On ¶
func (c *ClientUpdateHandlerCollection) On(method, channel string, handler ClientUpdateHander)
type ClientUpdateSubscriber ¶
type ClientUpdateSubscriber func(collection *ClientUpdateHandlerCollection) (err error)
type Output ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ServerOptions) *Server
func (*Server) Auth ¶
func (s *Server) Auth(subs ...ServerAuthSubscriber)
func (*Server) Boot ¶
func (s *Server) Boot(subs ...ServerBootSubscriber)
func (*Server) Cleanup ¶
func (s *Server) Cleanup(subs ...ServerCleanupSubscriber)
func (*Server) ClientInit ¶
func (s *Server) ClientInit(handlers ...ServerClientInitHandler)
func (*Server) Handlers ¶
func (s *Server) Handlers(subs ...ServerHandlerSubscriber)
func (*Server) IsListening ¶
func (*Server) Setup ¶
func (s *Server) Setup(subs ...ServerSetupSubscriber)
type ServerAuthSubscriber ¶
type ServerAuthSubscriber func(ref *ServerClientRef) (err error)
type ServerBootSubscriber ¶
type ServerBootSubscriber func() (err error)
type ServerCleanupSubscriber ¶
type ServerCleanupSubscriber func(ref *ServerClientRef) (err error)
type ServerClientInitHandler ¶
type ServerClientInitHandler func(updater *ServerClientUpdater) (err error)
type ServerClientInstance ¶
type ServerClientInstance struct {
// contains filtered or unexported fields
}
func (*ServerClientInstance) Start ¶
func (s *ServerClientInstance) Start()
func (*ServerClientInstance) Stop ¶
func (s *ServerClientInstance) Stop()
func (*ServerClientInstance) Update ¶
func (s *ServerClientInstance) Update(args ...any) (err error)
type ServerClientRef ¶
type ServerClientRef struct {
// contains filtered or unexported fields
}
func (*ServerClientRef) ReadString ¶
func (s *ServerClientRef) ReadString(delim byte) (string, error)
func (*ServerClientRef) WriteString ¶
func (s *ServerClientRef) WriteString(d string) (int, error)
func (*ServerClientRef) WriteStringln ¶
func (s *ServerClientRef) WriteStringln(d string) (int, error)
type ServerClientUpdater ¶
type ServerClientUpdater struct {
// contains filtered or unexported fields
}
func (*ServerClientUpdater) Update ¶
func (s *ServerClientUpdater) Update(args ...any) (err error)
type ServerHandler ¶
type ServerHandlerCollection ¶
type ServerHandlerCollection struct {
// contains filtered or unexported fields
}
func (*ServerHandlerCollection) Get ¶
func (s *ServerHandlerCollection) Get(method, channel string) (handler ServerHandler, err error)
func (*ServerHandlerCollection) Has ¶
func (s *ServerHandlerCollection) Has(method, channel string) bool
func (*ServerHandlerCollection) Off ¶
func (s *ServerHandlerCollection) Off(method, channel string)
func (*ServerHandlerCollection) On ¶
func (s *ServerHandlerCollection) On(method, channel string, handler ServerHandler) (err error)
type ServerHandlerSubscriber ¶
type ServerHandlerSubscriber func(subscriber *ServerHandlerCollection) (err error)
type ServerOptions ¶
type ServerSetupSubscriber ¶
type ServerSetupSubscriber func(ref *ServerClientRef) (err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.