Documentation ¶
Index ¶
- Constants
- Variables
- type ClickHouse
- func (c *ClickHouse) GetDSN() string
- func (c *ClickHouse) GetDatabase() string
- func (c *ClickHouse) GetEnabled() bool
- func (c *ClickHouse) GetHostname() string
- func (c *ClickHouse) GetPassword() string
- func (c *ClickHouse) GetPort() int
- func (c *ClickHouse) GetSchema() string
- func (c *ClickHouse) GetUsername() string
- func (c *ClickHouse) String() string
- type Command
- func (c *Command) ExitCodeReportsFailure(code int) bool
- func (c *Command) ExpandCommand(macro *macros.Expander) []string
- func (c *Command) ExpandCommandLine(macro *macros.Expander) string
- func (c *Command) GetCommand() []string
- func (c *Command) GetCommandLine() string
- func (c *Command) GetEnabled() bool
- func (c *Command) GetEnv() []string
- func (c *Command) GetWorkdir() string
- func (c *Command) String() string
- type Dir
- type DirFile
- type ExitCodeIntervals
- type File
- type JWT
- type Kafka
- type Log
- type Manticore
- type MinIO
- func (m *MinIO) GetAccessKeyID() string
- func (m *MinIO) GetBucket() string
- func (m *MinIO) GetBucketAutoCreate() bool
- func (m *MinIO) GetEnabled() bool
- func (m *MinIO) GetEndpoint() string
- func (m *MinIO) GetInsecureSkipVerify() bool
- func (m *MinIO) GetRegion() string
- func (m *MinIO) GetSecretAccessKey() string
- func (m *MinIO) GetSecure() bool
- func (m *MinIO) String() string
- type MultiPaths
- func (f *MultiPaths) Get(name string, opts ...*PathsOpts) string
- func (f *MultiPaths) GetAll(name string, opts ...*PathsOpts) []string
- func (f *MultiPaths) GetFile(filename, name string, opts ...*PathsOpts) string
- func (f *MultiPaths) GetMap() map[string][]string
- func (f *MultiPaths) GetNames() []string
- func (f *MultiPaths) String() string
- type MySQL
- type NamedCommands
- type OAuth
- func (o *OAuth) GetClientID() string
- func (o *OAuth) GetClientSecret() string
- func (o *OAuth) GetEnabled() bool
- func (o *OAuth) GetEndpointParams() url.Values
- func (o *OAuth) GetInitialAccessToken() string
- func (o *OAuth) GetJWT() *JWT
- func (o *OAuth) GetRegisterURL() string
- func (o *OAuth) GetTokenURL() string
- func (o *OAuth) String() string
- type OAuthConfigurator
- type OTP
- type OTPConfigurator
- type Paths
- func (f *Paths) Get(name string, opts ...*PathsOpts) string
- func (f *Paths) GetAll(name string, opts ...*PathsOpts) []string
- func (f *Paths) GetFile(filename, name string, opts ...*PathsOpts) string
- func (f *Paths) GetMap() map[string]string
- func (f *Paths) GetNames() []string
- func (f *Paths) String() string
- type PathsConfigurator
- type PathsOpts
- type PostgreSQL
- func (c *PostgreSQL) GetDSN() string
- func (c *PostgreSQL) GetDatabase() string
- func (c *PostgreSQL) GetEnabled() bool
- func (c *PostgreSQL) GetHostname() string
- func (c *PostgreSQL) GetPassword() string
- func (c *PostgreSQL) GetPort() int
- func (c *PostgreSQL) GetUsername() string
- func (c *PostgreSQL) String() string
- type Service
- func (s *Service) GetAddress() string
- func (s *Service) GetBackend() ServiceConfigurator
- func (s *Service) GetEnabled() bool
- func (s *Service) GetName() string
- func (s *Service) GetOAuth() OAuthConfigurator
- func (s *Service) GetOTP() OTPConfigurator
- func (s *Service) GetPaths() PathsConfigurator
- func (s *Service) GetTLS() TLSConfigurator
- func (s *Service) GetType() ServiceType
- func (s *Service) String() string
- type ServiceConfigurator
- type ServiceType
- type ServicesConfigurator
- type ServicesList
- type ServicesMap
- type TLS
- func (t *TLS) GetCAFile() string
- func (t *TLS) GetEnabled() bool
- func (t *TLS) GetPrivateKeyFile() string
- func (t *TLS) GetPublicCertFile() string
- func (t *TLS) GetServerNameOverride() string
- func (t *TLS) HasCAFile() bool
- func (t *TLS) HasPrivateKeyFile() bool
- func (t *TLS) HasPublicCertFile() bool
- func (t *TLS) HasServerNameOverride() bool
- func (t *TLS) IsEnabled() bool
- func (t *TLS) String() string
- type TLSConfigurator
Constants ¶
const ( ServiceTypeREST = ServiceType("rest") ServiceTypeGRPC = ServiceType("grpc") ServiceTypeMetrics = ServiceType("metrics") )
Variables ¶
var ( ExitCodeIntervalsNegative = NewExitCodeIntervalsNegative() ExitCodeIntervalsNegativeAndPositive = NewExitCodeIntervalsNegativeAndPositive() )
var ( PathsOptsNothing = &PathsOpts{} PathsOptsRebaseOnCWD = &PathsOpts{ Base: &empty, } PathsOptsRebaseOnCWDFallbackOnCWD = &PathsOpts{ Base: &empty, Fallback: &empty, } PathsOptsDefault = PathsOptsNothing )
Functions ¶
This section is empty.
Types ¶
type ClickHouse ¶
type ClickHouse struct { // Enabled specifies whether item is enabled Enabled bool `mapstructure:"enabled"` // Schema specifies schema to use Ex.: https http tcp Schema string `mapstructure:"schema"` // Username specifies ClickHouse username Username string `mapstructure:"username"` // Password specifies ClickHouse password Password string `mapstructure:"password"` // Hostname specifies ClickHouse host Hostname string `mapstructure:"hostname"` // Port specifies ClickHouse port Port int `mapstructure:"port"` // Database specifies ClickHouse database Database string `mapstructure:"database"` // DSN in the form: http://username:password@clickhouse.host:8123/database as a combination of all above DSN string `mapstructure:"dsn"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type Command ¶
type Command struct { // Enabled specifies whether this command is enabled or not Enabled bool `mapstructure:"enabled"` // Workdir specifies workdir of the command Workdir string `mapstructure:"workdir"` // Env specifies ENV vars to use for a command Env []string `mapstructure:"env"` // Command specifies CLI command to launch Command []string `mapstructure:"command"` // FailExitCodeIntervals specifies in which exit code intervals command is considered to fail. // Allows to tune the exit code treatment and not only check for zero or non-zero value FailExitCodeIntervals *ExitCodeIntervals `mapstructure:"failExitCodeIntervals"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func (*Command) ExitCodeReportsFailure ¶
ExitCodeReportsFailure checks whether provided exit code reports program failure
func (*Command) ExpandCommand ¶
ExpandCommand gets slice of strings which represents command with parameters with macros expanded
func (*Command) ExpandCommandLine ¶
ExpandCommandLine gets one string of a command with parameters with macros expanded
func (*Command) GetCommandLine ¶
GetCommandLine returns commdn as a line
type Dir ¶
type Dir struct {
Dir string `mapstructure:"dir"`
}
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type DirFile ¶
type DirFile struct { Dir string `mapstructure:"dir"` File string `mapstructure:"file"` Pattern string `mapstructure:"pattern"` }
DirFile specifies file and/or folder with pattern
type ExitCodeIntervals ¶
type ExitCodeIntervals struct { Negative bool `mapstructure:"negative"` Zero bool `mapstructure:"zero"` Positive bool `mapstructure:"positive"` }
ExitCodeIntervals specifies intervals where command's exit code lays in - negative, zero or positive. It can be used to make decisions on the interval of the exit code.
func NewExitCodeIntervalsNegative ¶
func NewExitCodeIntervalsNegative() *ExitCodeIntervals
NewExitCodeIntervalsNegative creates new negative exit code interval
func NewExitCodeIntervalsNegativeAndPositive ¶
func NewExitCodeIntervalsNegativeAndPositive() *ExitCodeIntervals
NewExitCodeIntervalsNegativeAndPositive creates new negative and positive exit code interval
func (*ExitCodeIntervals) Check ¶
func (c *ExitCodeIntervals) Check(code int) bool
Check compares code with are the intervals specified and returns true in case code is covered by intervals
type File ¶
type File struct {
File string `mapstructure:"file"`
}
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type JWT ¶
type JWT struct { Audience string `mapstructure:"audience"` Issuer string `mapstructure:"issuer"` JWKS *jwks2.JWKS `mapstructure:"jwks"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type Kafka ¶
type Kafka struct { Enabled bool `mapstructure:"enabled"` // Brokers specifies list of Kafka brokers to connect to. Used by server and client Brokers []string `mapstructure:"brokers"` // Topic specifies topic to read from or write into in Kafka. Used by server and client Topic string `mapstructure:"topic"` // GroupID specifies consumer group id. Used by client only GroupID string `mapstructure:"groupID"` // ReadNewest specifies whether to read newest messages. Used by client only ReadNewest bool `mapstructure:"readNewest"` // Ack specifies whether to ack messages. Used by client only Ack bool `mapstructure:"ack"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type Manticore ¶
type Manticore struct { Enabled bool `mapstructure:"enabled"` // Hostname specifies ClickHouse host Hostname string `mapstructure:"hostname"` // Port specifies ClickHouse port Port int `mapstructure:"port"` // DSN in the form: manticore.host:port as a combination of all above DSN string `mapstructure:"dsn"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type MinIO ¶
type MinIO struct { Enabled bool `mapstructure:"enabled"` // MinIO connection Endpoint string `mapstructure:"endpoint"` AccessKeyID string `mapstructure:"accessKeyID"` SecretAccessKey string `mapstructure:"secretAccessKey"` Secure bool `mapstructure:"secure"` InsecureSkipVerify bool `mapstructure:"insecureSkipVerify"` // MinIO internals Bucket string `mapstructure:"bucket"` BucketAutoCreate bool `mapstructure:"bucketAutoCreate"` Region string `mapstructure:"region"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func (*MinIO) GetBucketAutoCreate ¶
GetBucketAutoCreate is a getter
func (*MinIO) GetInsecureSkipVerify ¶
GetInsecureSkipVerify is a getter
func (*MinIO) GetSecretAccessKey ¶
GetSecretAccessKey is a getter
type MultiPaths ¶
MultiPaths represents map key => multiple paths
func (*MultiPaths) Get ¶
func (f *MultiPaths) Get(name string, opts ...*PathsOpts) string
Get gets the first path
func (*MultiPaths) GetAll ¶
func (f *MultiPaths) GetAll(name string, opts ...*PathsOpts) []string
GetAll is a getter
func (*MultiPaths) GetFile ¶
func (f *MultiPaths) GetFile(filename, name string, opts ...*PathsOpts) string
GetFile gets a file based on paths
func (*MultiPaths) GetNames ¶
func (f *MultiPaths) GetNames() []string
GetNames gets list of names in paths
type MySQL ¶
type MySQL struct { Enabled bool `mapstructure:"enabled"` // Username specifies MySQL username Username string `mapstructure:"username"` // Password specifies MySQL password Password string `mapstructure:"password"` // Hostname specifies MySQL host Hostname string `mapstructure:"hostname"` // Port specifies MySQL port Port int `mapstructure:"port"` // Database specifies MySQL database Database string `mapstructure:"database"` // DSN in the form: user:password@tcp(host:3306)/database as a combination of all above DSN string `mapstructure:"dsn"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type NamedCommands ¶
NamedCommands is a set named commands. Each command has string name by which it can be accessed. IMPORTANT. IMPORTANT. Do not forget to update String() function IMPORTANT.
func NewNamedCommands ¶
func NewNamedCommands() *NamedCommands
NewNamedCommands creates new named commands
func (*NamedCommands) GetCommand ¶
func (c *NamedCommands) GetCommand(name string) *Command
GetCommand returns command by its name
func (*NamedCommands) GetNames ¶
func (c *NamedCommands) GetNames() []string
GetNames gets list of names in commands
func (*NamedCommands) HasCommand ¶
func (c *NamedCommands) HasCommand(name string) bool
HasCommand checks whether there is a command with specified name
type OAuth ¶
type OAuth struct { Enabled bool `mapstructure:"enabled"` // ClientID is the application's identifier. ClientID string `mapstructure:"client-id"` // ClientSecret is the application's secret. ClientSecret string `mapstructure:"client-secret"` // TokenURL is the identity server's token endpoint URL, where to send token request. TokenURL string `mapstructure:"token-url"` // EndpointParams are additional parameters for requests to the token endpoint. // Such as: // Unique identifier for the API. This value will be used as the audience parameter on authorization calls. // audience: // - a.b.c EndpointParams url.Values `mapstructure:"endpoint-params"` RegisterURL string `mapstructure:"register-url"` InitialAccessToken string `mapstructure:"initial-access-token"` // JWT section JWT *JWT `mapstructure:"jwt"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func (*OAuth) GetClientSecret ¶
GetClientSecret is a getter
func (*OAuth) GetEndpointParams ¶
GetEndpointParams is a getter
func (*OAuth) GetInitialAccessToken ¶
GetInitialAccessToken is a getter
type OAuthConfigurator ¶
type OAuthConfigurator interface { GetEnabled() bool GetClientID() string GetClientSecret() string GetTokenURL() string GetEndpointParams() url.Values GetRegisterURL() string GetInitialAccessToken() string GetJWT() *JWT }
OAuthConfigurator
type OTP ¶
type OTP struct { Enabled bool `mapstructure:"enabled"` Server string `mapstructure:"server"` Client string `mapstructure:"client"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type OTPConfigurator ¶
OTPConfigurator - one time password (token) related section of config
type Paths ¶
Paths represents map key => one path
type PathsConfigurator ¶
type PathsConfigurator interface { GetAll(name string, opts ...*PathsOpts) []string Get(name string, opts ...*PathsOpts) string GetFile(filename, name string, opts ...*PathsOpts) string }
PathsConfigurator
type PathsOpts ¶
type PathsOpts struct { // Base specifies the base on top of which to rebase relative paths. // In case base == nil no rebase required // In case *base == "" use CWD as a base // Otherwise rebase on top of *base, in case path is a relative one Base *string // Fallback specifies path which to fall back to in case specified paths name not found // In case fallback == nil no fallback required // In case *fallback == "" use CWD as a fallback // Otherwise fallback on *fallback Fallback *string }
PathsOpts specifies paths options, such as base dir for rebase and fallback dir
type PostgreSQL ¶
type PostgreSQL struct { Enabled bool `mapstructure:"enabled"` // Username specifies PostgreSQL username Username string `mapstructure:"username"` // Password specifies PostgreSQL password Password string `mapstructure:"password"` // Hostname specifies PostgreSQL host Hostname string `mapstructure:"hostname"` // Port specifies PostgreSQL port Port int `mapstructure:"port"` // Database specifies PostgreSQL database Database string `mapstructure:"database"` // DSN in the form: postgres://user:password@host:5432/database as a combination of all above DSN string `mapstructure:"dsn"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
type Service ¶
type Service struct { Enabled bool `mapstructure:"enabled"` Name string `mapstructure:"name"` Type ServiceType `mapstructure:"type"` Address string `mapstructure:"address"` Paths *MultiPaths `mapstructure:"paths"` TLS *TLS `mapstructure:"tls"` OAuth *OAuth `mapstructure:"oauth"` OTP *OTP `mapstructure:"otp"` Backend *Service `mapstructure:"backend"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func (*Service) GetBackend ¶
func (s *Service) GetBackend() ServiceConfigurator
GetBackend is a getter
type ServiceConfigurator ¶
type ServiceConfigurator interface { GetEnabled() bool GetName() string GetType() ServiceType GetAddress() string GetPaths() PathsConfigurator GetTLS() TLSConfigurator GetOAuth() OAuthConfigurator GetOTP() OTPConfigurator GetBackend() ServiceConfigurator fmt.Stringer }
type ServiceType ¶
type ServiceType string
type ServicesConfigurator ¶
type ServicesConfigurator interface { GetList() []ServiceConfigurator Len() int Get(name string) ServiceConfigurator fmt.Stringer }
type ServicesList ¶
type ServicesList []*Service
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func NewServicesList ¶
func NewServicesList() *ServicesList
NewServicesList creates new services list
func (*ServicesList) Get ¶
func (s *ServicesList) Get(name string) ServiceConfigurator
Get gets service
func (*ServicesList) GetList ¶
func (s *ServicesList) GetList() []ServiceConfigurator
GetList return list
func (*ServicesList) Len ¶
func (s *ServicesList) Len() int
Len returns number of entries in the services list
type ServicesMap ¶
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func (*ServicesMap) Get ¶
func (s *ServicesMap) Get(name string) ServiceConfigurator
Get gets a service
func (*ServicesMap) GetList ¶
func (s *ServicesMap) GetList() []ServiceConfigurator
GetList return list
func (*ServicesMap) Len ¶
func (s *ServicesMap) Len() int
Len returns number of entries in the services list
type TLS ¶
type TLS struct { Enabled bool `mapstructure:"enabled"` ServerNameOverride string `mapstructure:"server-name-override"` CAFile string `mapstructure:"ca-file"` PrivateKeyFile string `mapstructure:"private-key-file"` PublicCertFile string `mapstructure:"public-cert-file"` }
IMPORTANT IMPORTANT Do not forget to update String() function IMPORTANT
func (*TLS) GetPrivateKeyFile ¶
GetPrivateKeyFile is a getter
func (*TLS) GetPublicCertFile ¶
GetPublicCertFile is a getter
func (*TLS) GetServerNameOverride ¶
GetServerNameOverride is a getter
func (*TLS) HasPrivateKeyFile ¶
HasPrivateKeyFile checks whether PrivateKeyFile is specified
func (*TLS) HasPublicCertFile ¶
HasPublicCertFile checks whether PublicCertFile is specified
func (*TLS) HasServerNameOverride ¶
HasServerNameOverride checks whether ServerNameOverride is specified
type TLSConfigurator ¶
type TLSConfigurator interface { IsEnabled() bool GetEnabled() bool HasServerNameOverride() bool GetServerNameOverride() string HasCAFile() bool GetCAFile() string HasPrivateKeyFile() bool GetPrivateKeyFile() string HasPublicCertFile() bool GetPublicCertFile() string }
TLSConfigurator