Documentation
¶
Index ¶
- Constants
- Variables
- type MapSettings
- type SettingValue
- type Settings
- func (conf *Settings) CleanupExpired() int64
- func (conf *Settings) CleanupSessions() int64
- func (conf *Settings) DebugHTTP(service string, envID uint) bool
- func (conf *Settings) DebugService(service string) bool
- func (conf *Settings) DeleteValue(service, name string, envID uint) error
- func (conf *Settings) EmptyValue(service, name, typeValue string, envID uint) SettingValue
- func (conf *Settings) GetBoolean(service, name string, envID uint) (bool, error)
- func (conf *Settings) GetInfo(service, name string, envID uint) (string, error)
- func (conf *Settings) GetInteger(service, name string, envID uint) (int64, error)
- func (conf *Settings) GetMap(service string, envID uint) (MapSettings, error)
- func (conf *Settings) GetString(service, name string, envID uint) (string, error)
- func (conf *Settings) GetValue(service, name string, envID uint) (SettingValue, error)
- func (conf *Settings) InactiveHours(envID uint) int64
- func (conf *Settings) IsJSON(service, name string, envID uint) bool
- func (conf *Settings) IsValue(service, name string, envID uint) bool
- func (conf *Settings) NewBooleanValue(service, name string, value bool, envID uint) error
- func (conf *Settings) NewIntegerValue(service, name string, value int64, envID uint) error
- func (conf *Settings) NewJSON(service, name, value string, envID uint) error
- func (conf *Settings) NewStringValue(service, name, value string, envID uint) error
- func (conf *Settings) NewValue(service, name, typeValue string, value interface{}, envID uint) error
- func (conf *Settings) NodeDashboard(envID uint) bool
- func (conf *Settings) OnelinerExpiration(envID uint) bool
- func (conf *Settings) RefreshEnvs(service string) int64
- func (conf *Settings) RefreshSettings(service string) int64
- func (conf *Settings) RetrieveAll() ([]SettingValue, error)
- func (conf *Settings) RetrieveAllEnv(envID uint) ([]SettingValue, error)
- func (conf *Settings) RetrieveAllEnvJSON(service string, envID uint) ([]SettingValue, error)
- func (conf *Settings) RetrieveAllEnvValues(envID uint) ([]SettingValue, error)
- func (conf *Settings) RetrieveAllJSON(service string) ([]SettingValue, error)
- func (conf *Settings) RetrieveAllValues() ([]SettingValue, error)
- func (conf *Settings) RetrieveJSON(service, name string, envID uint) (SettingValue, error)
- func (conf *Settings) RetrieveValue(service, name string, envID uint) (SettingValue, error)
- func (conf *Settings) RetrieveValues(service string, jsonSetting bool, envID uint) ([]SettingValue, error)
- func (conf *Settings) ServiceMetrics(service string) bool
- func (conf *Settings) SetAPIJSON(cfg types.JSONConfigurationAPI, envID uint) error
- func (conf *Settings) SetAdminJSON(cfg types.JSONConfigurationAdmin, envID uint) error
- func (conf *Settings) SetBoolean(boolValue bool, service, name string, envID uint) error
- func (conf *Settings) SetInfo(info string, service, name string, envID uint) error
- func (conf *Settings) SetInteger(intValue int64, service, name string, envID uint) error
- func (conf *Settings) SetJSON(service, name, value string, envID uint) error
- func (conf *Settings) SetString(strValue string, service, name string, _json bool, envID uint) error
- func (conf *Settings) SetTLSJSON(cfg types.JSONConfigurationTLS, envID uint) error
- func (conf *Settings) VerifyService(sType string) bool
- 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" AuthJWT string = "jwt" AuthOAuth string = "oauth" AuthOIDC string = "oidc" )
Types of authentication
const ( LoggingNone string = "none" LoggingStdout string = "stdout" LoggingFile string = "file" LoggingDB string = "db" LoggingGraylog string = "graylog" LoggingSplunk string = "splunk" LoggingLogstash string = "logstash" LoggingKinesis string = "kinesis" LoggingS3 string = "s3" LoggingKafka string = "kafka" LoggingElastic string = "elastic" )
Types of logging
const ( CarverLocal string = "local" CarverDB string = "db" CarverS3 string = "s3" )
Types of carver
const ( ScriptEnroll string = "enroll" ScriptRemove string = "remove" )
Types of script
const ( ActionExpire string = "expire" ActionExtend string = "extend" ActionRotate string = "rotate" ActionNotexpire string = "notexpire" SetMacPackage string = "set_pkg" SetMsiPackage string = "set_msi" SetDebPackage string = "set_deb" SetRpmPackage string = "set_rpm" )
Types of enroll/remove actions
const ( QueryDelete string = "delete" QueryExpire string = "expire" QueryComplete string = "complete" CarveDelete string = QueryDelete CarveExpire string = QueryExpire CarveComplete string = QueryComplete )
Types of query/carve actions
const ( PackageDeb string = "deb" PackageRpm string = "rpm" PackagePkg string = "pkg" PackageMsi string = "msi" )
Types of package
const ( DownloadSecret string = "secret" DownloadCert string = "cert" DownloadFlags string = "flags" DownloadFlagsMac string = "flagsMac" DownloadFlagsWin string = "flagsWindows" DownloadFlagsLinux string = "flagsLinux" DownloadFlagsFreeBSD string = "flagsFreeBSD" )
Types of download target
const ( PlatformDarwin string = "darwin" PlatformLinux string = "linux" PlatformWindows string = "windows" )
Types of platform
const ( DebugHTTP string = "debug_http" DebugService string = "debug_service" RefreshEnvs string = "refresh_envs" RefreshSettings string = "refresh_settings" CleanupSessions string = "cleanup_sessions" CleanupExpired string = "cleanup_expired" ServiceMetrics string = "service_metrics" MetricsHost string = "metrics_host" MetricsPort string = "metrics_port" MetricsProtocol string = "metrics_protocol" InactiveHours string = "inactive_hours" AcceleratedSeconds string = "accelerated_seconds" NodeDashboard string = "node_dashboard" OnelinerExpiration string = "oneliner_expiration" )
Names for all possible settings values for services
const ( JSONListener string = "json_listener" JSONPort string = "json_port" JSONHost string = "json_host" JSONAuth string = "json_auth" JSONLogger string = "json_logger" JSONCarver string = "json_carver" JSONSessionKey string = "json_sessionkey" )
Names for the values that are read from the JSON config file
const (
NoEnvironmentID = iota
)
Values for generic IDs
Variables ¶
var ValidServices = map[string]struct{}{ ServiceTLS: struct{}{}, ServiceAdmin: struct{}{}, ServiceAPI: struct{}{}, }
ValidServices to check validity of settings service
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 EnvironmentID uint 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) CleanupExpired ¶
CleanupExpired gets the interval in seconds to cleanup expired queries and carves
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) DeleteValue ¶
DeleteValue deletes an existing settings value
func (*Settings) EmptyValue ¶
func (conf *Settings) EmptyValue(service, name, typeValue string, envID uint) 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, envID uint) (MapSettings, error)
GetMap returns the map of values by service, excluding JSON
func (*Settings) GetValue ¶
func (conf *Settings) GetValue(service, name string, envID uint) (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) NewValue ¶
func (conf *Settings) NewValue(service, name, typeValue string, value interface{}, envID uint) error
NewValue creates a new settings value
func (*Settings) NodeDashboard ¶
NodeDashboard checks if display dashboard per node is enabled
func (*Settings) OnelinerExpiration ¶
OnelinerExpiration checks if enrolling links will expire
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) RetrieveAll ¶
func (conf *Settings) RetrieveAll() ([]SettingValue, error)
RetrieveAll retrieves and returns all values from backend
func (*Settings) RetrieveAllEnv ¶
func (conf *Settings) RetrieveAllEnv(envID uint) ([]SettingValue, error)
RetrieveAllEnv retrieves and returns all values from backend per environment
func (*Settings) RetrieveAllEnvJSON ¶
func (conf *Settings) RetrieveAllEnvJSON(service string, envID uint) ([]SettingValue, error)
RetrieveAllEnvJSON retrieves and returns all JSON values from backend
func (*Settings) RetrieveAllEnvValues ¶
func (conf *Settings) RetrieveAllEnvValues(envID uint) ([]SettingValue, error)
RetrieveAllEnvValues retrieves and returns all values excepting JSON from backend
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 excepting JSON from backend
func (*Settings) RetrieveJSON ¶
func (conf *Settings) RetrieveJSON(service, name string, envID uint) (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, envID uint) (SettingValue, error)
RetrieveValue retrieves one value from settings by service and name from backend
func (*Settings) RetrieveValues ¶
func (conf *Settings) RetrieveValues(service string, jsonSetting bool, envID uint) ([]SettingValue, error)
RetrieveValues retrieves and returns all values from backend
func (*Settings) ServiceMetrics ¶
ServiceMetrics checks if metrics are enabled by service
func (*Settings) SetAPIJSON ¶
func (conf *Settings) SetAPIJSON(cfg types.JSONConfigurationAPI, envID uint) error
SetAPIJSON sets all the JSON configuration values for API service
func (*Settings) SetAdminJSON ¶
func (conf *Settings) SetAdminJSON(cfg types.JSONConfigurationAdmin, envID uint) error
SetAdminJSON sets all the JSON configuration values for admin service
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) SetString ¶
func (conf *Settings) SetString(strValue string, service, name string, _json bool, envID uint) error
SetString sets a boolean settings value by service and name
func (*Settings) SetTLSJSON ¶
func (conf *Settings) SetTLSJSON(cfg types.JSONConfigurationTLS, envID uint) error
SetTLSJSON sets all the JSON configuration values for TLS service
func (*Settings) VerifyService ¶
VerifyService to make sure service is valid
func (*Settings) VerifyType ¶
VerifyType to make sure type is valid