config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSession added in v0.8.0

func BuildSession(cfg Config) (*session.Session, error)

func GetEnv added in v0.10.0

func GetEnv(name string) string

func GetSecret added in v0.8.0

func GetSecret(client *secretsmanager.SecretsManager, secret string) (string, error)

func GetSecretEnv added in v0.10.0

func GetSecretEnv(client *secretsmanager.SecretsManager, secret, env string) (string, error)

Types

type AWS added in v0.8.0

type AWS struct {
	Region        string `env:"AWS_REGION" envDefault:"eu-west-2"`
	SecretsClient *secretsmanager.SecretsManager
}

type AuthCredential added in v0.8.0

type AuthCredential struct {
	Key      string
	Secret   string
	Callback string
}

type Authorization added in v0.8.0

type Authorization struct {
	JWTSecret    string
	CallbackHost string `env:"CALLBACK_HOST" envDefault:"http://localhost:3000"`
}

type Config

type Config struct {
	Local
	RDS
	DynamoDB
	Queues
	Authorization
	AWS

	AuthCredentials []ServiceCredential
	DateFormat      string
}

func BuildConfig

func BuildConfig() (Config, error)

type DynamoDB added in v0.8.0

type DynamoDB struct {
	BugsTable      string `env:"DB_BUGS_TABLE" envDefault:"bugs"`
	AccountsTable  string `env:"DB_ACCOUNTS_TABLE" envDefault:"accounts"`
	AgentsTable    string `env:"DB_AGENTS_TABLE" envDefault:"agents"`
	TicketingTable string `env:"DB_TICKETING_TABLE" envDefault:"ticketing"`
	TicketsTable   string `env:"DB_TICKETS_TABLE" envDefault:"tickets"`
	CommsTable     string `env:"DB_COMMS_TABLE" envDefault:"comms"`
	LogsTable      string `env:"DB_LOGS_TABLE" envDefault:"logs"`
}

type Local added in v0.8.0

type Local struct {
	KeepLocal   bool   `env:"LOCAL_ONLY" envDefault:"false"`
	Development bool   `env:"DEVELOPMENT" envDefault:"true"`
	AWSEndpoint string `env:"AWS_ENDPOINT" envDefault:"https://localhost.localstack.cloud:4566"`
	Port        int    `env:"LOCAL_PORT" envDefault:"3000"`
}

type Queues added in v0.8.0

type Queues struct {
	Name       string `env:"QUEUE_NAME" envDefault:"bugs"`
	DeadLetter string `env:"QUEUE_DEADLETTER_NAME" envDefault:"deadletter"`
}

type RDS added in v0.8.0

type RDS struct {
	Username string
	Password string
	Hostname string
	Port     string
	Database string
}

type Secret added in v0.10.0

type Secret struct {
	Key    string
	Secret string
}

type ServiceCredential added in v0.8.0

type ServiceCredential struct {
	Service string
	AuthCredential
}

Jump to

Keyboard shortcuts

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