Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Context() context.Context
- func (c *Client) GetCoapConnection() *coapTcpClient.Conn
- func (c *Client) GetDeviceID() string
- func (c *Client) GetServiceHandler() ServiceHandler
- func (c *Client) OnClose()
- func (c *Client) RemoteAddrString() string
- func (c *Client) SetDeviceID(deviceID string)
- type CoapConnectionOpt
- type Config
- type GetServiceHandler
- type OnShutdown
- type Option
- type Service
- type ServiceHandler
- type ServiceHandlerConfig
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client a setup of connection
func (*Client) GetCoapConnection ¶
func (c *Client) GetCoapConnection() *coapTcpClient.Conn
func (*Client) GetDeviceID ¶
func (*Client) GetServiceHandler ¶
func (c *Client) GetServiceHandler() ServiceHandler
func (*Client) OnClose ¶
func (c *Client) OnClose()
OnClose is invoked when the coap connection was closed.
func (*Client) RemoteAddrString ¶
func (*Client) SetDeviceID ¶
type CoapConnectionOpt ¶
type CoapConnectionOpt struct {
// contains filtered or unexported fields
}
func WithCoapConnectionOpt ¶
func WithCoapConnectionOpt(c *client.Conn) CoapConnectionOpt
func (CoapConnectionOpt) Apply ¶
func (o CoapConnectionOpt) Apply(opts *ServiceHandlerConfig)
type GetServiceHandler ¶
type GetServiceHandler = func(service *Service, opts ...Option) ServiceHandler
type OnShutdown ¶
type OnShutdown = func(ServiceHandler)
type Option ¶
type Option interface {
Apply(o *ServiceHandlerConfig)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a configuration of coap-gateway
func (*Service) GetClients ¶
type ServiceHandler ¶
type ServiceHandler interface { CloseOnError() bool SignUp(req ocfCloud.CoapSignUpRequest) (ocfCloud.CoapSignUpResponse, error) SignOff() error SignIn(req ocfCloud.CoapSignInRequest) (ocfCloud.CoapSignInResponse, error) SignOut(req ocfCloud.CoapSignInRequest) error PublishResources(req ocfCloud.PublishResourcesRequest) error UnpublishResources(req ocfCloud.UnpublishResourcesRequest) error RefreshToken(req ocfCloud.CoapRefreshTokenRequest) (ocfCloud.CoapRefreshTokenResponse, error) }
type ServiceHandlerConfig ¶
type ServiceHandlerConfig struct {
// contains filtered or unexported fields
}
func (*ServiceHandlerConfig) GetCoapConnection ¶
func (s *ServiceHandlerConfig) GetCoapConnection() *client.Conn
Click to show internal directories.
Click to hide internal directories.