config

package
v0.0.0-...-db3cac9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash struct {
	Salt string `toml:"salt"`
}

Hash is hash setting

type JWT

type JWT struct {
	Mode       jwts.JWTAlgo `toml:"mode" validate:"oneof=hmac rsa"`
	Audience   string       `toml:"audience" validate:"required"`
	Secret     string       `toml:"secret_code"`
	PrivateKey string       `toml:"private_key"`
	PublicKey  string       `toml:"public_key"`
}

JWT is JWT setting

type Logger

type Logger struct {
	Service      string `toml:"service" validate:"required"`
	Level        int    `toml:"level"` // 0 is possible value
	IsStackTrace bool   `toml:"is_stacktrace"`
	FileName     string `toml:"file_name"`
}

Logger is zerolog setting

type MySQL

type MySQL struct {
	Encrypted bool   `toml:"encrypted"`
	Host      string `toml:"host"`
	Port      uint16 `toml:"port"`
	DBName    string `toml:"dbname"`
	User      string `toml:"user"`
	Pass      string `toml:"pass"`
	Debug     bool   `toml:"debug"`
}

MySQL is MySQL Server setting

type Root

type Root struct {
	Logger *Logger `toml:"logger" validate:"required"`
	Jwt    *JWT    `toml:"jwt" validate:"required"`
	Hash   *Hash   `toml:"hash" validate:"required"`
	MySQL  *MySQL  `toml:"mysql" validate:"required"`
}

Root is config root

func NewConfig

func NewConfig(fileName string, isEncrypted bool) (*Root, error)

NewConfig returns *Root config

Jump to

Keyboard shortcuts

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