config

package
v0.15.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Providers map[string]Provider

Providers must be configured by calling ConfigureProviders with a config

Functions

func ConfigureProviders

func ConfigureProviders(ctx context.Context, config deploy.ProviderMap) error

ConfigureProviders sets the global Providers variable with the provided config. The JSON config looks as follows:

{"<ID>": {"uses": "<TYPE>", "with": {"var1": "value1", "var2": "value2", ...}}}

where <ID> is the identifier of the provider, <TYPE> is it's type, and the other key/value pairs are config variables for the provider. config is assumed to be unescaped json

func ConfigureTestProviders

func ConfigureTestProviders(providers []Provider)

ConfigureTestProviders conveniently configures the global providers for tests

func SetupProvider

func SetupProvider(ctx context.Context, p providers.Accessor, l gconfig.Loader) error

SetupProvider runs through the initialisation process for a provider.

Types

type Config

type Config struct {
	Host           string `env:"ACCESS_HANDLER_HOST,default=0.0.0.0:9092"`
	LogLevel       string `env:"LOG_LEVEL,default=info"`
	Runtime        string `env:"COMMONFATE_ACCESS_HANDLER_RUNTIME,required"`
	EventBusArn    string `env:"COMMONFATE_EVENT_BUS_ARN"`
	EventBusSource string `env:"COMMONFATE_EVENT_BUS_SOURCE"`
}

type GranterConfig

type GranterConfig struct {
	LogLevel       string `env:"LOG_LEVEL,default=info"`
	EventBusArn    string `env:"COMMONFATE_EVENT_BUS_ARN"`
	EventBusSource string `env:"COMMONFATE_EVENT_BUS_SOURCE"`
}

type Provider

type Provider struct {
	ID       string
	Type     string
	Version  string
	Provider providers.Accessor `json:"-"`
}

func (*Provider) ToAPI

func (p *Provider) ToAPI() types.Provider

type Runtime

type Runtime struct {
	Runtime string `env:"COMMONFATE_ACCESS_HANDLER_RUNTIME,required"`
}

type SSM

type SSM struct {
	Path string
}

SSM loads config from AWS SSM Parameter Store.

func (*SSM) Load

func (s *SSM) Load(ctx context.Context) (string, error)

Load JSON config from AWS SSM. Assumes that the config is stored as a SecureString.

Jump to

Keyboard shortcuts

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