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 { // 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"` // ACSURL is the URL for the ACS. ACSURL string `env:"ACS_URL, required"` // 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"` // UpgradeDelay defines how long the simulator should wait and drop incoming // connection requests to pretend that software upgrades take time. RebootDelay time.Duration `env:"REBOOT_DELAY, default=5s"` // RebootDelay defines how long the simulator should wait and drop incoming // connection requests to pretend that it reboots. UpgradeDelay time.Duration `env:"UPGRADE_DELAY, default=15s"` // 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"` // LogLevel controls how verbose the levels are. Supported values: trace, // debug, info, warn, error, fatal, panic. LogLevel string `env:"LOG_LEVEL, default=info"` }
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 ¶
Click to show internal directories.
Click to hide internal directories.