Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLogLevelFromString ¶
ApplyLogLevelFromString applies the appropriate log level from the string-variant of the level.
func GenerateEncryptionKey ¶
Types ¶
type AutoTLSConfig ¶
type AutoTLSConfig struct {
Production bool `hcl:"production,optional"`
Email string `hcl:"email,attr"`
Domains []string `hcl:"domains,attr"`
DNS *AutoTLSDNSConfig `hcl:"dns,block"`
}
type AutoTLSDNSConfig ¶
type ClusterAutoJoinConfig ¶
type ClusterConfig ¶
type ClusterConfig struct {
Join *ClusterAutoJoinConfig `hcl:"autojoin,block"`
Environment string `hcl:"environment,attr"`
BindAddress string `hcl:"bind_address,optional"`
BindPort int `hcl:"bind_port,optional"`
BindMemberAddress string `hcl:"memberlist_bind_address,optional"`
BindMemberPort int `hcl:"memberlist_bind_port,optional"`
}
type Config ¶
type Config struct {
EncryptionKey string `hcl:"encryption_key,optional"`
LogLevel log.Level
Database *DatabaseConfig `hcl:"database,block"`
HTTP *HTTPConfig `hcl:"http,block"`
Events *EventsConfig `hcl:"events,block"`
Cluster *ClusterConfig `hcl:"cluster,block"`
Developer *DeveloperConfig `hcl:"developer,block"`
Remaining hcl.Body `hcl:",remain"`
}
func NewDevelopment ¶
NewDevelopment creates a Config instance for development purposes where persistence, pubsub, and other service requirements are minimal and can rely on the default in-memory implementations.
This function returns a working Response Server Config instance but persistence is not enabled by default. If persistence is required Response will need to be started with a config file instead of with development defaults.
func NewFromFile ¶
func NewFromFile(path string) (*Config, *spec.Diagnostics)
func (*Config) SetLogLevelFromStr ¶
SetLogLevelFromStr sets the log level from the string-variant of the level's name. Supported strings include trace, debug, info, warn, error, and off. If an unsupported string is provided the `info` level will be set.
type DatabaseConfig ¶
type DatabaseConfig struct {
Type string `hcl:"type,optional"`
Path string `hcl:"path,optional"`
URL string `hcl:"url,optional"`
Name string `hcl:"name,optional"`
Host string `hcl:"host,optional"`
Port int `hcl:"port,optional"`
Username string `hcl:"username,optional"`
Password string `hcl:"password,optional"`
Options map[string]string `hcl:"options,optional"`
}
type DeveloperConfig ¶
type DeveloperConfig struct {
Profiling bool `hcl:"profiling,optional"`
}