config

package
v0.0.0-...-cc65f9c Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 2 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 {
	File   string
	Log    int `yaml:"log"`
	Server struct {
		ID        int64  `yaml:"id"`
		Host      string `yaml:"host"`
		Port      int    `yaml:"port"`
		JWTSecret string `yaml:"secret"`
		Expire    int64  `yaml:"expire"`
	}
	Mysql struct {
		Host         string `yaml:"host"`
		Port         string `yaml:"port"`
		User         string `yaml:"user"`
		Password     string `yaml:"password"`
		Database     string `yaml:"database"`
		MaxIdleConns int    `yaml:"max_idle_conns"`
		MaxOpenConns int    `yaml:"max_open_conns"`
		MaxLifeTime  int64  `yaml:"max_life_time"`
		ShowSQL      bool   `yaml:"show_sql"`
		Sync         bool   `yaml:"sync"`
		UseCache     bool   `yaml:"use_cache"`
	}
	Cache  string `yaml:"cache"`
	Memory struct {
		Size int `yaml:"size"`
	}
	Redis struct {
		Host     string `yaml:"host"`
		Password string `yaml:"password"`
		Port     int    `yaml:"port"`
		DB       int    `yaml:"db"`
	}
}

Config 配置

func Load

func Load(file string) (*Config, error)

Load 加载

Jump to

Keyboard shortcuts

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