Documentation ¶
Index ¶
- Variables
- func Load(paths []string, conf *Config) error
- func WriteConf(path string, conf *Config) error
- func WriteDefault(path string, conf *Config) error
- type AnalyticsConfigConfig
- type AuthOverrideConf
- type CertData
- type Config
- type DBAppConfOptionsConfig
- type DnsCacheConfig
- type HealthCheckConfig
- type HttpServerOptionsConfig
- type IPsHandleStrategy
- type LivenessCheckConfig
- type LocalSessionCacheConf
- type MonitorConfig
- type NormaliseURLPatterns
- type NormalisedURLConfig
- type PoliciesConfig
- type SlaveOptionsConfig
- type StorageOptionsConf
- type WebHookHandlerConf
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Default = Config{
ListenPort: 8080,
Secret: "352d20ee67be67f6340b4c0605b044b7",
TemplatePath: "templates",
}
)
Functions ¶
func Load ¶
Load will load a configuration file, trying each of the paths given and using the first one that is a regular file and can be opened.
If none exists, a default config will be written to the first path in the list.
An error will be returned only if any of the paths existed but was not a valid config file.
func WriteDefault ¶
WriteDefault will set conf to the default config and write it to disk in path, if the path is non-empty.
Types ¶
type AnalyticsConfigConfig ¶
type AnalyticsConfigConfig struct { Type string `json:"type"` IgnoredIPs []string `json:"ignored_ips"` EnableDetailedRecording bool `json:"enable_detailed_recording"` EnableGeoIP bool `json:"enable_geo_ip"` NormaliseUrls NormalisedURLConfig `json:"normalise_urls"` PoolSize int `json:"pool_size"` RecordsBufferSize uint64 `json:"records_buffer_size"` StorageExpirationTime int `json:"storage_expiration_time"` // contains filtered or unexported fields }
type AuthOverrideConf ¶
type Config ¶
type Config struct { // OriginalPath is the path to the config file that was read. // If none was found, it's the path to the default config file // that was written. OriginalPath string `json:"-"` HostName string `json:"host_name"` ListenAddress string `json:"listen_address"` ListenPort int `json:"listen_port"` ControlAPIHostname string `json:"control_api_hostname"` ControlAPIPort int `json:"control_api_port"` Secret string `json:"secret"` NodeSecret string `json:"node_secret"` PIDFileLocation string `json:"pid_file_location"` AllowInsecureConfigs bool `json:"allow_insecure_configs"` PublicKeyPath string `json:"public_key_path"` AllowRemoteConfig bool `json:"allow_remote_config"` }
Config is the configuration object used by raspberry to set up various parameters.
type DBAppConfOptionsConfig ¶
type DBAppConfOptionsConfig struct { ConnectionString string `json:"connection_string"` NodeIsSegmented bool `json:"node_is_segmented"` Tags []string `json:"tags"` }
DBAppConfOptionsConfig definited for DB
type DnsCacheConfig ¶
type DnsCacheConfig struct { Enbaled bool `json:"enabled"` TTL int64 `json:"ttl"` // CheckInterval controls cache cleanup interval. By convention shouldn't be exposed to config or env_variable_setup CheckInterval int64 `json:"check_interval"` MultipleIPsHandleStategy IPsHandleStrategy `json:"multiple_ips_handle_stategy"` }
type HealthCheckConfig ¶
type HttpServerOptionsConfig ¶
type HttpServerOptionsConfig struct { OverrideDefaults bool `json:"override_defaults"` ReadTimeout int `json:"read_timeout"` WriteTimeout int `json:"write_timeout"` UseSSL bool `json:'use_ssl'` UseLe_SSL bool `json:"use_ssl_le"` EnableHttp2 bool `json:"enable_http2"` SSLInsecureSkipVerify bool `json:"ssl_insecure_skip_verify"` EnableWebSockets bool `json:"enable_web_sockets"` Certificates []CertData `json:"certificates"` SSLCertificates []string `json:"ssl_certificates"` ServerName string `json:"server_name"` MinVersion uint16 `json:"min_version"` FlushIntercal int `json:"flush_interval"` SkipURLCleaning bool `json:"skip_url_cleaning"` SkipTargetPathEscaping bool `json:"skip_target_path_escaping"` Ciphers []string `json:"cliphers"` }
type IPsHandleStrategy ¶
type IPsHandleStrategy string
const ( PickFirstStrategy IPsHandleStrategy = "pick_first" RandomStrategy IPsHandleStrategy = "random" NoCacheStrategy IPsHandleStrategy = "no_cache" DefalutDashPolicySource = "service" DefaultDashPolicyRecordName = "raspberry_policies" )
type LivenessCheckConfig ¶
type LocalSessionCacheConf ¶
type MonitorConfig ¶
type MonitorConfig struct { EnableTriggerMonitors bool `json:"enable_trigger_monitors"` Config WebHookHandlerConf `json:"configuration"` GlobalTriggerLimit float64 `json:"global_trogger_limit"` MonitorUserKeys bool `json:"monitor_user_keys"` MonitorOrgKeys bool `json:"monitor_org_keys"` }
type NormaliseURLPatterns ¶
type NormalisedURLConfig ¶
type NormalisedURLConfig struct { Enabled bool `json:"enabled"` NormaliseUUIDs bool `json:"normalise_uuids"` NormaliseNumbers bool `json:"normalise_numbers"` Custom []string `json:"custom_patterns"` CompiledPatternSet NormaliseURLPatterns `json:"-"` // see analytics.go }
type PoliciesConfig ¶
type SlaveOptionsConfig ¶
type SlaveOptionsConfig struct { UseRPC bool `json:"use_roc"` UseSSL bool `json:"use_ssl"` SSLInsecureSkipVerify bool `json:"ssl_insecure_skip_vevify"` ConnectionString string `json:"connection_string"` RPCKey string `json:"rpc_key"` APIKey string `json:"api_key"` EnableRPCCache bool `json:"enable_rpc_cache"` BindToSlugsInsteadOfListenPaths bool `json:"bind_to_slugs"` DisableKeySpaceSync bool `json:"disable_key_space_sync"` GroupID string `json:"group_id"` CallTimeout int `json:"call_timeout"` PingTimeout int `json:"ping_timeout"` RPCPoolSize int `json:"rpc_pool_size"` }
type StorageOptionsConf ¶
type StorageOptionsConf struct { Type string `json:"type"` Host string `json:"host"` Port int `json:"port"` Hosts map[string]string `json:"hosts"` Addrs []string `json:"addrs"` MasterName string `json:"master_name"` Username string `json:"username"` Password string `json:"password"` Database int `json:"database"` MaxIdle int `json:"optimisation_max_idle"` MaxActive int `json:"optimisation_max_active"` Timeout int `json:"timeout"` EnableCluster bool `json:"enable_cluster"` UseSSL bool `json:"use_ssl"` SSLInsecureSkipVerify bool `json:"ssl_insecure_skip_verify"` }
StorageOptionsConf definited for storage
type WebHookHandlerConf ¶
type WebHookHandlerConf struct { Method string `bson:"method" json:"method"` TargetPath string `bson:"target_path" json:"target_path"` TemplatePath string `bson:"template_path" josn:"template_path"` HeaderList map[string]string `bson:"header_map" json:"header_map"` EventTimeout int64 `bson:"event_timeout" json:"event_timeout"` }
Click to show internal directories.
Click to hide internal directories.