Documentation
¶
Overview ¶
Package provision contains domain concept definitions needed to support Provision service feature, i.e. automate provision process.
Index ¶
Constants ¶
View Source
const ( ExternalID = "externalID" Active = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { File string `toml:"file"` Server ServiceConf `toml:"server"` Bootstrap Bootstrap `toml:"bootstrap"` Things []Thing `toml:"things" mapstructure:"things"` Channels []Channel `toml:"channels" mapstructure:"channel"` }
Config struct of Provision
type Result ¶
type Result struct { Things []provSDK.Thing `json:"things,omitempty"` ThingsID []string `json:"thing_ids,omitempty"` Channels []provSDK.Channel `json:"channels,omitempty"` ClientCert map[string]string `json:"client_cert,omitempty"` ClientKey map[string]string `json:"client_key,omitempty"` CACert string `json:"ca_cert,omitempty"` Whitelisted map[string]bool `json:"whitelisted,omitempty"` }
Result represent what is created with additional info.
type Service ¶
type Service interface { // Provision is the only method this API specifies. Depending on the configuration, // the following actions will can be executed: // - create a Thing based od mac address // - create multiple Channels // - create Bootstrap configuration // - whitelist Thing in Bootstrap configuration == connect Thing to Channels Provision(externalID, externalKey string) (Result, error) }
Service specifies Provision service API.
type ServiceConf ¶
type ServiceConf struct { Port string `toml:"port"` LogLevel string `toml:"log_level"` TLS bool `toml:"tls"` CACerts string `toml:"ca_certs"` ServerCert string `toml:"server_cert"` ServerKey string `toml:"server_key"` ThingsLocation string `toml:"things_location"` UsersLocation string `toml:"users_location"` MQTTURL string `toml:"mqtt_url"` HTTPPort string `toml:"http_port"` MfUser string `toml:"mf_user"` MfPass string `toml:"mf_pass"` MfApiKey string `toml:"mf_api_key"` MfBSURL string `toml:"mf_bs_url"` MfWhiteListURL string `toml:"mf_whit_list"` MfCertsURL string `toml:"mf_certs_url"` }
Service represents service config.
Click to show internal directories.
Click to hide internal directories.