config

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 8 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 GetSecret added in v0.8.0

func GetSecret(client *secretsmanager.SecretsManager, secret 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 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