runtime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDBPool

func OpenDBPool(url string, maxOpenConns int) (*sql.DB, error)

Types

type Config

type Config struct {
	Address string `help:"the address to bind our web server to"`
	Port    int    `help:"the port to bind our web server to"`
	Domain  string `help:"the domain that the server is listening on"`
	SSL     bool   `help:"whether server is using SSL"`

	DB         string `validate:"url,startswith=postgres:"           help:"URL for your Postgres database"`
	Valkey     string `validate:"url,startswith=valkey:"             help:"URL for your Valkey instance"`
	StorageURL string `validate:"url"                                help:"URL base for public storage, e.g. avatars"`
	SentryDSN  string `                                              help:"the DSN used for logging errors to Sentry"`

	AWSAccessKeyID     string `help:"access key ID to use for AWS services"`
	AWSSecretAccessKey string `help:"secret access key to use for AWS services"`
	AWSRegion          string `help:"region to use for AWS services, e.g. us-east-1"`

	CloudwatchNamespace string `help:"the namespace to use for cloudwatch metrics"`
	DeploymentID        string `help:"the deployment identifier to use for metrics"`

	InstanceID string     `help:"the unique identifier of this instance, defaults to hostname"`
	LogLevel   slog.Level `help:"the logging level to use"`
	Version    string     `help:"the version of this install"`
}

func LoadConfig

func LoadConfig() *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the config

type Runtime

type Runtime struct {
	DB     *sql.DB
	RP     *redis.Pool
	Config *Config
}

Jump to

Keyboard shortcuts

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