config

package
v0.0.0-...-9067f3d Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config defines the configuration structs used by the application. The values of these structs are retrieved from environment variables. The config package provides a simple and consistent way to access and manage the configuration of the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

Config is the container struct for all configuration values.

func New

func New() Config

New returns a configuration struct with default values and environment variables overriding the defaults.

type Cors

type Cors struct {
	AllowOrigin      string
	AllowMethods     string
	AllowHeaders     string
	AllowCredentials string
}

Cors contains configuration values for the CORS middleware.

type PostgreSQL

type PostgreSQL struct {
	Dbname   string
	User     string
	Password string
	Host     string
	Port     int
	Sslmode  string
	AppName  string
}

PostgreSQL contains configuration values for the PostgreSQL database.

type Redis

type Redis struct {
	Addr     string
	Username string
	Password string
	DB       int
}

Redis contains configuration values for the Redis cache.

type RequestTimeout

type RequestTimeout int

RequestTimeout contains configuration value for http request timeout.

type ServerConfig

type ServerConfig struct {
	Port string
}

ServerConfig contains configuration values for the server listening port.

type Session

type Session struct {
	Name     string
	Domain   string
	Path     string
	Secure   bool
	HTTPOnly bool
	SameSite string
	MaxAge   int
}

Session contains configuration values for the session.

Jump to

Keyboard shortcuts

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