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

config

package
v0.0.69 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEnv

type BaseEnv struct {
	Env       string `envconfig:"ENV" default:"local"`
	HTTPHost  string `envconfig:"HTTP_HOST" default:""`
	HTTPPort  string `envconfig:"HTTP_PORT" default:"3100"`
	LogLevel  string `envconfig:"LOG_LEVEL" default:"debug"`
	APIKey    string `envconfig:"API_KEY" required:"true"`
	PublicURL string `envconfig:"PUBLIC_URL" default:""`
}

func BaseEnvFromEnv

func BaseEnvFromEnv(env *Env) *BaseEnv

func (*BaseEnv) GetPublicURL

func (e *BaseEnv) GetPublicURL() string

GetPublicURL returns the configured public URL, or builds a default from the HTTP host and port if not explicitly set.

func (*BaseEnv) SlogLevel

func (e *BaseEnv) SlogLevel() slog.Level

type Env

type Env struct {
	BaseEnv
	StorageEnv
	VAPIDEnv
}

func LoadEnv

func LoadEnv() (*Env, error)

type StorageEnv

type StorageEnv struct {
	Type    string `envconfig:"STORAGE_TYPE" default:"local"`
	BaseDir string `envconfig:"STORAGE_BASE_DIR" default:".taskguild/data"`
	// S3 settings (used when Type == "s3")
	S3Bucket string `envconfig:"S3_BUCKET"`
	S3Prefix string `envconfig:"S3_PREFIX" default:"taskguild/"`
	S3Region string `envconfig:"S3_REGION" default:"ap-northeast-1"`
}

func StorageEnvFromEnv

func StorageEnvFromEnv(env *Env) *StorageEnv

type VAPIDEnv

type VAPIDEnv struct {
	VAPIDPrivateKey string `envconfig:"VAPID_PRIVATE_KEY"`
	VAPIDPublicKey  string `envconfig:"VAPID_PUBLIC_KEY"`
	VAPIDContact    string `envconfig:"VAPID_CONTACT" default:"mailto:admin@taskguild.dev"`
}

func VAPIDEnvFromEnv

func VAPIDEnvFromEnv(env *Env) *VAPIDEnv

Jump to

Keyboard shortcuts

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