Documentation ¶
Index ¶
- func GetClientID(ws *websocket.Conn) string
- func IsMappedTo(err error, code int) bool
- func NewHTTP(requestHandler *RequestHandler, authInterceptor kitHttp.Interceptor) *http.Server
- func NewSubscriptionSession(ws *websocket.Conn) subscribeSession
- func ToDeviceResourcesObservationEvent(e client.DeviceResourcesObservationEvent_type) string
- func ToDevicesObservationEvent(e client.DevicesObservationEvent_type) string
- type Config
- type Device
- type DeviceEvent
- type DeviceResourceObservationEvent
- type ObservationManager
- type ObservationResolver
- type RequestHandler
- type RetrieveDeviceWithLinksResponse
- type Server
- type Status
- type SubscribeSession
- type TokenMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientID ¶
func IsMappedTo ¶
func NewHTTP ¶
func NewHTTP(requestHandler *RequestHandler, authInterceptor kitHttp.Interceptor) *http.Server
NewHTTP returns HTTP server
func NewSubscriptionSession ¶
func ToDeviceResourcesObservationEvent ¶
func ToDeviceResourcesObservationEvent(e client.DeviceResourcesObservationEvent_type) string
func ToDevicesObservationEvent ¶
func ToDevicesObservationEvent(e client.DevicesObservationEvent_type) string
Types ¶
type Config ¶
type Config struct { Address string `envconfig:"ADDRESS"` Listen certManager.Config `envconfig:"LISTEN"` Dial certManager.Config `envconfig:"DIAL"` JwksURL string `envconfig:"JWKS_URL"` ResourceDirectoryAddr string `envconfig:"RESOURCE_DIRECTORY_ADDRESS"` CertificateAuthorityAddr string `envconfig:"CERTIFICATE_AUTHORITY_ADDRESS"` WebSocketReadLimit int64 `envconfig:"WEBSOCKET_READ_LIMIT"` WebSocketReadTimeout time.Duration `envconfig:"WEBSOCKET_READ_TIMEOUT"` }
Config represent application configuration
type DeviceEvent ¶
type DeviceResourceObservationEvent ¶
type DeviceResourceObservationEvent struct { Resources []schema.ResourceLink `json:"resources"` Event string `json:"event"` }
type ObservationManager ¶
type ObservationManager struct {
// contains filtered or unexported fields
}
func NewObservationManager ¶
func NewObservationManager() (*ObservationManager, error)
type ObservationResolver ¶
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler for handling incoming request
func NewRequestHandler ¶
func NewRequestHandler(client *client.Client, caClient pbCA.CertificateAuthorityClient, config *Config, manager *ObservationManager) *RequestHandler
NewRequestHandler factory for new RequestHandler
func (*RequestHandler) ServeWs ¶
func (requestHandler *RequestHandler) ServeWs(w http.ResponseWriter, r *http.Request, ob ObservationResolver) error
type RetrieveDeviceWithLinksResponse ¶
type RetrieveDeviceWithLinksResponse struct { Device Links []schema.ResourceLink `json:"links"` }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handle HTTP request
type Status ¶
type Status string
const Status_OFFLINE Status = "offline"
const Status_ONLINE Status = "online"
type SubscribeSession ¶
type SubscribeSession interface { ClientId() string SubscriptionId() string SetSubscriptionId(id string) Write(data interface{}) ReadLoop(rh *RequestHandler, ob ObservationResolver) WriteLoop() OnClose() }
type TokenMessage ¶ added in v1.1.0
type TokenMessage struct {
Token string `json:"token"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.