Documentation
¶
Overview ¶
Package config provides configuration management for GitLab backup application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
GitlabGroupID int `env:"GITLABGROUPID" env-default:"0" yaml:"gitlabGroupID"`
GitlabProjectID int `env:"GITLABPROJECTID" env-default:"0" yaml:"gitlabProjectID"`
GitlabToken string `env:"GITLAB_TOKEN" env-required:"true" yaml:"gitlabToken"`
GitlabURI string `env:"GITLAB_URI" env-default:"https://gitlab.com" yaml:"gitlabURI"`
LocalPath string `env:"LOCALPATH" env-default:"" yaml:"localpath"`
TmpDir string `env:"TMPDIR" env-default:"/tmp" yaml:"tmpdir"`
Hooks hooks.Hooks `yaml:"hooks"`
S3cfg S3Config `yaml:"s3cfg"`
NoLogTime bool `env:"NOLOGTIME" env-default:"false" yaml:"noLogTime"`
}
Config holds the application configuration.
func NewConfigFromEnv ¶
NewConfigFromEnv returns a new Config struct from the environment variables.
func NewConfigFromFile ¶
NewConfigFromFile returns a new Config struct from the given file.
func (*Config) IsConfigValid ¶
IsConfigValid returns true if the config is valid.
func (*Config) IsLocalConfigValid ¶
IsLocalConfigValid returns true if the local config is valid.
func (*Config) IsS3ConfigValid ¶
IsS3ConfigValid returns true if the S3 config is valid.
type S3Config ¶
type S3Config struct {
Endpoint string `env:"S3ENDPOINT" env-default:"" yaml:"endpoint"`
BucketName string `env:"S3BUCKETNAME" env-default:"" yaml:"bucketName"`
BucketPath string `env:"S3BUCKETPATH" env-default:"" yaml:"bucketPath"`
Region string `env:"S3REGION" env-default:"" yaml:"region"`
AccessKey string `env:"AWS_ACCESS_KEY_ID" yaml:"accessKey"`
SecretKey string `env:"AWS_SECRET_ACCESS_KEY" yaml:"secretKey"`
}
S3Config holds the configuration for S3 storage backend.
Click to show internal directories.
Click to hide internal directories.