Documentation ¶
Overview ¶
Package server contains code to start server components hosted by the subpackages.
Index ¶
- Variables
- func DevicesRunner(session func(net.Conn) error, logger logger.Logger, ...) func()
- func HTTPServeRunner(h http.Handler, parsedCfg *HTTPServeParsedConfig) func()
- type DevicesParsedConfig
- func (cfg *DevicesParsedConfig) Addr() string
- func (cfg *DevicesParsedConfig) BrokerQueueSize() uint
- func (cfg *DevicesParsedConfig) CertPEMBlock() []byte
- func (cfg *DevicesParsedConfig) ExchangeTimeout() time.Duration
- func (cfg *DevicesParsedConfig) FinishLoad(baseDir string) error
- func (cfg *DevicesParsedConfig) KeyPEMBlock() []byte
- func (cfg *DevicesParsedConfig) PingInterval() time.Duration
- func (cfg *DevicesParsedConfig) SessionQueueSize() uint
- type HTTPServeParsedConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BootLogger = logger.NewSimpleLogger(os.Stderr, "debug") // Boot logging helpers through BootLogger. BootLogListener func(kind string, lst net.Listener) = bootLogListener BootLogFatalf = BootLogger.Fatalf )
Functions ¶
func DevicesRunner ¶
func DevicesRunner(session func(net.Conn) error, logger logger.Logger, parsedCfg *DevicesParsedConfig) func()
DevicesRunner returns a function to accept device connections.
func HTTPServeRunner ¶
func HTTPServeRunner(h http.Handler, parsedCfg *HTTPServeParsedConfig) func()
HTTPServeRunner returns a function to serve HTTP requests.
Types ¶
type DevicesParsedConfig ¶
type DevicesParsedConfig struct { // session configuration ParsedPingInterval config.ConfigTimeDuration `json:"ping_interval"` ParsedExchangeTimeout config.ConfigTimeDuration `json:"exchange_timeout"` // broker configuration ParsedSessionQueueSize config.ConfigQueueSize `json:"session_queue_size"` ParsedBrokerQueueSize config.ConfigQueueSize `json:"broker_queue_size"` // device listener configuration ParsedAddr config.ConfigHostPort `json:"addr"` ParsedKeyPEMFile string `json:"key_pem_file"` ParsedCertPEMFile string `json:"cert_pem_file"` // contains filtered or unexported fields }
A DevicesParsedConfig holds and can be used to parse the device server config.
func (*DevicesParsedConfig) Addr ¶
func (cfg *DevicesParsedConfig) Addr() string
func (*DevicesParsedConfig) BrokerQueueSize ¶
func (cfg *DevicesParsedConfig) BrokerQueueSize() uint
func (*DevicesParsedConfig) CertPEMBlock ¶
func (cfg *DevicesParsedConfig) CertPEMBlock() []byte
func (*DevicesParsedConfig) ExchangeTimeout ¶
func (cfg *DevicesParsedConfig) ExchangeTimeout() time.Duration
func (*DevicesParsedConfig) FinishLoad ¶
func (cfg *DevicesParsedConfig) FinishLoad(baseDir string) error
func (*DevicesParsedConfig) KeyPEMBlock ¶
func (cfg *DevicesParsedConfig) KeyPEMBlock() []byte
func (*DevicesParsedConfig) PingInterval ¶
func (cfg *DevicesParsedConfig) PingInterval() time.Duration
func (*DevicesParsedConfig) SessionQueueSize ¶
func (cfg *DevicesParsedConfig) SessionQueueSize() uint
type HTTPServeParsedConfig ¶
type HTTPServeParsedConfig struct { ParsedHTTPAddr config.ConfigHostPort `json:"http_addr"` ParsedHTTPReadTimeout config.ConfigTimeDuration `json:"http_read_timeout"` ParsedHTTPWriteTimeout config.ConfigTimeDuration `json:"http_write_timeout"` }
A HTTPServeParsedConfig holds and can be used to parse the HTTP server config.
Directories ¶
Path | Synopsis |
---|---|
cmd
acceptanceclient for playing
|
acceptanceclient for playing |
Package api has code that offers a REST API for the applications that want to push messages.
|
Package api has code that offers a REST API for the applications that want to push messages. |
Package broker handles session registrations and delivery of messages through sessions.
|
Package broker handles session registrations and delivery of messages through sessions. |
simple
Package simple implements a simple broker for just one process.
|
Package simple implements a simple broker for just one process. |
testing
Package testing contains simple test implementations of some broker interfaces.
|
Package testing contains simple test implementations of some broker interfaces. |
testsuite
Package testsuite contains a common test suite for brokers.
|
Package testsuite contains a common test suite for brokers. |
simple development server.
|
simple development server. |
Package listener has code to listen for device connections and setup sessions for them.
|
Package listener has code to listen for device connections and setup sessions for them. |
Package session has code handling long-lived connections from devices.
|
Package session has code handling long-lived connections from devices. |
Package store takes care of storing pending notifications.
|
Package store takes care of storing pending notifications. |
Click to show internal directories.
Click to hide internal directories.