config

package
v0.0.0-...-ff26636 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config stores configuration for the binhost server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ListenAddress is the address to listen on.
	ListenAddress string `env:"LISTEN_ADDRESS" envDefault:":5100"`

	// LogLevel is the log level to use.
	LogLevel string `env:"LOG_LEVEL" envDefault:"info"`

	// DBHost is the host of the database to connect to.
	DBHost string `env:"DB_HOST" envDefault:"localhost"`

	// DBPort is the port of the database to connect to.
	DBPort string `env:"DB_PORT" envDefault:"5432"`

	// DBUser is the user to connect to the database as.
	DBUser string `env:"DB_USER"`

	// DBPass is the password to connect to the database with.
	DBPass string `env:"DB_PASS"`

	// DBName is the name of the database to connect to.
	DBName string `env:"DB_NAME" envDefault:"binhost"`

	// DBSSLMode is the SSL mode to use when connecting to the database.
	DBSSLMode string `env:"DB_SSL_MODE" envDefault:"disable"`

	// S3Endpoint is the endpoint to connect to the S3 server at.
	S3Endpoint string `env:"S3_ENDPOINT" envDefault:"localhost:9000"`

	// S3AccessKey is the access key to use when connecting to the S3
	// server.
	S3AccessKey string `env:"S3_ACCESS_KEY"`

	// S3SecretKey is the secret key to use when connecting to the S3
	// server.
	S3SecretKey string `env:"S3_SECRET_KEY"`

	// S3Bucket is the bucket to store files in.
	S3Bucket string `env:"S3_BUCKET"`
}

Config contains configuration for the binhost server.

func LoadConfig

func LoadConfig(log *slog.Logger) (*Config, error)

LoadConfig loads configuration from the environment and returns a Config struct.

Jump to

Keyboard shortcuts

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