config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name string `mapstructure:"name" json:"name"  yaml:"name"`
	Env  string `mapstructure:"env" json:"env" yaml:"env"`
	Port string `mapstructure:"port" json:"port" yaml:"port"`
}

type Config

type Config struct {
	App          App                    `mapstructure:"app" json:"app" yaml:"app"`
	Log          Log                    `mapstructure:"log" json:"log" yaml:"log"`
	Database     Database               `mapstructure:"database" json:"database" yaml:"database"`
	DatabaseMap  map[string]Database    `mapstructure:"dbs" json:"dbs" yaml:"dbs"`
	Redis        Redis                  `mapstructure:"redis" json:"redis" yaml:"redis"`
	CustomConfig map[string]interface{} `mapstructure:"custom" json:"custom" yaml:"custom"`
}

type Database

type Database struct {
	DatabaseType        string `mapstructure:"database_type"  json:"database_type,omitempty" yaml:"database_type"`
	Ip                  string `mapstructure:"ip" json:"ip,omitempty" yaml:"ip"`
	Port                int    `mapstructure:"port" json:"port,omitempty" yaml:"port"`
	DatabaseName        string `mapstructure:"database_name" json:"database_name,omitempty" yaml:"database_name"`
	UserName            string `mapstructure:"username" json:"username,omitempty" yaml:"username"`
	Password            string `mapstructure:"password" json:"password,omitempty" yaml:"password"`
	Charset             string `mapstructure:"charset" json:"charset,omitempty" yaml:"charset"`
	MaxIdleConns        int    `mapstructure:"max_idle_conns" json:"max_idle_conns,omitempty" yaml:"max_idle_conns"`
	MaxOpenConns        int    `mapstructure:"max_open_conns" json:"max_open_conns,omitempty" yaml:"max_open_conns"`
	LogMode             string `mapstructure:"log_mode" json:"log_mode,omitempty" yaml:"log_mode"`
	EnableFileLogWriter bool   `mapstructure:"enable_file_log_writer" json:"enable_file_log_writer,omitempty" yaml:"enable_file_log_writer"`
	LogFileName         string `mapstructure:"log_filename" json:"log_filename,omitempty" yaml:"log_filename"`
}

func (Database) IsEmpty

func (database Database) IsEmpty() bool

type Log

type Log struct {
	Level      string `mapstructure:"level" json:"level,omitempty" yaml:"level"`
	RootDir    string `mapstructure:"root_dir" json:"rootDir,omitempty" yaml:"rootDir"`
	FileName   string `mapstructure:"fileName" json:"fileName,omitempty" yaml:"fileName"`
	Format     string `mapstructure:"format" json:"format,omitempty" yaml:"format"`
	ShowLine   bool   `mapstructure:"showLine" json:"showLine,omitempty" yaml:"showLine"`
	MaxBackups int    `mapstructure:"maxBackups" json:"maxBackups,omitempty" yaml:"maxBackups"`
	MaxSize    int    `mapstructure:"maxSize" json:"maxSize,omitempty" yaml:"maxSize"`
	MaxAge     int    `mapstructure:"maxAge" json:"maxAge,omitempty" yaml:"maxAge"`
	Compress   bool   `mapstructure:"compress" json:"compress,omitempty" yaml:"compress"`
}

type Redis

type Redis struct {
	Ip       string `json:"ip,omitempty" mapstructure:"ip" yaml:"ip"`
	Port     string `json:"port,omitempty" mapstructure:"port" yaml:"port"`
	Password string `json:"password,omitempty" mapstructure:"password" yaml:"password"`
	DbName   int    `json:"dbName" mapstructure:"db-name" yaml:"db-name"`
	PoolSize int    `json:"pool-size,omitempty" mapstructure:"pool-size" yaml:"pool-size"`
}

func (Redis) IsEmpty

func (redis Redis) IsEmpty() bool

Jump to

Keyboard shortcuts

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