Documentation ¶
Index ¶
- Constants
- func EncodeString(s string) string
- func Exists(file string) bool
- func GetEnv() string
- func ReadFile(file string, obj interface{}) ([]byte, error)
- func ReadFileLines(file string) ([]string, error)
- func WriteFile(file string, obj interface{}) error
- type AppConfig
- type Client
- func (c *Client) Config() *ClientConfig
- func (c *Client) Forget(topic, channel string, handler MessageHandler)
- func (c *Client) Listen(topic, channel string, handler MessageHandler)
- func (c *Client) Publish(topic, channel string, message []byte) error
- func (c *Client) Reconfigure(options ...SocketClientOption)
- func (c *Client) Start(waitGroup ...*sync.WaitGroup) error
- func (c *Client) Started() bool
- func (c *Client) Stop(waitGroup ...*sync.WaitGroup) error
- func (c *Client) Subscribe(topic, channel string) error
- func (c *Client) Unsubscribe(topic, channel string) error
- func (c *Client) Wait()
- type ClientConfig
- type MessageHandler
- type Server
- type ServerConfig
- type SocketClientOption
- type SocketConfig
- type SocketServerOption
Constants ¶
View Source
const (
HeaderGatewayKey = "Gateway"
)
Variables ¶
This section is empty.
Functions ¶
func EncodeString ¶
func ReadFileLines ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Config ¶
func (c *Client) Config() *ClientConfig
func (*Client) Forget ¶
func (c *Client) Forget(topic, channel string, handler MessageHandler)
Forget ...
func (*Client) Listen ¶
func (c *Client) Listen(topic, channel string, handler MessageHandler)
Listen ...
func (*Client) Reconfigure ¶
func (c *Client) Reconfigure(options ...SocketClientOption)
Reconfigure ...
func (*Client) Unsubscribe ¶
Unsubscribe ...
type ClientConfig ¶
type ClientConfig struct { ServerAddress string `json:"server_address"` *web.ClientConfig }
ClientConfig ...
type MessageHandler ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Config ¶
func (s *Server) Config() *ServerConfig
func (*Server) Reconfigure ¶
func (s *Server) Reconfigure(options ...SocketServerOption)
Reconfigure ...
type SocketClientOption ¶
type SocketClientOption func(client *Client)
SocketClientOption ...
func WithClientConfiguration ¶
func WithClientConfiguration(config *ClientConfig) SocketClientOption
WithClientConfiguration ...
func WithClientLogLevel ¶
func WithClientLogLevel(level logger.Level) SocketClientOption
WithClientLogLevel ...
func WithClientLogger ¶
func WithClientLogger(logger logger.ILogger) SocketClientOption
WithClientLogger ...
func WithClientManager ¶
func WithClientManager(mgr *manager.Manager) SocketClientOption
WithClientManager ...
type SocketConfig ¶
type SocketConfig struct { Server *ServerConfig `json:"server"` Client *ClientConfig `json:"client"` }
SocketConfig ...
type SocketServerOption ¶
type SocketServerOption func(server *Server)
SocketServerOption ...
func WithServerConfiguration ¶
func WithServerConfiguration(config *ServerConfig) SocketServerOption
WithServerConfiguration ...
func WithServerLogLevel ¶
func WithServerLogLevel(level logger.Level) SocketServerOption
WithServerLogLevel ...
func WithServerLogger ¶
func WithServerLogger(logger logger.ILogger) SocketServerOption
WithServerLogger ...
func WithServerManager ¶
func WithServerManager(mgr *manager.Manager) SocketServerOption
WithServerManager ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.