Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthManagerConfig

type AuthManagerConfig struct {
	AccessTokenTTL  time.Duration `mapstructure:"access_token_ttl" validate:"required,gt=0"`
	RefreshTokenTTL time.Duration `mapstructure:"refresh_token_ttl" validate:"required,gt=0"`
	Algorithm       string        `mapstructure:"signing_algorithm" validate:"required,oneof=EdDSA"`
}

type Config

type Config struct {
	Server    ServerConfig      `mapstructure:"server"`
	DB        DBConfig          `mapstructure:"database"`
	Store     FileStoreConfig   `mapstructure:"filestore"`
	Auth      AuthManagerConfig `mapstructure:"auth_manager"`
	Predictor PredictorConfig   `mapstructure:"predictor"`
	Log       LogConfig         `mapstructure:"log"`
}

func NewConfig

func NewConfig() (Config, error)

type DBConfig

type DBConfig struct {
	Host     string `mapstructure:"host" validate:"required"`
	Port     string `mapstructure:"port" validate:"required"`
	User     string `mapstructure:"user" validate:"required"`
	Password string `mapstructure:"password" validate:"required"`
	Name     string `mapstructure:"name" validate:"required"`

	MigrationsPath string `mapstructure:"migrations_path" validate:"required"`
	SSLMode        string `mapstructure:"sslmode" validate:"required,oneof=disable require verify-ca verify-full"`
}

type FileStoreConfig

type FileStoreConfig struct {
	Endpoint  string `mapstructure:"endpoint" validate:"required"`
	AccessKey string `mapstructure:"access_key" validate:"required"`
	SecretKey string `mapstructure:"secret_key" validate:"required"`
	UseSSL    bool   `mapstructure:"use_ssl"`
	Bucket    string `mapstructure:"bucket" validate:"required"`
}

type LogConfig

type LogConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
	File   string `mapstructure:"file"`
}

type PredictorConfig

type PredictorConfig struct {
	Address                    string `mapstructure:"address" validate:"required"`
	Token                      string `mapstructure:"token" validate:"required"`
	MaxPredictionsInProcessing int    `mapstructure:"max_predictions_in_processing" validate:"required,gt=0"`
}

type ServerConfig

type ServerConfig struct {
	Host string `mapstructure:"host"`
	Port string `mapstructure:"port"`
}

Jump to

Keyboard shortcuts

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