config

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvAsBoolOrDefault

func GetEnvAsBoolOrDefault(key string, defaultValue bool) bool

func GetEnvAsIntOrDefault

func GetEnvAsIntOrDefault(key string, defaultValue int) int

func GetEnvOrDefault

func GetEnvOrDefault(key, defaultValue string) string

Types

type AWSConfig

type AWSConfig struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	Region          string
	Bucket          string
}

type AppConfig

type AppConfig struct {
	Name  string
	Port  int
	URL   string
	Token string
}

type Config

type Config struct {
	App      AppConfig
	Minio    MinioConfig
	AWS      AWSConfig
	Redis    RedisConfig
	Worker   WorkerConfig
	Features FeatureConfig
}

func Load

func Load() (*Config, error)

Load loads configuration from environment variables

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type FeatureConfig

type FeatureConfig struct {
	DisableDelete bool
	DisableUpload bool
	DisableGet    bool
}

type MinioConfig

type MinioConfig struct {
	Endpoint string
	User     string
	Password string
	UseSSL   bool
}

type RedisConfig

type RedisConfig struct {
	URL string
}

type WorkerConfig

type WorkerConfig struct {
	PoolSize      int
	QueueSize     int
	MaxRetries    int
	RetryDelay    time.Duration
	BatchSize     int
	FlushTimeout  time.Duration
	MaxConcurrent int
}

Jump to

Keyboard shortcuts

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