config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Address  string `validate:"required" koanf:"address"`
	Password string `validate:"omitempty" koanf:"password"`
	DB       int    `validate:"gte=0" koanf:"db"`
}

type Config

type Config struct {
	Server ServerConfig `koanf:"server"`
	Cache  CacheConfig  `koanf:"cache"`
	Loader LoaderConfig `koanf:"loader"`
}

func NewConfig

func NewConfig(configFile string) (*Config, error)

type LoaderConfig

type LoaderConfig struct {
	MinioConfig     *MinioConfig `validate:"omitempty,dive" koanf:"minio_config"`
	ModuleLoader    string       `validate:"required" koanf:"module_loader"`
	ModuleDirectory string       `validate:"omitempty" koanf:"module_directory"`
}

type MinioConfig

type MinioConfig struct {
	Endpoint   string `validate:"required" koanf:"endpoint"`
	AccessKey  string `validate:"required" koanf:"access_key"`
	SecretKey  string `validate:"required" koanf:"secret_key"`
	BucketName string `validate:"required" koanf:"bucket_name"`
}

type ServerConfig

type ServerConfig struct {
	Host string `validate:"omitempty" koanf:"host" default:"localhost"`
	Port int    `validate:"omitempty" koanf:"port" default:"8080"`
}

Jump to

Keyboard shortcuts

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