config

package
v0.0.0-...-36ab9e0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	Enable       bool   `mapstructure:"enable"`
	AllowOrigins string `mapstructure:"allow_origins"`
	AllowHeaders string `mapstructure:"allow_headers"`
	AllowMethods string `mapstructure:"allow_methods"`
}

type CSRF

type CSRF struct {
	Enable bool `mapstructure:"enable"`
}

type Common

type Common struct {
	Host       string `mapstructure:"host"`
	Port       int    `mapstructure:"port"`
	DeployMode string `mapstructure:"deploy_mode"`
	Swagger    string `mapstructure:"swagger"`
}

type Config

type Config struct {
	Common       Common   `mapstructure:"common"`
	DevDatabase  Database `mapstructure:"dev_database"`
	ProdDatabase Database `mapstructure:"prod_database"`
	Log          Log      `mapstructure:"log"`
	CORS         CORS     `mapstructure:"cors"`
	Limiter      Limiter  `mapstructure:"limiter"`
	CSRF         CSRF     `mapstructure:"csrf"`
}

type Database

type Database struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	Database string `mapstructure:"database"`
	SSLMode  string `mapstructure:"ssl_mode"`
}

func (*Database) Dsn

func (d *Database) Dsn() string

type Limiter

type Limiter struct {
	Enable   bool `mapstructure:"enable"`
	Max      int  `mapstructure:"limit_max"`
	Duration int  `mapstructure:"limit_duration"`
}

type Log

type Log struct {
	Type        string `mapstructure:"type"`
	Environment string `mapstructure:"environment"`
	Filename    string `mapstructure:"filename"`
	MaxSize     int    `mapstructure:"max_size"`
	MaxAge      int    `mapstructure:"max_age"`
	MaxBackups  int    `mapstructure:"max_backups"`
	LocalTime   bool   `mapstructure:"local_time"`
	Compress    bool   `mapstructure:"compress"`
	Level       string `mapstructure:"level"`
}

func (*Log) GetLogLevel

func (l *Log) GetLogLevel() zapcore.Level

Jump to

Keyboard shortcuts

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