Documentation ¶
Index ¶
- Constants
- func WithContext(ctx context.Context, cfg *Config) context.Context
- type Config
- type Database
- type Directories
- func (dr *Directories) GetData() string
- func (dr *Directories) GetDataFirmware() string
- func (dr *Directories) GetDataInternal() string
- func (dr *Directories) GetDataStorage() string
- func (dr *Directories) GetGatewayLogs() string
- func (dr *Directories) GetGatewayTmp() string
- func (dr *Directories) GetLogs() string
- func (dr *Directories) GetTmp() string
- type HttpConfig
- type HttpsACMEConfig
- type HttpsSSLConfig
- type LogLevelConfig
- type LoggerConfig
- type StartupRestore
- type SystemStartupJobs
- type TelemetryConfig
- type UserStartupJobs
- type WebConfig
Constants ¶
View Source
const ( SystemStartJobsFilename = "system_startup_jobs.yaml" UserStartJobsFilename = "user_startup_jobs.yaml" )
View Source
const ( DefaultDirDataRoot = "/tmp/mc/data" // default data dir location DefaultDirLogsRoot = "/tmp/mc/logs" // default logs dir location DefaultDirTmp = "/tmp/mc/tmp" // default tmp dir location DirectoryDataFirmware = "/firmware" // location to keep firmware files DirectoryDataStorage = "/storage" // location to keep storage database exported files DirectoryDataInternal = "/internal" // location to keep system internal files DirectoryGatewayLogs = "/gateway_logs" // location to keep gateway message logs DirectoryGatewayTmp = "/gateway_tmp" // location to keep gateway related tmp items )
Files, directory locations
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Secret string `yaml:"secret"` // secret used to encrypt sensitive data Telemetry TelemetryConfig `yaml:"telemetry"` Web WebConfig `yaml:"web"` Logger LoggerConfig `yaml:"logger"` Directories Directories `yaml:"directories"` Bus cmap.CustomMap `yaml:"bus"` Gateway sfTY.ServiceFilter `yaml:"gateway"` Handler sfTY.ServiceFilter `yaml:"handler"` Task sfTY.ServiceFilter `yaml:"task"` Schedule sfTY.ServiceFilter `yaml:"schedule"` VirtualAssistant sfTY.ServiceFilter `yaml:"virtual_assistant"` Database Database `yaml:"database"` }
Config of the system
type Database ¶
type Database struct { Storage cmap.CustomMap `yaml:"storage"` Metric cmap.CustomMap `yaml:"metric"` }
Database to be used
type Directories ¶
type Directories struct { Data string `yaml:"data"` Logs string `yaml:"logs"` Tmp string `yaml:"tmp"` }
Directories for data and logs
func (*Directories) GetData ¶
func (dr *Directories) GetData() string
return data root directory location
func (*Directories) GetDataFirmware ¶
func (dr *Directories) GetDataFirmware() string
GetDataFirmware location
func (*Directories) GetDataInternal ¶
func (dr *Directories) GetDataInternal() string
GetDirectoryStorage location
func (*Directories) GetDataStorage ¶
func (dr *Directories) GetDataStorage() string
GetDataStorage location
func (*Directories) GetGatewayLogs ¶
func (dr *Directories) GetGatewayLogs() string
GetGatewayLogs location
func (*Directories) GetGatewayTmp ¶
func (dr *Directories) GetGatewayTmp() string
func (*Directories) GetLogs ¶
func (dr *Directories) GetLogs() string
return logs root directory location
func (*Directories) GetTmp ¶
func (dr *Directories) GetTmp() string
returns temporary directory location
type HttpConfig ¶
type HttpConfig struct { Enabled bool `yaml:"enabled"` BindAddress string `yaml:"bind_address"` Port uint `yaml:"port"` }
HttpConfig struct
type HttpsACMEConfig ¶
type HttpsACMEConfig struct { Enabled bool `yaml:"enabled"` BindAddress string `yaml:"bind_address"` Port uint `yaml:"port"` CacheDir string `yaml:"cache_dir"` ACMEDirectory string `yaml:"acme_directory"` Email string `yaml:"email"` Domains []string `yaml:"domains"` }
HttpsACMEConfig struct
type HttpsSSLConfig ¶
type HttpsSSLConfig struct { Enabled bool `yaml:"enabled"` BindAddress string `yaml:"bind_address"` Port uint `yaml:"port"` CertDir string `yaml:"cert_dir"` }
HttpsSSLConfig struct
type LogLevelConfig ¶
type LogLevelConfig struct { Core string `yaml:"core"` WebHandler string `yaml:"web_handler"` Storage string `yaml:"storage"` Metric string `yaml:"metric"` }
LogLevelConfig input
type LoggerConfig ¶
type LoggerConfig struct { Mode string `yaml:"mode"` Encoding string `yaml:"encoding"` Level LogLevelConfig `yaml:"level"` EnableStacktrace bool `yaml:"enable_stacktrace"` }
LoggerConfig input
type StartupRestore ¶
type StartupRestore struct { Enabled bool `json:"enabled" yaml:"enabled"` ExtractedDirectory string `json:"extracted_directory" yaml:"extracted_directory"` ClearDatabase bool `json:"clean_database" yaml:"clean_database"` }
StartupRestore loads data on startup
type SystemStartupJobs ¶
type SystemStartupJobs struct {
Restore StartupRestore `yaml:"restore"`
}
SystemStartupJobs config
type TelemetryConfig ¶
type TelemetryConfig struct {
Enabled bool `yaml:"enabled"`
}
TelemetryConfig input
type UserStartupJobs ¶
type UserStartupJobs struct {
ResetPassword map[string]string `json:"reset_password" yaml:"reset_password"`
}
UserStartupJobs config
type WebConfig ¶
type WebConfig struct { WebDirectory string `yaml:"web_directory"` DocumentationURL string `yaml:"documentation_url"` EnableProfiling bool `yaml:"enable_profiling"` ReadTimeout string `yaml:"read_timeout"` Http HttpConfig `yaml:"http"` HttpsSSL HttpsSSLConfig `yaml:"https_ssl"` HttpsACME HttpsACMEConfig `yaml:"https_acme"` }
WebConfig input
Click to show internal directories.
Click to hide internal directories.