Documentation ¶
Index ¶
- Constants
- Variables
- type MapSettings
- type SettingValue
- type Settings
- func (conf *Settings) CleanQueryEntries() int64
- func (conf *Settings) CleanQueryLogs() bool
- func (conf *Settings) CleanResultInterval() int64
- func (conf *Settings) CleanResultLogs() bool
- func (conf *Settings) CleanStatusInterval() int64
- func (conf *Settings) CleanStatusLogs() bool
- func (conf *Settings) CleanupSessions() int64
- func (conf *Settings) DebugHTTP(service string) bool
- func (conf *Settings) DebugService(service string) bool
- func (conf *Settings) DefaultEnv(service string) string
- func (conf *Settings) DeleteValue(service, name string) error
- func (conf *Settings) EmptyValue(service, name, typeValue string) SettingValue
- func (conf *Settings) GetBoolean(service, name string) (bool, error)
- func (conf *Settings) GetInfo(service, name string) (string, error)
- func (conf *Settings) GetInteger(service, name string) (int64, error)
- func (conf *Settings) GetMap(service string) (MapSettings, error)
- func (conf *Settings) GetString(service, name string) (string, error)
- func (conf *Settings) GetValue(service, name string) (SettingValue, error)
- func (conf *Settings) InactiveHours() int64
- func (conf *Settings) IsJSON(service, name string) bool
- func (conf *Settings) IsValue(service, name string) bool
- func (conf *Settings) NewBooleanValue(service, name string, value bool) error
- func (conf *Settings) NewIntegerValue(service, name string, value int64) error
- func (conf *Settings) NewJSON(service, name, value string) error
- func (conf *Settings) NewStringValue(service, name, value string) error
- func (conf *Settings) NewValue(service, name, typeValue string, value interface{}) error
- func (conf *Settings) NodeDashboard() bool
- func (conf *Settings) QueryResultLink() string
- func (conf *Settings) RefreshEnvs(service string) int64
- func (conf *Settings) RefreshSettings(service string) int64
- func (conf *Settings) ResultLogsLink() string
- func (conf *Settings) RetrieveAllJSON(service string) ([]SettingValue, error)
- func (conf *Settings) RetrieveAllValues() ([]SettingValue, error)
- func (conf *Settings) RetrieveJSON(service, name string) (SettingValue, error)
- func (conf *Settings) RetrieveValue(service, name string) (SettingValue, error)
- func (conf *Settings) RetrieveValues(service string) ([]SettingValue, error)
- func (conf *Settings) ServiceMetrics(service string) bool
- func (conf *Settings) SetAllJSON(service, listener, port, host, auth, logging string) error
- func (conf *Settings) SetBoolean(boolValue bool, service, name string) error
- func (conf *Settings) SetInfo(info string, service, name string) error
- func (conf *Settings) SetInteger(intValue int64, service, name string) error
- func (conf *Settings) SetJSON(service, name, value string) error
- func (conf *Settings) SetString(strValue string, service, name string, _json bool) error
- func (conf *Settings) StatusLogsLink() string
- func (conf *Settings) VerifyType(sType string) bool
Constants ¶
const ( ServiceTLS string = "tls" ServiceAdmin string = "admin" ServiceAPI string = "api" )
Types of services
const ( TypeString string = "string" TypeBoolean string = "boolean" TypeInteger string = "integer" )
Types of settings values
const ( AuthNone string = "none" AuthJSON string = "json" AuthDB string = "db" AuthSAML string = "saml" AuthHeaders string = "headers" AuthJWT string = "jwt" )
Types of authentication
const ( LoggingNone string = "none" LoggingStdout string = "stdout" LoggingDB string = "db" LoggingGraylog string = "graylog" LoggingSplunk string = "splunk" LoggingELK string = "elk" LoggingKafka string = "kafka" )
Types of logging
const ( DebugHTTP string = "debug_http" DebugService string = "debug_service" RefreshEnvs string = "refresh_envs" RefreshSettings string = "refresh_settings" CleanupSessions string = "cleanup_sessions" ServiceMetrics string = "service_metrics" MetricsHost string = "metrics_host" MetricsPort string = "metrics_port" MetricsProtocol string = "metrics_protocol" DefaultEnv string = "default_env" InactiveHours string = "inactive_hours" AcceleratedSeconds string = "accelerated_seconds" NodeDashboard string = "node_dashboard" )
Names for all possible settings values for services
const ( QueryResultLink string = "query_result_link" StatusLogsLink string = "status_logs_link" ResultLogsLink string = "result_logs_link" CleanStatusLogs string = "clean_status_logs" CleanStatusInterval string = "clean_status_interval" CleanResultLogs string = "clean_result_logs" CleanResultInterval string = "clean_result_interval" CleanQueryLogs string = "clean_query_logs" CleanQueryEntries string = "clean_query_entries" )
Names for setting values for logging
const ( QueryLink string = "/query/logs/{{NAME}}" StatusLink string = "#status-logs" ResultsLink string = "#result-logs" )
Default values for the setting values for logging
const ( JSONListener string = "json_listener" JSONPort string = "json_port" JSONHost string = "json_host" JSONAuth string = "json_auth" JSONLogging string = "json_logging" )
Names for the values that are read from the JSON config file
Variables ¶
var ValidTypes = map[string]struct{}{ TypeString: struct{}{}, TypeBoolean: struct{}{}, TypeInteger: struct{}{}, }
ValidTypes to check validity of settings type
Functions ¶
This section is empty.
Types ¶
type MapSettings ¶
type MapSettings map[string]SettingValue
MapSettings to hold all values by service
type SettingValue ¶
type SettingValue struct { gorm.Model Name string `gorm:"index"` Service string JSON bool Type string String string Boolean bool Integer int64 Info string }
SettingValue to hold each value for settings
type Settings ¶
Settings keeps all settings values
func NewSettings ¶
NewSettings to initialize the access to settings and table
func (*Settings) CleanQueryEntries ¶
CleanQueryEntries gets the number of entries to cleanup in query logs
func (*Settings) CleanQueryLogs ¶
CleanQueryLogs checks if query logs cleanup is enabled
func (*Settings) CleanResultInterval ¶
CleanResultInterval gets the interval in seconds to cleanup result logs
func (*Settings) CleanResultLogs ¶
CleanResultLogs checks if result logs cleanup is enabled
func (*Settings) CleanStatusInterval ¶
CleanStatusInterval gets the interval in seconds to cleanup status logs
func (*Settings) CleanStatusLogs ¶
CleanStatusLogs checks if status logs cleanup is enabled
func (*Settings) CleanupSessions ¶
CleanupSessions gets the interval in seconds to cleanup expired sessions by service
func (*Settings) DebugService ¶
DebugService checks if debugging is enabled by service
func (*Settings) DefaultEnv ¶
DefaultEnv gets the default environment FIXME customize the fallover one
func (*Settings) DeleteValue ¶
DeleteValue deletes an existing settings value
func (*Settings) EmptyValue ¶
func (conf *Settings) EmptyValue(service, name, typeValue string) SettingValue
EmptyValue creates an empty value
func (*Settings) GetBoolean ¶
GetBoolean gets a boolean settings value by service and name
func (*Settings) GetInteger ¶
GetInteger gets a numeric settings value by service and name
func (*Settings) GetMap ¶
func (conf *Settings) GetMap(service string) (MapSettings, error)
GetMap returns the map of values by service
func (*Settings) GetValue ¶
func (conf *Settings) GetValue(service, name string) (SettingValue, error)
GetValue gets one value from settings by service and name
func (*Settings) InactiveHours ¶
InactiveHours gets the value in hours for a node to be inactive by service
func (*Settings) NewBooleanValue ¶
NewBooleanValue creates a new settings value
func (*Settings) NewIntegerValue ¶
NewIntegerValue creates a new settings value
func (*Settings) NewStringValue ¶
NewStringValue creates a new settings value
func (*Settings) NodeDashboard ¶
NodeDashboard checks if display dashboard per node is enabled
func (*Settings) QueryResultLink ¶
QueryResultLink gets the value to be used to generate links for on-demand queries results
func (*Settings) RefreshEnvs ¶
RefreshEnvs gets the interval in seconds to refresh environments by service
func (*Settings) RefreshSettings ¶
RefreshSettings gets the interval in seconds to refresh settings by service
func (*Settings) ResultLogsLink ¶
ResultLogsLink gets the value to be used to generate links for result logs
func (*Settings) RetrieveAllJSON ¶
func (conf *Settings) RetrieveAllJSON(service string) ([]SettingValue, error)
RetrieveAllJSON retrieves and returns all JSON values from backend
func (*Settings) RetrieveAllValues ¶
func (conf *Settings) RetrieveAllValues() ([]SettingValue, error)
RetrieveAllValues retrieves and returns all values from backend
func (*Settings) RetrieveJSON ¶
func (conf *Settings) RetrieveJSON(service, name string) (SettingValue, error)
RetrieveJSON retrieves one JSON value from settings by service and name from backend
func (*Settings) RetrieveValue ¶
func (conf *Settings) RetrieveValue(service, name string) (SettingValue, error)
RetrieveValue retrieves one value from settings by service and name from backend
func (*Settings) RetrieveValues ¶
func (conf *Settings) RetrieveValues(service string) ([]SettingValue, error)
RetrieveValues retrieves and returns all values from backend
func (*Settings) ServiceMetrics ¶
ServiceMetrics checks if metrics are enabled by service
func (*Settings) SetAllJSON ¶
SetAllJSON sets all the JSON configuration values
func (*Settings) SetBoolean ¶
SetBoolean sets a boolean settings value by service and name
func (*Settings) SetInteger ¶
SetInteger sets a numeric settings value by service and name
func (*Settings) StatusLogsLink ¶
StatusLogsLink gets the value to be used to generate links for status logs
func (*Settings) VerifyType ¶
VerifyType to make sure type is valid