Documentation ¶
Index ¶
- func NewAuthInterceptor() kitNetCoap.Interceptor
- func SendResourceContentToObserver(client *Client, resourceChanged *pb.Event_ResourceChanged, observe uint32, ...)
- func URIToDeviceIDHref(msg *mux.Message) (deviceID, href string, err error)
- type Client
- func (client *Client) Close() error
- func (client *Client) Context() context.Context
- func (client *Client) OnClose()
- func (client *Client) PublishCloudDeviceStatus(ctx context.Context, deviceID string, authCtx pbCQRS.AuthorizationContext) error
- func (client *Client) UpdateCloudDeviceStatus(ctx context.Context, deviceID string, authCtx pbCQRS.AuthorizationContext, ...) error
- type CoapRefreshTokenReq
- type CoapRefreshTokenResp
- type CoapSignInReq
- type CoapSignInResp
- type CoapSignUpRequest
- type CoapSignUpResponse
- type Config
- type DialCertManager
- type ListenCertManager
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthInterceptor ¶
func NewAuthInterceptor() kitNetCoap.Interceptor
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client a setup of connection
func (*Client) OnClose ¶
func (client *Client) OnClose()
OnClose action when coap connection was closed.
func (*Client) PublishCloudDeviceStatus ¶
func (*Client) UpdateCloudDeviceStatus ¶
type CoapRefreshTokenReq ¶
type CoapRefreshTokenResp ¶
type CoapSignInReq ¶
type CoapSignInResp ¶
type CoapSignInResp struct {
ExpiresIn int64 `json:"expiresin"`
}
type CoapSignUpRequest ¶
type CoapSignUpResponse ¶
type Config ¶
type Config struct { Addr string `envconfig:"ADDRESS" default:"0.0.0.0:5684"` ExternalPort uint16 `envconfig:"EXTERNAL_PORT" default:"5684"` FQDN string `envconfig:"FQDN" default:"coapgw.ocf.cloud"` AuthServerAddr string `envconfig:"AUTH_SERVER_ADDRESS" default:"127.0.0.1:9100"` ResourceAggregateAddr string `envconfig:"RESOURCE_AGGREGATE_ADDRESS" default:"127.0.0.1:9100"` ResourceDirectoryAddr string `envconfig:"RESOURCE_DIRECTORY_ADDRESS" default:"127.0.0.1:9100"` RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"10s"` KeepaliveEnable bool `envconfig:"KEEPALIVE_ENABLE" default:"true"` KeepaliveTimeoutConnection time.Duration `envconfig:"KEEPALIVE_TIMEOUT_CONNECTION" default:"20s"` DisableBlockWiseTransfer bool `envconfig:"DISABLE_BLOCKWISE_TRANSFER" default:"false"` BlockWiseTransferSZX string `envconfig:"BLOCKWISE_TRANSFER_SZX" default:"1024"` DisableTCPSignalMessageCSM bool `envconfig:"DISABLE_TCP_SIGNAL_MESSAGE_CSM" default:"false"` DisablePeerTCPSignalMessageCSMs bool `envconfig:"DISABLE_PEER_TCP_SIGNAL_MESSAGE_CSMS" default:"false"` SendErrorTextInResponse bool `envconfig:"ERROR_IN_RESPONSE" default:"true"` OAuth manager.Config `envconfig:"OAUTH"` ReconnectInterval time.Duration `envconfig:"RECONNECT_TIMEOUT" default:"10s"` HeartBeat time.Duration `envconfig:"HEARTBEAT" default:"4s"` MaxMessageSize int `envconfig:"MAX_MESSAGE_SIZE" default:"262144"` }
Config for application.
type DialCertManager ¶
type ListenCertManager ¶
type Server ¶
type Server struct { FQDN string // fully qualified domain name of GW ExternalPort uint16 // used to construct oic/res response Addr string // Address to listen on, ":COAP" if empty. IsTLSListener bool Keepalive *keepalive.KeepAlive DisableTCPSignalMessageCSM bool DisablePeerTCPSignalMessageCSMs bool SendErrorTextInResponse bool RequestTimeout time.Duration BlockWiseTransfer bool BlockWiseTransferSZX blockwise.SZX ReconnectInterval time.Duration HeartBeat time.Duration MaxMessageSize int // contains filtered or unexported fields }
Server a configuration of coapgateway
func New ¶
func New(config Config, dialCertManager DialCertManager, listenCertManager ListenCertManager) *Server
New creates server.
func (*Server) ServiceRequestContext ¶
Source Files ¶
- auth.go
- client.go
- clientDeleteHandler.go
- clientLogAndWriteErrorResponse.go
- clientObserveHandler.go
- clientResetHandler.go
- clientRetrieveHandler.go
- clientSendResponse.go
- clientUpdateHandler.go
- config.go
- decodeMsgToDebug.go
- deviceCloudStatus.go
- deviceSubscriptionHandlers.go
- ping.go
- refreshToken.go
- resourceDirectory.go
- resourceDiscovery.go
- resourceRouteHandler.go
- resourceSubscriptionHandlers.go
- server.go
- signIn.go
- signUp.go
Click to show internal directories.
Click to hide internal directories.