Documentation ¶
Index ¶
Constants ¶
const ( LogLevelNone = "none" LogLevelDebug = "debug" LogLevelInfo = "info" LogLevelWarn = "warn" LogLevelError = "error" )
List of available log levels
Variables ¶
var ( // ErrNoAddr is returned when the server address is missing from configuration ErrNoAddr = errors.New("no address supplied") // ErrNoCert is returned when the certificate path is missing from configuration ErrNoCert = errors.New("no certificate path supplied") // ErrNoKey is returned when the key path is missing from configuration ErrNoKey = errors.New("no key path supplied") // ErrNoPassphrase is returned when the passphrase is missing from configuration ErrNoPassphrase = errors.New("no database passphrase supplied") // ErrNoDatabase is returned when the database name is missing ErrNoDatabase = errors.New("no database name supplied") // ErrUnsupportedDBType is returned when an invalid DB type is provided in configuration ErrUnsupportedDBType = errors.New("unknown or unsupported database type") // ErrNoDBFile is returned when no database file is provided in configuration ErrNoDBFile = errors.New("no database file supplied") // ErrNoUsername is returned when no username is provided in configuration ErrNoUsername = errors.New("no username supplied") // ErrNoPassword is returned when no password is provided in configuration ErrNoPassword = errors.New("no password supplied") // ErrInvalidSecureConnection is returned when an invalid secure connection mode is provided. // see available config.DBSecureConnectionType ErrInvalidSecureConnection = errors.New("invalid secure connection mode") // ErrNoSchema is returned when database configuration is missing a schema (postgres only) ErrNoSchema = errors.New("no schema supplied") // ErrAtLeastOneURLRequired is returned when a list of urls is empty but require at least one ErrAtLeastOneURLRequired = errors.New("at least one url is required") // ErrIndexNameRequired is returned when a index name is empty but required ErrIndexNameRequired = errors.New("index name is required") // ErrGRPCAddrRequired is returned when the http-grpc-host-port is empty but required ErrGRPCAddrRequired = errors.New("http-grpc-host-port is required") // ErrInvalidCryptoMode is returned when the provided crypto mode is unknown ErrInvalidCryptoMode = errors.New("crypto-mode is invalid") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Monitor bool Crypto CryptoCfg GRPC ServerCfg HTTP HTTPServerCfg MQTT MQTTCfg Kafka KafkaCfg GCP GCPCfg DB DBCfg OpencensusSampleAll bool OpencensusAddress string ES ESCfg LoggerLevel string }
Config type holds the application configuration
func (*Config) ViperCfgFields ¶
func (cfg *Config) ViperCfgFields() []slibcfg.ViperCfgField
ViperCfgFields returns the list of configuration fields to be loaded by viper
type CryptoCfg ¶
type CryptoCfg struct { C2PrivateKeyPath string NewClientKeySendPubkey bool // contains filtered or unexported fields }
CryptoCfg holds the crypto configuration
func (CryptoCfg) CryptoMode ¶
func (c CryptoCfg) CryptoMode() CryptoMode
CryptoMode returns configured mode as CryptoMode
type CryptoMode ¶
type CryptoMode string
CryptoMode defines the type of cryptography used by the C2 instance
const ( SymKey CryptoMode = "symkey" PubKey CryptoMode = "pubkey" )
List of crypto modes supported
type DBCfg ¶
type DBCfg struct { Logging bool Type slibcfg.DBType File string Host string Database string Username string Password string Passphrase string Schema string SecureConnection slibcfg.DBSecureConnectionType }
DBCfg holds configuration for databases
func (DBCfg) ConnectionString ¶
ConnectionString returns the string to use to establish the db connection
type ESCfg ¶
type ESCfg struct { Enable bool URLs []string MessageIndexName string // contains filtered or unexported fields }
ESCfg holds ElasticSearch config
func (ESCfg) IsMessageLoggingEnabled ¶
IsMessageLoggingEnabled indicate whenever broker message must be logged to elasticsearch
type GCPCfg ¶
type GCPCfg struct { Enabled bool ProjectID string Region string RegistryID string CommandSubFolder string }
GCPCfg holds configuration for GCP IoT Core
type HTTPServerCfg ¶
HTTPServerCfg extends the ServerCfg for the HTTP
func (HTTPServerCfg) Validate ¶
func (c HTTPServerCfg) Validate() error
Validate checks HTTPServerCfg and returns an error if anything is invalid