config

package
v0.0.0-...-6dc04ce Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerAddress string        `mapstructure:"server_address"`
	Storage       StorageConfig `mapstructure:"storage"`
	SQLite        struct {
		DBPath string `mapstructure:"db_path"`
	} `mapstructure:"sqlite"`
}

Config holds configuration values for the application.

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig reads configuration from config.yaml (or other supported formats) in the current directory.

type LocalStorageConfig

type LocalStorageConfig struct {
	Directory string `mapstructure:"directory"`
}

type S3StorageConfig

type S3StorageConfig struct {
	Bucket          string `mapstructure:"bucket"`
	Region          string `mapstructure:"region"`
	AccessKeyID     string `mapstructure:"access_key_id"`
	SecretAccessKey string `mapstructure:"secret_access_key"`
}

type StorageConfig

type StorageConfig struct {
	Type  string              `mapstructure:"type"` // Allowed values: "gcs", "s3", "local"
	S3    *S3StorageConfig    `mapstructure:"s3"`
	Local *LocalStorageConfig `mapstructure:"local"`
}

StorageConfig holds settings for the storage backend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳