config

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAccessKeyEnvVar = "AWS_ACCESS_KEY_ID"
	DefaultSecretKeyEnvVar = "AWS_SECRET_ACCESS_KEY"
	DefaultRegionEnvVar    = "AWS_REGION"
)

Variables

View Source
var (
	ErrMissingAccessKey = errors.New("missing access key")
	ErrMissingSecretKey = errors.New("missing secret key")
	ErrMissingRegionKey = errors.New("missing region")
)

Functions

func AwsAccessKeyFromEnv added in v0.0.9

func AwsAccessKeyFromEnv(k string) (string, error)

func LoadAwsConfig added in v0.0.10

func LoadAwsConfig(access, secret, region string) (aws.Config, error)

func LoadFromData

func LoadFromData[C any](data []byte) (*C, error)

Loads the application config from a byte slice.

func LoadFromFile

func LoadFromFile[C any](path string) (*C, error)

Loads the application config from a file at the specified path.

func LoadFromS3

func LoadFromS3[C any](client *s3.Client, bucket, key string) (*C, error)

Loads the application config from an S3 bucket.

func RegionFromEnv added in v0.0.9

func RegionFromEnv(k string) (string, error)

func SecretKeyFromEnv added in v0.0.9

func SecretKeyFromEnv(k string) (string, error)

Types

type Config

type Config interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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