Documentation
¶
Overview ¶
Package config provides support for Aptomi configuration - Server config, Client config, and their common sections (API config)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Schema string `validate:"required"`
Host string `validate:"required,hostname|ip"`
Port int `validate:"required,min=1,max=65535"`
APIPrefix string `validate:"required"`
}
API represents configs for the API used in both client and server
func (API) ListenAddr ¶
ListenAddr returns address server listens on
type Auth ¶
type Auth struct {
Username string `validate:"required"`
}
Auth represents client auth configs
type Base ¶
type Base interface {
IsDebug() bool
}
Base is the interface for all configs used in Aptomi (e.g. client config, server config)
type Client ¶
type Client struct {
Debug bool `validate:"-"`
Output string `validate:"required"`
API API `validate:"required"`
Auth Auth `validate:"required"`
HTTP HTTP `validate:"required"`
}
Client is the aptomictl config representation
type Enforcer ¶
type Enforcer struct {
Disabled bool `validate:"-"`
Noop bool `validate:"-"`
NoopSleep int `validate:"-"`
}
Enforcer represents configs for Enforcer background process that periodically gets latest policy, calculating difference between it and actual state and then applying calculated actions.
type LDAP ¶
type LDAP struct {
Host string `validate:"required,hostname|ip"`
Port int `validate:"required,min=1,max=65535"`
BaseDN string `validate:"required"`
// Filter is LDAP filter query for all users
Filter string `validate:"required"`
// FilterByName is LDAP filter query when doing user lookup by name
FilterByName string `validate:"required"`
LabelToAttributes map[string]string `validate:"required"`
}
LDAP contains configuration for LDAP sync service (host, port, DN, filter query and mapping of LDAP properties to Aptomi attributes)
func (*LDAP) GetAttributes ¶
GetAttributes Returns the list of attributes to be retrieved from LDAP
type Server ¶
type Server struct {
Debug bool `validate:"-"`
API API `validate:"required"`
UI UI `validate:"omitempty"` // if UI is not defined, then UI will not be started
DB DB `validate:"required"`
Helm Helm `validate:"required"`
Users UserSources `validate:"required"`
SecretsDir string `validate:"omitempty,dir"` // secrets is not a first-class citizen yet, so it's not required
Enforcer Enforcer `validate:"required"`
DomainAdminOverrides map[string]bool `validate:"-"`
}
Server represents configs for the server
type UI ¶
type UI struct {
Schema string `validate:"required"`
Host string `validate:"required,hostname|ip"`
Port int `validate:"required,min=1,max=65535"`
}
UI represents configs for the UI used in both client and server
type UserSources ¶
UserSources represents configs for the user loaders that could be file and LDAP loaders
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is a custom validator for configs