agent

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent struct represnts the init continer

func New

func New(config *Config, logger hclog.Logger) (*Agent, error)

New returns new Agent with writeSecretToMountPath

func (*Agent) Retrieve

func (a *Agent) Retrieve() (err error)

Retrieve will get secrets and save them in specified location

type Config

type Config struct {
	Secrets        []*SecretMetadata `json:"secret"`
	ProviderName   string            `json:"provider_name"`
	ProviderConfig *provider.Config  `json:"provider_config"`
}

Config is the top level struct that composes am Agent configuration file.

func (*Config) Render

func (c *Config) Render() ([]byte, error)

Render is a method used for converting config to json

type MountPathWriter

type MountPathWriter struct {
	// contains filtered or unexported fields
}

MountPathWriter is a main writer

func NewMountPathWriter

func NewMountPathWriter(logger hclog.Logger) *MountPathWriter

NewMountPathWriter is a factory for MountPathWriter

func (*MountPathWriter) WriteSecret

func (w *MountPathWriter) WriteSecret(value string, metadata *SecretMetadata) error

WriteSecret is a main method for making a secret available to the other container

type SecretMetadata

type SecretMetadata struct {
	// Name of the secret used as the filename for the rendered secret file.
	Name string `json:"name"`

	// URL of the secret e.g. keyvault://name/key
	URL string `json:"url"`

	// Mount Path
	MountPath string `json:"mount_path"`
}

SecretMetadata is a metadata object sued for fetching and storing secret

type SecretsWriter

type SecretsWriter interface {
	WriteSecret(value string, metadata *SecretMetadata) error
}

SecretsWriter is an interface for writing secrets

Directories

Path Synopsis
provider
aws

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL