config

package
v0.0.0-...-15f6c86 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 3 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 {
	Port            string        `envconfig:"PORT" default:"3000"`
	DBPath          string        `envconfig:"DB_PATH" default:"urls.db"`
	BaseURL         string        `envconfig:"BASE_URL" default:"http://localhost:3000"`
	RateLimit       int           `envconfig:"RATE_LIMIT" default:"100"`
	RateLimitWindow time.Duration `envconfig:"RATE_LIMIT_WINDOW" default:"1m"`
	CleanupInterval time.Duration `envconfig:"CLEANUP_INTERVAL" default:"24h"`
	MaxURLAge       time.Duration `envconfig:"MAX_URL_AGE" default:"720h"` // 30 days
}

func LoadConfig

func LoadConfig() (*Config, error)

Jump to

Keyboard shortcuts

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