Documentation
¶
Index ¶
- type Config
- type ConfigMap
- type Context
- type FileToRender
- type RenderTarget
- type Repository
- func (c *Repository) AddConfig(Config *Config) error
- func (c *Repository) AddContext(context *Context) error
- func (c *Repository) AddRenderTarget(target *RenderTarget) error
- func (c *Repository) AddSecret(secret *Secret) error
- func (c *Repository) DecodeSecrets() (SecretsMap, error)
- func (c *Repository) GetConfigMap() ConfigMap
- func (c *Repository) GetConfigVersion() int
- func (c *Repository) GetConfigWriter() writer.ConfigWriter
- func (c *Repository) GetConfigsByContext(contextName string) (res []*Config)
- func (c *Repository) GetContext(contextName string) *Context
- func (c *Repository) GetContexts() []*Context
- func (c *Repository) GetCurrent() *Context
- func (c *Repository) GetCurrentConfig(ConfigName string) *Config
- func (c *Repository) GetCurrentConfigs() (res []*Config)
- func (c *Repository) GetCurrentSecret(secretName string) *Secret
- func (c *Repository) GetCurrentSecrets() (res []*Secret)
- func (c *Repository) GetDefault() *Context
- func (c *Repository) GetRenderTarget(targetName string) *RenderTarget
- func (c *Repository) GetSecretsByContext(contextName string) (res []*Secret)
- func (c *Repository) HasRenderTarget(targetName string) bool
- func (c *Repository) IsDefault() bool
- func (c *Repository) RenderTargetNames() (names []string)
- func (c *Repository) SetSelectedContext(contextName string) (*Context, error)
- type Secret
- type SecretsMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Name string SecretResolver encryption.SecretResolver Encryption encryption.Engine EncryptedSecrets map[string]string Configs map[string]string }
func (*Context) DecodeValue ¶
DecodeValue takes the value and decodes it encodeValue must be base64
type FileToRender ¶
type RenderTarget ¶
type RenderTarget struct { Name string FilesToRender []*FileToRender }
func NewRenderTarget ¶
func NewRenderTarget(name string) *RenderTarget
func (*RenderTarget) AddFileToRender ¶
func (c *RenderTarget) AddFileToRender(fileIn string, fileOut string) error
AddFileToRender adds a file to render which is later used by the rendering engine
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(configVersion int, configFileUsed string, configWriter writer.ConfigWriter) *Repository
NewRepository creates a new generic repository
func (*Repository) AddConfig ¶
func (c *Repository) AddConfig(Config *Config) error
AddConfig adds a Config to the repository also does some validations
func (*Repository) AddContext ¶
func (c *Repository) AddContext(context *Context) error
AddContext adds a context and does some validations
func (*Repository) AddRenderTarget ¶
func (c *Repository) AddRenderTarget(target *RenderTarget) error
func (*Repository) AddSecret ¶
func (c *Repository) AddSecret(secret *Secret) error
AddSecret adds a secret to the repository also does some validations
func (*Repository) DecodeSecrets ¶
func (c *Repository) DecodeSecrets() (SecretsMap, error)
DecodeSecrets decodes the secrets of the current context and puts them into a map[string]string
func (*Repository) GetConfigMap ¶
func (c *Repository) GetConfigMap() ConfigMap
func (*Repository) GetConfigVersion ¶
func (c *Repository) GetConfigVersion() int
GetConfigVersion returns the config version this repository is built from
func (*Repository) GetConfigWriter ¶
func (c *Repository) GetConfigWriter() writer.ConfigWriter
GetConfigWriter returns the current config writer
func (*Repository) GetConfigsByContext ¶
func (c *Repository) GetConfigsByContext(contextName string) (res []*Config)
GetConfigsByContext returns all the Configs related to the current context
func (*Repository) GetContext ¶
func (c *Repository) GetContext(contextName string) *Context
GetContext returns the context by name
func (*Repository) GetContexts ¶
func (c *Repository) GetContexts() []*Context
func (*Repository) GetCurrent ¶
func (c *Repository) GetCurrent() *Context
GetCurrent returns the current context
func (*Repository) GetCurrentConfig ¶
func (c *Repository) GetCurrentConfig(ConfigName string) *Config
GetCurrentConfig takes the merged Configs from GetCurrentConfigs and returns the needed one
func (*Repository) GetCurrentConfigs ¶
func (c *Repository) GetCurrentConfigs() (res []*Config)
GetCurrentConfigs merges the default Configs with the context Configs the default Configs are overwritten by the context Configs
func (*Repository) GetCurrentSecret ¶
func (c *Repository) GetCurrentSecret(secretName string) *Secret
GetCurrentSecret takes the merged secrets from GetCurrentSecrets and returns the needed one
func (*Repository) GetCurrentSecrets ¶
func (c *Repository) GetCurrentSecrets() (res []*Secret)
GetCurrentSecrets merges the default secrets with the context secrets the default secrets are overwritten by the context secrets
func (*Repository) GetDefault ¶
func (c *Repository) GetDefault() *Context
GetDefault returns the default context
func (*Repository) GetRenderTarget ¶
func (c *Repository) GetRenderTarget(targetName string) *RenderTarget
func (*Repository) GetSecretsByContext ¶
func (c *Repository) GetSecretsByContext(contextName string) (res []*Secret)
GetSecretsByContext returns all the secrets related to the current context
func (*Repository) HasRenderTarget ¶
func (c *Repository) HasRenderTarget(targetName string) bool
func (*Repository) IsDefault ¶
func (c *Repository) IsDefault() bool
IsDefault returns if the default context is used
func (*Repository) RenderTargetNames ¶
func (c *Repository) RenderTargetNames() (names []string)
func (*Repository) SetSelectedContext ¶
func (c *Repository) SetSelectedContext(contextName string) (*Context, error)
SetSelectedContext sets the current selected context