config

package
v0.0.0-...-39b3551 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config() *config

func GetSecret

func GetSecret(key string) string

func Load

func Load(paths ...string) error

func LoadFromAWSSecrets

func LoadFromAWSSecrets(ctx context.Context, secretName string) (map[string]string, error)

LoadFromAWSSecrets fetches secrets from AWS Secrets Manager and initializes the environment. It returns the secret map so callers can pass it to LoadWithSecrets for full configuration orchestration.

func LoadWithSecrets

func LoadWithSecrets(secrets map[string]string, paths ...string) error

LoadWithSecrets loads configuration from .env files and merges them with provided secrets. Caller-provided secrets take precedence over .env entries to allow runtime overrides (e.g. from AWS Secrets Manager).

Types

type App

type App interface {
	Name() string
	Stage() string
	IsProd() bool
	GracefulShutdownTimeout() time.Duration
}

type AuthConfig

type AuthConfig interface {
	MaxSessions() int
}

type Cleanup

type Cleanup interface {
	GetRetentionPeriod() time.Duration
	GetBatchSize() int
	IsDryRun() bool
	IsScheduleEnabled() bool
}

type Email

type Email interface {
	SenderProviderValue() string
	ResendAPIKeyValue() string
	ResendFromEmailValue() string
	PasswordResetTTLValue() time.Duration
}

type GitHub

type GitHub interface {
	GetClientID() string
	GetClientSecret() string
	GetRedirectURL() string
	GetSuccessRedirectURL() string
}

type H3

type H3 interface {
	Resolution() int
	RecommendRadius() int
}

type HttpClient

type HttpClient interface {
	BaseURL() string
	Scheme() string
	Timeout() time.Duration
	MaxIdleConns() int
	MaxIdleConnsPerHost() int
	IdleConnTimeout() time.Duration
}

type HttpServer

type HttpServer interface {
	Address() string
	AllowedOrigins() []string
	AllowedMethods() []string
	AllowedHeaders() []string
	ExposeHeaders() []string
}

type JwtToken

type JwtToken interface {
	AccessTokenSecretKey() string
	AccessTokenTTL() time.Duration

	RefreshTokenSecretKey() string
	RefreshTokenTTL() time.Duration
}

type Postgres

type Postgres interface {
	Dsn() string
	MigrationsDir() string
}

type RateLimit

type RateLimit interface {
	AuthRecoverRequests() int
	AuthRecoverDuration() time.Duration
}

type Redis

type Redis interface {
	Addr() string
	Password() string
	TLS() bool
	DB() int
}

type SQS

type SQS interface {
	Queue() string
	Region() string
	Endpoint() string
}

type Storage

type Storage interface {
	Endpoint() string
	Region() string
	AccessKey() string
	SecretKey() string
	Bucket() string
	UsePathStyle() bool
	PresignTTL() time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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