Documentation
¶
Index ¶
- Constants
- Variables
- func CreateHTTPForms(hrefUri *url.URL, opsBits resources.SupportedOperation, ...) []wotTD.FormElementProperty
- func New(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, ...) (*service.Service, error)
- func ThingPatchLink(le wotTD.IconLinkElement, validateDevice map[string]struct{}) (wotTD.IconLinkElement, bool)
- func ThingSetSecurity(td *wotTD.ThingDescription, openIDConfigs []openid.Config)
- type APIsConfig
- type ClientsConfig
- type Config
- type GetThingsResponse
- type GrpcServerConfig
- type HTTPConfig
- type MainSidebarConfig
- type OAuthClient
- type RequestHandler
- type ThingLink
- type UIConfig
- type VisibilityConfig
- type WebConfiguration
- type WebSocketConfig
Constants ¶
View Source
const ( ThingLinkRelationItem = "item" ThingLinkRelationCollection = "collection" )
View Source
const (
AuthorizationWhiteListedEndpointsRegexp = `^\/(a$|[^a].*|ap$|a[^p].*|ap[^i].*|api[^/])`
)
Variables ¶
View Source
var ( ApplicationSubscribeToEventsProtoJsonContentType = "application/subscribetoeventsprotojson" ApplicationSubscribeToEventsMIMEWildcard = "application/subscribetoeventswc" )
Functions ¶
func CreateHTTPForms ¶ added in v2.19.0
func CreateHTTPForms(hrefUri *url.URL, opsBits resources.SupportedOperation, contentType message.MediaType) []wotTD.FormElementProperty
func New ¶
func New(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, logger log.Logger) (*service.Service, error)
New parses configuration and creates new Server with provided store and bus
func ThingPatchLink ¶ added in v2.19.0
func ThingPatchLink(le wotTD.IconLinkElement, validateDevice map[string]struct{}) (wotTD.IconLinkElement, bool)
func ThingSetSecurity ¶ added in v2.19.0
func ThingSetSecurity(td *wotTD.ThingDescription, openIDConfigs []openid.Config)
Types ¶
type APIsConfig ¶
type APIsConfig struct {
HTTP HTTPConfig `yaml:"http" json:"http"`
}
Config represent application configuration
func (*APIsConfig) Validate ¶
func (c *APIsConfig) Validate() error
type ClientsConfig ¶
type ClientsConfig struct {
GrpcGateway GrpcServerConfig `yaml:"grpcGateway" json:"grpcGateway"`
OpenTelemetryCollector http.OpenTelemetryCollectorConfig `yaml:"openTelemetryCollector" json:"openTelemetryCollector"`
}
func (*ClientsConfig) Validate ¶
func (c *ClientsConfig) Validate() error
type Config ¶
type Config struct {
Log log.Config `yaml:"log" json:"log"`
APIs APIsConfig `yaml:"apis" json:"apis"`
Clients ClientsConfig `yaml:"clients" json:"clients"`
UI UIConfig `yaml:"ui" json:"ui"`
}
type GetThingsResponse ¶ added in v2.19.0
type GetThingsResponse struct {
Base string `json:"base"`
Security *wotTD.TypeDeclaration `json:"security"`
ID string `json:"id"`
SecurityDefinitions map[string]wotTD.SecurityScheme `json:"securityDefinitions"`
Links []ThingLink `json:"links"`
}
type GrpcServerConfig ¶
func (*GrpcServerConfig) Validate ¶
func (c *GrpcServerConfig) Validate() error
type HTTPConfig ¶
type HTTPConfig struct {
Connection listener.Config `yaml:",inline" json:",inline"`
WebSocket WebSocketConfig `yaml:"webSocket" json:"webSocket"`
Authorization validator.Config `yaml:"authorization" json:"authorization"`
Server server.Config `yaml:",inline" json:",inline"`
}
func (*HTTPConfig) Validate ¶
func (c *HTTPConfig) Validate() error
type MainSidebarConfig ¶ added in v2.16.3
type MainSidebarConfig struct {
Devices bool `yaml:"devices" json:"devices"`
Configuration bool `yaml:"configuration" json:"configuration"`
RemoteClients bool `yaml:"remoteClients" json:"remoteClients"`
PendingCommands bool `yaml:"pendingCommands" json:"pendingCommands"`
Certificates bool `yaml:"certificates" json:"certificates"`
DeviceProvisioning bool `yaml:"deviceProvisioning" json:"deviceProvisioning"`
Docs bool `yaml:"docs" json:"docs"`
ChatRoom bool `yaml:"chatRoom" json:"chatRoom"`
Dashboard bool `yaml:"dashboard" json:"dashboard"`
Integrations bool `yaml:"integrations" json:"integrations"`
DeviceFirmwareUpdate bool `yaml:"deviceFirmwareUpdate" json:"deviceFirmwareUpdate"`
DeviceLogs bool `yaml:"deviceLogs" json:"deviceLogs"`
ApiTokens bool `yaml:"apiTokens" json:"apiTokens"`
SchemaHub bool `yaml:"schemaHub" json:"schemaHub"`
SnippetService bool `yaml:"snippetService" json:"snippetService"`
}
func (*MainSidebarConfig) ToProto ¶ added in v2.16.3
func (c *MainSidebarConfig) ToProto() *pb.UIVisibility_MainSidebar
type OAuthClient ¶ added in v2.21.0
type OAuthClient struct {
Authority string `yaml:"authority" json:"authority,omitempty"`
ClientID string `yaml:"clientID" json:"clientId"`
Audience string `yaml:"audience" json:"audience"`
Scopes []string `yaml:"scopes" json:"scopes"`
ProviderName string `json:"providerName" yaml:"providerName,omitempty"`
GrantType string `json:"grantType" yaml:"grantType"`
ClientAssertionType string `json:"clientAssertionType" yaml:"clientAssertionType"`
}
func (*OAuthClient) ToProto ¶ added in v2.21.0
func (c *OAuthClient) ToProto() *pb.OAuthClient
func (*OAuthClient) Validate ¶ added in v2.21.0
func (c *OAuthClient) Validate() error
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler for handling incoming request
func NewRequestHandler ¶
func NewRequestHandler(config *Config, r *mux.Router, client *client.Client, openIDConfigs []openid.Config, logger log.Logger) (*RequestHandler, error)
NewHTTP returns HTTP handler
func (*RequestHandler) CancelPendingCommands ¶
func (requestHandler *RequestHandler) CancelPendingCommands(w http.ResponseWriter, r *http.Request)
type UIConfig ¶
type UIConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Directory string `json:"directory" yaml:"directory"`
WebConfiguration WebConfiguration `json:"webConfiguration" yaml:"webConfiguration"`
}
UIConfig represents user interface configuration
type VisibilityConfig ¶ added in v2.16.3
type VisibilityConfig struct {
MainSidebar MainSidebarConfig `yaml:"mainSidebar" json:"mainSidebar"`
}
func (*VisibilityConfig) ToProto ¶ added in v2.16.3
func (c *VisibilityConfig) ToProto() *pb.UIVisibility
type WebConfiguration ¶
type WebConfiguration struct {
Authority string `yaml:"-" json:"authority"`
HTTPGatewayAddress string `yaml:"httpGatewayAddress" json:"httpGatewayAddress"`
DeviceProvisioningService string `yaml:"deviceProvisioningService" json:"deviceProvisioningService"`
SnippetService string `yaml:"snippetService" json:"snippetService"`
WebOAuthClient OAuthClient `yaml:"webOAuthClient" json:"webOauthClient"`
DeviceOAuthClient OAuthClient `yaml:"deviceOAuthClient" json:"deviceOauthClient"`
M2MOAuthClient *OAuthClient `yaml:"m2mOAuthClient" json:"m2mOauthClient"`
Visibility VisibilityConfig `yaml:"visibility" json:"visibility"`
}
WebConfiguration represents web configuration for user interface exposed via getOAuthConfiguration handler
func (*WebConfiguration) Validate ¶
func (c *WebConfiguration) Validate() error
type WebSocketConfig ¶
type WebSocketConfig struct {
StreamBodyLimit int `yaml:"streamBodyLimit" json:"streamBodyLimit"`
PingFrequency time.Duration `yaml:"pingFrequency" json:"pingFrequency"`
}
func (*WebSocketConfig) Validate ¶
func (c *WebSocketConfig) Validate() error
Source Files
¶
- cancelPendingCommands.go
- cancelPendingMetadataUpdate.go
- config.go
- createResource.go
- deleteDevice.go
- getDevice.go
- getDevicePendingCommands.go
- getDeviceResourceLinks.go
- getDeviceResources.go
- getEvents.go
- getHubConfiguration.go
- getPendingMetadataUpdates.go
- getResource.go
- getResourcePendingCommands.go
- getThings.go
- getWebConfiguration.go
- jsonWriter.go
- requestHandler.go
- service.go
- subscribeToEvents.go
- updateResource.go
Click to show internal directories.
Click to hide internal directories.