config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Development = "development"
	Test        = "test"
	Production  = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig added in v0.3.0

type AuthConfig struct {
	PrivateKeyFile  string
	PublicKeyFile   string
	KeyID           string
	JWTIssuer       string
	JWTAudience     string
	CSRFSecret      string
	AccessTokenTTL  time.Duration
	RefreshTokenTTL time.Duration
}

type Config

type Config struct {
	AppName                string
	AppEnv                 string
	HTTPAddr               string
	HTTPReadTimeout        time.Duration
	HTTPWriteTimeout       time.Duration
	HTTPIdleTimeout        time.Duration
	HTTPShutdownTimeout    time.Duration
	LogLevel               string
	Database               DatabaseConfig
	MigrationsDir          string
	MigrationsRunOnStartup bool
	CORSAllowedOrigins     []string
	Auth                   AuthConfig
}

func Load

func Load() (Config, error)

func (Config) MigrationURLRequired

func (c Config) MigrationURLRequired() error

func (Config) Validate

func (c Config) Validate() error

func (Config) ValidateAuthRuntime added in v0.3.0

func (c Config) ValidateAuthRuntime() error

type DatabaseConfig

type DatabaseConfig struct {
	Enabled       bool
	URL           string
	MaxConns      int32
	MinConns      int32
	HealthTimeout time.Duration
}

Jump to

Keyboard shortcuts

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