config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: GPL-3.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 CORSConfig

type CORSConfig struct {
	AllowedOrigins []string
}

CORSConfig holds CORS configuration

type Config

type Config struct {
	Server    ServerConfig
	Database  DatabaseConfig
	JWT       JWTConfig
	Storage   StorageConfig
	RateLimit int
	CORS      CORSConfig
	Log       LogConfig
}

Config holds all application configuration

func Load

func Load() (*Config, error)

Load loads configuration from environment variables

func (*Config) IsDevelopment

func (c *Config) IsDevelopment() bool

IsDevelopment returns true if running in development mode

func (*Config) IsProduction

func (c *Config) IsProduction() bool

IsProduction returns true if running in production mode

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type DatabaseConfig

type DatabaseConfig struct {
	URL string
}

DatabaseConfig holds database connection configuration

type JWTConfig

type JWTConfig struct {
	Secret        string
	AccessExpiry  time.Duration
	RefreshExpiry time.Duration
}

JWTConfig holds JWT token configuration

type LogConfig

type LogConfig struct {
	Level  string
	Format string
}

LogConfig holds logging configuration

type ServerConfig

type ServerConfig struct {
	Port string
	Env  string
}

ServerConfig holds server-specific configuration

type StorageConfig

type StorageConfig struct {
	Endpoint     string
	Region       string
	Bucket       string
	AccessKey    string
	SecretKey    string
	UsePathStyle bool
	Insecure     bool
}

StorageConfig holds S3-compatible storage configuration

Jump to

Keyboard shortcuts

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