config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName        string
	Version        string
	ConfigIsLocal  bool
	ConfigPath     string
	MySQL          *database.SQLConfig
	Casbin         *database.CasbinConfig
	Memcache       *memcache.Config
	Server         *ServerConfig
	IrisLogLevel   string
	EnableGzip     bool
	EnableTemplate bool
	ReloadTemplate bool
	ViewsPath      string
	StaticDir      string
}

func GetBaseConfig

func GetBaseConfig() (cfg *Config, err error)

func Global

func Global() *Config

Global 获取全局配置

func NewConfig

func NewConfig() (cfg *Config, err error)

NewConfig 初始化全局配置并自动载入

func ParseToml

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

ParseToml 解析toml配置文件

type ServerConfig

type ServerConfig struct {
	Addr         string
	ReadTimeout  xtime.Duration
	WriteTimeout xtime.Duration
	IdleTimeout  xtime.Duration
}

Jump to

Keyboard shortcuts

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