config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path, env string, c interface{}) error

Load returns an application configuration which is populated from the given configuration file.

Types

type AWSS3Cfg

type AWSS3Cfg struct {
	Region    string `mapstructure:"region"`
	SecretKey string `mapstructure:"secret_key"`
	AccessKey string `mapstructure:"access_key"`
}

AWSS3Cfg represents AWS S3 credentials.

type Config

type Config struct {
	Credentials CredentialsCfg `mapstructure:"credentials"`
	Storage     StorageCfg     `mapstructure:"storage"`
	DB          DatabaseCfg    `mapstructure:"db"`
}

Config represents our CLI app config.

type CredentialsCfg

type CredentialsCfg struct {
	URL      string `mapstructure:"url"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

CredentialsCfg represents saferwall credentials.

type DatabaseCfg

type DatabaseCfg struct {
	// the data source name (DSN) for connecting to the database.
	Server string `mapstructure:"server"`
	// Username used to access the db.
	Username string `mapstructure:"username"`
	// Password used to access the db.
	Password string `mapstructure:"password"`
	// Name of the couchbase bucket.
	BucketName string `mapstructure:"bucket_name"`
}

DatabaseCfg represents the database config.

type LocalFsCfg

type LocalFsCfg struct {
	RootDir string `mapstructure:"root_dir"`
}

LocalFsCfg represents local file system storage data.

type MinIOCfg

type MinIOCfg struct {
	Endpoint  string `mapstructure:"endpoint"`
	Region    string `mapstructure:"region"`
	SecretKey string `mapstructure:"secret_key"`
	AccessKey string `mapstructure:"access_key"`
}

MinIOCfg represents MinIO credentials.

type StorageCfg

type StorageCfg struct {
	// Deployment kind, possible values: aws, gcp, azure, local.
	DeploymentKind  string     `mapstructure:"deployment_kind"`
	SamplesBucket   string     `mapstructure:"samples_bucket"`
	ArtifactsBucket string     `mapstructure:"artifacts_bucket"`
	S3              AWSS3Cfg   `mapstructure:"s3"`
	MinIO           MinIOCfg   `mapstructure:"minio"`
	Local           LocalFsCfg `mapstructure:"local"`
}

StorageCfg represents the object storage config.

Jump to

Keyboard shortcuts

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