config

package
v0.0.0-...-31b4c3b Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config for configuration of server side application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	JWT
	DB
	HTTP
	Encryption
	Log
}

Config type for configuration.

func New

func New() (*Config, error)

New - creates new config and fiiles it based on defaults, env and flags.

type DB

type DB struct {
	Path string `` /* 135-byte string literal not displayed */
}

DB - struct for db config.

type Encryption

type Encryption struct {
	MasterKeyHex   string        `default:"AAAAAAAAAABBBBBBBBBBCCCCCCCCCCAAAAAAAAAABBBBBBBBBBCCCCCCCCCCAAAA" flg:"encr_key" env:"ENCR_KEY"`
	RotateDuration time.Duration `default:"10m"`
	KeySize        int           `default:"32"`
}

Encryption - struct for encryption settings.

type HTTP

type HTTP struct {
	Address string `default:"localhost:8080" flg:"http" flgU:"Endpoint HTTP-server address" env:"HTTP_ADDRESS"`
}

HTTP - struct for HTTP settings.

type JWT

type JWT struct {
	Secret       string `default:"super complex secret nobody can read it" flg:"jwtsecret" flgU:"jwt secret" env:"JWT_SECRET"`
	ExpiresHours int    `default:"24"`
}

JWT struct for JWT settings.

type Log

type Log struct {
	Level string `default:"debug" flg:"log" flgU:"Log level" env:"LOG_LEVEL"`
}

Log - logger configuration.

Jump to

Keyboard shortcuts

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