config

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const AWSSessionKey = "AWSSession"

AWSSessionKey is the key for the configuration for the AWS session

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfigurationError

type AWSConfigurationError error

AWSConfigurationError is returned when an AWS service cannot be properly configured.

type ConfigurationBuildBuilder

type ConfigurationBuildBuilder interface {
	Build() error
}

ConfigurationBuildBuilder Interface for adding the build function

type ConfigurationBuilder

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

ConfigurationBuilder is the default implementation of a configuration loader.

func (*ConfigurationBuilder) Build

func (config *ConfigurationBuilder) Build() error

Build builds the configuration.

func (*ConfigurationBuilder) Dump

func (config *ConfigurationBuilder) Dump(cfgStruct interface{}) error

Dump dumps the current config into the provided structure. Config keys are matched to cfgStruct fields using the "env" tag.

func (*ConfigurationBuilder) GetService

func (config *ConfigurationBuilder) GetService(svcFor interface{}) error

GetService retreives the service with the given type. An error is thrown if the service is not found.

func (*ConfigurationBuilder) GetStringVal

func (config *ConfigurationBuilder) GetStringVal(key string) (string, error)

GetStringVal returns the value of the key as a string.

func (*ConfigurationBuilder) GetVal

func (config *ConfigurationBuilder) GetVal(key string) (interface{}, error)

GetVal returns the raw value

func (*ConfigurationBuilder) RetrieveParameterStoreVals

func (config *ConfigurationBuilder) RetrieveParameterStoreVals() error

RetrieveParameterStoreVals - Get the values from the AWS Parameter Store

func (*ConfigurationBuilder) Unmarshal

func (config *ConfigurationBuilder) Unmarshal(cfgStruct interface{}) error

Unmarshal loads configuration into the provided structure from environment variables. Use the "env" tag on cfgStruct fields to indicate the corresponding environment variable to load from.

func (*ConfigurationBuilder) WithEnv

func (config *ConfigurationBuilder) WithEnv(key string, envVar string, defaultValue interface{}) *ConfigurationBuilder

WithEnv allows you to point to an environment variable for the value and also specify a default using defaultValue

func (*ConfigurationBuilder) WithParameterStoreEnv

func (config *ConfigurationBuilder) WithParameterStoreEnv(key string, envVar string, defaultValue string) *ConfigurationBuilder

WithParameterStoreEnv sets a config value from SSM Parameter store. The Parameter name is taken from the provided environment variable. If the environment variable or SSM parameter can't be retrieved, then the default value is used. Requires that an SSM service of type ssmiface.SSMAPI is contained within config

func (*ConfigurationBuilder) WithService

func (config *ConfigurationBuilder) WithService(svc interface{}) *ConfigurationBuilder

WithService is a Builder Pattern method that allows you to specify services for the given type.

func (*ConfigurationBuilder) WithVal

func (config *ConfigurationBuilder) WithVal(key string, val interface{}) *ConfigurationBuilder

WithVal allows you to hardcode string values into the configuration. This is good for testing, injecting known values or values derived by means outside the configuration.

type ConfigurationError

type ConfigurationError error

ConfigurationError is an error that is returned by configuration methods when keys cannot be found or when there is an error whilst building the configuration.

type ConfigurationServiceBuilder

type ConfigurationServiceBuilder interface {
	ConfigurationBuildBuilder
	WithService(svc interface{}) *ConfigurationBuilder
}

ConfigurationServiceBuilder Interface for adding services to the config

type ParameterStoreVal

type ParameterStoreVal struct {
	Key           string
	ParameterName string
	DefaultValue  string
}

ParameterStoreVal stores the parameters for a SSM Value

type ServiceBuilder

type ServiceBuilder struct {
	Config *ConfigurationBuilder
	// contains filtered or unexported fields
}

ServiceBuilder is the default implementation of the `ServiceBuild`

func (*ServiceBuilder) AccountManager

func (bldr *ServiceBuilder) AccountManager() accountmanageriface.Servicer

func (*ServiceBuilder) AccountService

func (bldr *ServiceBuilder) AccountService() accountiface.Servicer

AccountService returns the account Service for you

func (*ServiceBuilder) Build

func (bldr *ServiceBuilder) Build() (*ConfigurationBuilder, error)

Build creates and returns a structue with AWS services

func (*ServiceBuilder) LeaseService

func (bldr *ServiceBuilder) LeaseService() leaseiface.Servicer

LeaseService returns the lease Service for you

func (*ServiceBuilder) UserDetailer

func (bldr *ServiceBuilder) UserDetailer() api.UserDetailer

func (*ServiceBuilder) WithAccountDataService

func (bldr *ServiceBuilder) WithAccountDataService() *ServiceBuilder

WithAccountDataService tells the builder to add the Data service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithAccountManagerService

func (bldr *ServiceBuilder) WithAccountManagerService() *ServiceBuilder

WithAccountManagerService tells the builder to add the Data service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithAccountService

func (bldr *ServiceBuilder) WithAccountService() *ServiceBuilder

WithAccountService tells the builder to add the Account service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithCloudWatchEventsService

func (bldr *ServiceBuilder) WithCloudWatchEventsService() *ServiceBuilder

WithCloudWatchEventsService tells the builder to add an AWS Cognito service to the `DefaultConfigurater`

func (*ServiceBuilder) WithCloudWatchService

func (bldr *ServiceBuilder) WithCloudWatchService() *ServiceBuilder

WithCloudWatchService tells the builder to add an AWS Cognito service to the `DefaultConfigurater`

func (*ServiceBuilder) WithCodeBuild

func (bldr *ServiceBuilder) WithCodeBuild() *ServiceBuilder

WithCodeBuild tells the builder to add an AWS CodeBuild service to the `DefaultConfigurater`

func (*ServiceBuilder) WithCognito

func (bldr *ServiceBuilder) WithCognito() *ServiceBuilder

WithCognito tells the builder to add an AWS Cognito service to the `DefaultConfigurater`

func (*ServiceBuilder) WithDynamoDB

func (bldr *ServiceBuilder) WithDynamoDB() *ServiceBuilder

WithDynamoDB tells the builder to add an AWS DynamoDB service to the `DefaultConfigurater`

func (*ServiceBuilder) WithEventService

func (bldr *ServiceBuilder) WithEventService() *ServiceBuilder

WithEventService tells the builder to add the Account service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithLambda

func (bldr *ServiceBuilder) WithLambda() *ServiceBuilder

WithLambda tells the builder to add an AWS Lambda service to the `DefaultConfigurater`

func (*ServiceBuilder) WithLeaseDataService

func (bldr *ServiceBuilder) WithLeaseDataService() *ServiceBuilder

WithLeaseDataService tells the builder to add the Data service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithLeaseService

func (bldr *ServiceBuilder) WithLeaseService() *ServiceBuilder

WithLeaseService tells the builder to add the Account service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithS3

func (bldr *ServiceBuilder) WithS3() *ServiceBuilder

WithS3 tells the builder to add an AWS S3 service to the `DefaultConfigurater`

func (*ServiceBuilder) WithSNS

func (bldr *ServiceBuilder) WithSNS() *ServiceBuilder

WithSNS tells the builder to add an AWS SNS service to the `DefaultConfigurater`

func (*ServiceBuilder) WithSQS

func (bldr *ServiceBuilder) WithSQS() *ServiceBuilder

WithSQS tells the builder to add an AWS SQS service to the `DefaultConfigurater`

func (*ServiceBuilder) WithSSM

func (bldr *ServiceBuilder) WithSSM() *ServiceBuilder

WithSSM tells the builder to add an AWS SSM service to the `DefaultConfigurater`

func (*ServiceBuilder) WithSTS

func (bldr *ServiceBuilder) WithSTS() *ServiceBuilder

WithSTS tells the builder to add an AWS STS service to the `DefaultConfigurater`

func (*ServiceBuilder) WithStorageService

func (bldr *ServiceBuilder) WithStorageService() *ServiceBuilder

WithStorageService tells the builder to add the DCE DAO (DBer) service to the `ConfigurationBuilder`

func (*ServiceBuilder) WithUserDetailer

func (bldr *ServiceBuilder) WithUserDetailer() *ServiceBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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