config

package
v0.0.0-...-9d2f815 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Types

type App

type App struct {
	Version   string `yaml:"version"`
	Name      string `yaml:"name"`
	Desc      string `yaml:"desc"`
	Keywords  string `yaml:"keywords"`
	VisitMode string `yaml:"visitMode"`
}

type Config

type Config struct {
	App     *App     `yaml:"app"`
	System  *System  `yaml:"system"`
	Mysql   *Mysql   `yaml:"db"`
	Session *Session `yaml:"session"`
	Upload  *Upload  `yaml:"upload"`
	Redis   *Redis   `yaml:"redis"`
	Logger  *Logger  `yaml:"logger"`
}

func GetInstance

func GetInstance() *Config

type Logger

type Logger struct {
	Path       string `yaml:"path"`
	Level      int    `yaml:"level"`
	MaxSize    int    `yaml:"maxSize"`
	MaxBackups int    `yaml:"maxBackups"`
	MaxAge     int    `yaml:"maxAge"`
	Compress   bool   `yaml:"compress"`
}

type Mysql

type Mysql struct {
	Host  string `yaml:"host"`
	Port  string `yaml:"port"`
	Name  string `yaml:"name"`
	Pass  string `yaml:"pass"`
	DB    string `yaml:"db"`
	Debug bool   `yaml:"debug"`
}

type Redis

type Redis struct {
	Host        string `yaml:"host"`
	Port        string `yaml:"port"`
	Pass        string `yaml:"pass"`
	DB          string `yaml:"db"`
	IdleTimeout string `yaml:"idleTimeout"`
}

type Session

type Session struct {
	Name   string `yaml:"name"`
	Secret string `yaml:"secret"`
}

type System

type System struct {
	Env              string `yaml:"env"`
	Addr             string `yaml:"addr"`
	ShutdownWaitTime int    `yaml:"shutdownWaitTime"`
}

type Upload

type Upload struct {
	Path     string   `yaml:"path"`
	Ext      []string `yaml:"ext"`
	Filesize int64    `yaml:"filesize"`
}

Jump to

Keyboard shortcuts

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