g

package
v0.0.0-...-45e38b6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFile string
)

Functions

func GetLogWriter

func GetLogWriter(logPath string, logFileName string, maxAge time.Duration, rotationTime time.Duration) io.Writer

func InitLog

func InitLog()

func LoadConfig

func LoadConfig(cfgFile string)

加载配置文件

Types

type CommonConfig

type CommonConfig struct {
	LanguageLimit []string `toml:"languageLimit"`
}

type Config

type Config struct {
	Run     RunConfig     `toml:"run"`
	Log     LogConfig     `toml:"log"`
	Mysql   MysqlConfig   `toml:"mysql"`
	Jwt     JwtConfig     `toml:"jwt"`
	Nsq     NsqConfig     `toml:"nsq"`
	Redis   RedisConfig   `toml:"redis"`
	Minio   MinioConfig   `toml:"minio"`
	Common  CommonConfig  `toml:"common"`
	Problem ProblemConfig `toml:"problem"`
}

func Conf

func Conf() *Config

type JwtConfig

type JwtConfig struct {
	EncodeMethod     string `toml:"encodeMethod"`
	MaxEffectiveTime int64  `toml:"maxEffectiveTime"`
}

type LogConfig

type LogConfig struct {
	Enable    bool   `toml:"enable"`
	Path      string `toml:"path"`
	RotatTime int    `toml:"rotatTime"`
	MaxAge    int    `toml:"maxAge"`
}

type MinioConfig

type MinioConfig struct {
	Endpoint        string `toml:"endpoint"`
	AccessKeyID     string `toml:"accessKeyID"`
	SecretAccessKey string `toml:"secretAccessKey"`
	Secure          bool   `toml:"secure"`
	ImgBucket       string `toml:"imgBucket"`
	CodeBucket      string `toml:"codeBucket"`
	SaveCodeBucket  string `toml:"saveCodeBucket"`
	CaseBucket      string `toml:"caseBucket"`
	GetBaseUrl      string `toml:"getBaseUrl"`
}

type MysqlConfig

type MysqlConfig struct {
	MaxIdle int    `toml:"maxIdle"`
	MaxOpen int    `toml:"maxOpen"`
	Debug   bool   `toml:"debug"`
	WebAddr string `toml:"webAddr"`
}

type NsqConfig

type NsqConfig struct {
	Address []string `toml:"address"`
}

type ProblemConfig

type ProblemConfig struct {
	UserId []int64  `toml:"userId"`
	OjName []string `toml:"ojName"`
}

type RedisConfig

type RedisConfig struct {
	Address  string `toml:"address"`
	Password string `toml:"password"`
	Database int    `toml:"database"`
	PoolSize int    `toml:"poolSize"`
}

type RunConfig

type RunConfig struct {
	WaitTimeout int    `toml:"waitTimeout"`
	HTTPPort    int    `toml:"httpPort"`
	Mode        string `toml:"mode"`
	MaxAllowed  int    `toml:"maxAllowed"`
}

Jump to

Keyboard shortcuts

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