Documentation
¶
Index ¶
- func Client(conn *dtls.Conn, opts ...DialOption) *client.ClientConn
- func Dial(target string, dtlsCfg *dtls.Config, opts ...DialOption) (*client.ClientConn, error)
- type BlockwiseFactoryFunc
- type BlockwiseOpt
- type ContextOpt
- type DialOption
- type ErrorFunc
- type ErrorsOpt
- type EventFunc
- type GoPoolFunc
- type GoPoolOpt
- type HandlerFunc
- type HandlerFuncOpt
- type HeartBeatOpt
- type KeepAliveOpt
- type Listener
- type MaxMessageSizeOpt
- type NetOpt
- type OnNewClientConnFunc
- type OnNewClientConnOpt
- type Server
- type ServerOption
- type Session
- func (s *Session) AddOnClose(f EventFunc)
- func (s *Session) AddOnRun(f EventFunc)
- func (s *Session) Close() error
- func (s *Session) Context() context.Context
- func (s *Session) Done() <-chan struct{}
- func (s *Session) MaxMessageSize() int
- func (s *Session) RemoteAddr() net.Addr
- func (s *Session) Run(cc *client.ClientConn) (err error)
- func (s *Session) WriteRequest(req *pool.Message) error
- type TransmissionOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(conn *dtls.Conn, opts ...DialOption) *client.ClientConn
Client creates client over dtls connection.
func Dial ¶
func Dial(target string, dtlsCfg *dtls.Config, opts ...DialOption) (*client.ClientConn, error)
Dial creates a client connection to the given target.
Types ¶
type BlockwiseFactoryFunc ¶
type BlockwiseOpt ¶
type BlockwiseOpt struct {
// contains filtered or unexported fields
}
BlockwiseOpt network option.
func WithBlockwise ¶
WithBlockwise configure's blockwise transfer.
type ContextOpt ¶
type ContextOpt struct {
// contains filtered or unexported fields
}
ContextOpt handler function option.
func WithContext ¶
func WithContext(ctx context.Context) ContextOpt
WithContext set's parent context of server.
type DialOption ¶
type DialOption interface {
// contains filtered or unexported methods
}
A DialOption sets options such as credentials, keepalive parameters, etc.
type ErrorsOpt ¶
type ErrorsOpt struct {
// contains filtered or unexported fields
}
ErrorsOpt errors option.
func WithErrors ¶
WithErrors set function for logging error.
type GoPoolFunc ¶
type GoPoolOpt ¶
type GoPoolOpt struct {
// contains filtered or unexported fields
}
GoPoolOpt gopool option.
func WithGoPool ¶
func WithGoPool(goPool GoPoolFunc) GoPoolOpt
WithGoPool set function for managing spawning go routines for handling incoming request's.
type HandlerFunc ¶
type HandlerFunc = func(*client.ResponseWriter, *pool.Message)
The HandlerFunc type is an adapter to allow the use of ordinary functions as COAP handlers. If f is a function with the appropriate signature, HandlerFunc(f) is a Handler object that calls f.
type HandlerFuncOpt ¶
type HandlerFuncOpt struct {
// contains filtered or unexported fields
}
HandlerFuncOpt handler function option.
func WithHandlerFunc ¶
func WithHandlerFunc(h HandlerFunc) HandlerFuncOpt
WithHandlerFunc set handle for handling request's.
func WithMux ¶
func WithMux(m mux.Handler) HandlerFuncOpt
WithMux set's multiplexer for handle requests.
type HeartBeatOpt ¶
type HeartBeatOpt struct {
// contains filtered or unexported fields
}
HeartBeatOpt heatbeat of read/write operations over connection.
func WithHeartBeat ¶
func WithHeartBeat(heartbeat time.Duration) HeartBeatOpt
WithHeartBeat set deadline's for read/write operations over client connection.
type KeepAliveOpt ¶
type KeepAliveOpt struct {
// contains filtered or unexported fields
}
KeepAliveOpt keepalive option.
func WithKeepAlive ¶
func WithKeepAlive(keepalive *keepalive.KeepAlive) KeepAliveOpt
WithKeepAlive monitoring's client connection's. nil means disable keepalive.
type MaxMessageSizeOpt ¶
type MaxMessageSizeOpt struct {
// contains filtered or unexported fields
}
MaxMessageSizeOpt handler function option.
func WithMaxMessageSize ¶
func WithMaxMessageSize(maxMessageSize int) MaxMessageSizeOpt
WithMaxMessageSize limit size of processed message.
type NetOpt ¶
type NetOpt struct {
// contains filtered or unexported fields
}
NetOpt network option.
func WithNetwork ¶
WithNetwork define's udp version (udp4, udp6, udp) for client.
type OnNewClientConnFunc ¶
type OnNewClientConnFunc = func(cc *client.ClientConn)
type OnNewClientConnOpt ¶
type OnNewClientConnOpt struct {
// contains filtered or unexported fields
}
OnNewClientConnOpt network option.
func WithOnNewClientConn ¶
func WithOnNewClientConn(onNewClientConn OnNewClientConnFunc) OnNewClientConnOpt
WithOnNewClientConn server's notify about new client connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opt ...ServerOption) *Server
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
A ServerOption sets options such as credentials, codec and keepalive parameters, etc.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) AddOnClose ¶
func (*Session) MaxMessageSize ¶
func (*Session) RemoteAddr ¶
type TransmissionOpt ¶
type TransmissionOpt struct {
// contains filtered or unexported fields
}
TransmissionOpt transmission options.
func WithTransmission ¶
func WithTransmission(transmissionNStart time.Duration, transmissionAcknowledgeTimeout time.Duration, transmissionMaxRetransmit int) TransmissionOpt
WithTransmission set options for (re)transmission for Confirmable message-s.