Documentation ¶
Index ¶
- func New(ctx context.Context, config Config, router *mux.Router, ...) (*service.Service, error)
- func TLSConfigToDTLSConfig(tlsConfig *tls.Config) *dtls.Config
- func WithMessagePool(p *pool.Pool) func(*Options)
- func WithOnInactivityConnection(f func(conn mux.Conn)) func(*Options)
- func WithOnNewConnection(f func(conn mux.Conn)) func(*Options)
- func WithOverrideTLS(f func(cfg *tls.Config) *tls.Config) func(*Options)
- func WithTCPGoPool(f coapOptionsConfig.GoPoolFunc[*coapTcpClient.Conn]) func(*Options)
- func WithUDPGoPool(f coapOptionsConfig.GoPoolFunc[*coapUdpClient.Conn]) func(*Options)
- type BlockwiseTransferConfig
- type Config
- type InactivityMonitor
- type KeepAlive
- type Options
- type Protocol
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context, config Config, router *mux.Router, fileWatcher *fsnotify.Watcher, logger log.Logger, opt ...func(*Options)) (*service.Service, error)
New creates server.
func TLSConfigToDTLSConfig ¶
func WithMessagePool ¶
func WithOnNewConnection ¶
func WithTCPGoPool ¶
func WithTCPGoPool(f coapOptionsConfig.GoPoolFunc[*coapTcpClient.Conn]) func(*Options)
Setup go pool for TCP/TCP-TLS connections
func WithUDPGoPool ¶
func WithUDPGoPool(f coapOptionsConfig.GoPoolFunc[*coapUdpClient.Conn]) func(*Options)
Setup go pool for UDP/DTLS connections
Types ¶
type BlockwiseTransferConfig ¶
type BlockwiseTransferConfig struct { Enabled bool `yaml:"enabled" json:"enabled"` SZX string `yaml:"blockSize" json:"blockSize"` }
func (*BlockwiseTransferConfig) Validate ¶
func (c *BlockwiseTransferConfig) Validate() error
type Config ¶
type Config struct { Addr string `yaml:"address" json:"address"` Protocols []Protocol `yaml:"protocols" json:"protocols"` MaxMessageSize uint32 `yaml:"maxMessageSize" json:"maxMessageSize"` MessagePoolSize int `yaml:"messagePoolSize" json:"messagePoolSize"` BlockwiseTransfer BlockwiseTransferConfig `yaml:"blockwiseTransfer" json:"blockwiseTransfer"` TLS TLSConfig `yaml:"tls" json:"tls"` InactivityMonitor *InactivityMonitor `yaml:"inactivityMonitor,omitempty" json:"inactivityMonitor,omitempty"` KeepAlive *KeepAlive `yaml:"keepAlive,omitempty" json:"keepAlive,omitempty"` }
Config represents configuration of coap service
func (*Config) GetTimeout ¶
type InactivityMonitor ¶
func (*InactivityMonitor) Validate ¶
func (c *InactivityMonitor) Validate() error
type Options ¶
type Options struct { OverrideTLSConfig func(cfg *tls.Config) *tls.Config OnNewConnection func(conn mux.Conn) OnInactivityConnection func(conn mux.Conn) TCPGoPool coapOptionsConfig.GoPoolFunc[*coapTcpClient.Conn] UDPGoPool coapOptionsConfig.GoPoolFunc[*coapUdpClient.Conn] MessagePool *pool.Pool }
type TLSConfig ¶
type TLSConfig struct { Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"` DisconnectOnExpiredCertificate bool `yaml:"disconnectOnExpiredCertificate" json:"disconnectOnExpiredCertificate"` Embedded certManagerServer.Config `yaml:",inline" json:",inline"` }
Click to show internal directories.
Click to hide internal directories.