Documentation ¶
Index ¶
- func FieldNameMarshaler(f reflect.StructField) string
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldNameMarshaler ¶
func FieldNameMarshaler(f reflect.StructField) string
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" default:"0.0.0.0:7000"` Listen certManager.Config `envconfig:"LISTEN"` Dial certManager.Config `envconfig:"DIAL"` JwksURL string `envconfig:"JWKS_URL"` ResourceDirectoryAddr string `envconfig:"RESOURCE_DIRECTORY_ADDRESS" default:"127.0.0.1:9100"` }
Config represent application configuration
func ParseConfig ¶
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, 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() }
Click to show internal directories.
Click to hide internal directories.