config

package
v0.0.0-...-1ad4281 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadConfig = errors.New("Config Validation Error: Check klog out for more info")

ErrBadConfig invalid config

Functions

This section is empty.

Types

type Config

type Config struct {
	Argon2Cost argon2id.Cost
	Cloudflare struct {
		Enabled bool
	}
	Cookie struct {
		PreFix string
	}
	Db struct {
		Net      string
		Server   string
		Name     string
		UserName string
		Password string
	}
	Dev      bool
	HCaptcha struct {
		Enabled  bool
		Secret   string
		Easy     string
		Moderate string
		Hard     string
		All      string
	}
	Logs struct {
		Level int8
		Dir   bool
		Path  string
	}
	Mail email.Config
	Path struct {
		PublicDir string
		MediaDir  string
		TmpDir    string
		Public    struct {
			VerifyEmail   string
			ResetPassword string
			Media         string
		}
	}
	Redis struct {
		Host     string
		User     string
		Password string
	}
	Session struct {
		MaxLife    int64
		Expiration int64
		Duration   struct {
			MaxLife    time.Duration
			Expiration time.Duration
		}
	}
	Site struct {
		Description string
		Domain      string
		Name        string
		Port        int64
		Prefork     bool
		BodyLimit   int64
		Static      bool
	}
	Ssl struct {
		Enabled bool
		Cert    string
		Key     string
		Port    int64
	}
}

Config configuration struct

func NewConfig

func NewConfig(path string) *Config

NewConfig initialize and return Config

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig initializes Config

func (*Config) Validate

func (c *Config) Validate() error

Validate Config & fills defaults if empty

Jump to

Keyboard shortcuts

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