Documentation
¶
Index ¶
Constants ¶
View Source
const ( // AuthDigest an identifier for HTTP digest access authentication. AuthDigest = "digest" // AuthNone an identifier for no HTTP authentication. AuthNone = "none" )
Variables ¶
View Source
var Config struct { // LogLevel controls how verbose the levels are. Supported values: trace, // debug, info, warn, error, fatal, panic. LogLevel string `env:"LOG_LEVEL, default=info"` // Host is the host name or IP address used by the simulator to accept // connection requests. If no value is provided it will be automatically // resolved. Host string `env:"API_HOST"` // Port defines the port number used by the simulator to accept connection // requests. Port uint16 `env:"API_PORT, default=7547"` // SerialNumber will overwrite the DeviceInfo.SerialNumber datamodel // parameter value. SerialNumber string `env:"SERIAL_NUMBER, required"` // DataModelPath must point to a datamodel file in CSV format. DataModelPath string `env:"DATAMODEL_PATH, required"` // StateFilePath points to the state file. If the file doesn't exist it will // be created and will maintain all changes made to the datamodel. Missing // state file will trigger a BOOTSTRAP inform event. StateFilePath string `env:"STATE_PATH, default=state.json"` // ACSURL is the URL for the ACS. ACSURL string `env:"ACS_URL, required"` // ACSAuth configures authentication scheme for the ACS. It defaults to // "none". Supported values: digest, none ACSAuth string `env:"ACS_AUTH, default=none"` // ACSUsername is used to authenticate requests to the ACS. ACSUsername string `env:"ACS_USERNAME"` // ACSPassword is used to authenticate requests to the ACS. ACSPassword string `env:"ACS_PASSWORD"` // ACSVerifyTLS when set to false ignores certificate errors when connecting // to the ACS. ACSVerifyTLS bool `env:"ACS_VERIFY_TLS, default=false"` // NormalizeParameters when set to true will attempt to normalize datamodel // parameter types and values in order to bring them closer to the spec. NormalizeParameters bool `env:"NORMALIZE_PARAMETERS, default=false"` // RebootDelay defines how long the simulator should wait and drop incoming // connection requests to pretend that it reboots. RebootDelay time.Duration `env:"REBOOT_DELAY, default=5s"` // UpgradeDelay defines how long the simulator should wait and drop incoming // connection requests to pretend that software upgrades take time. UpgradeDelay time.Duration `env:"UPGRADE_DELAY, default=15s"` // ConnectionTimeout defines how long it can take to establish a TCP // connection with the ACS. ConnectionTimeout time.Duration `env:"CONNECTION_TIMEOUT, default=5s"` // RequestTimeout defines how long request processing could take. RequestTimeout time.Duration `env:"REQUEST_TIMEOUT, default=5s"` }
Config is a global configuration store.
View Source
var ErrNoCreds = errors.New("username/password missing")
ErrNoCreds is returned when ACS authentication is configured for digest access authentication but no credentials are provided.
Functions ¶
func LoadConfig ¶
LoadConfig attempts to load configuration from environment variables.
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.