config

package
v0.0.0-...-8e5b7c0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPrefix = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DbHostname string `envconfig:"DB_HOSTNAME" default:"localhost"`
	DbPort     string `envconfig:"DB_PORT" default:"5432"`
	DbUsername string `envconfig:"DB_USERNAME" default:"postgres"`
	DbPassword string `envconfig:"DB_PASSWORD"`
	DbDatabase string `envconfig:"DB_DATABASE" default:"pastebin"`
	DbSslMode  string `envconfig:"DB_SSLMODE" default:"disable"`
	DbDriver   string `envconfig:"DB_DRIVER" default:"postgres"`

	HttpServerListenIpAddress string `envconfig:"HTTP_SERVER_LISTEN_IP_ADDRESS" default:"0.0.0.0"`
	HttpServerListenPort      string `envconfig:"HTTP_SERVER_LISTEN_PORT" default:"8080"`

	PasswordHashSalt string `envconfig:"PASSWORD_HASH_SALT"`

	ItemsOnPage    int `envconfig:"ITEMS_ON_PAGE" default:"2"`
	MaxItemsOnPage int `envconfig:"MAX_ITEMS_ON_PAGE" default:"4"`
}

A Config is the application configuration structure.

func New

func New() *Config

New creates an application configuration.

func (*Config) Init

func (c *Config) Init() error

Init initializes application configuration.

Jump to

Keyboard shortcuts

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