configs

package
v0.0.0-...-dade286 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init load config file

Types

type Config

type Config struct {
	DB     DB     `json:"db" yaml:"DB"`
	Server Server `json:"server" yaml:"Server"`
}

Config .

func Instance

func Instance() *Config

Instance config object

type DB

type DB struct {
	// Driver database driven
	Driver string `json:"driver" yaml:"Driver"`
	// Source connection string
	Source string `json:"source" yaml:"Source"`
	// ShowSQL whether to display the SQL statement
	ShowSQL bool `json:"showSQL" yaml:"ShowSQL"`
	// MaxOpenConn number of database connections
	MaxOpenConn int `json:"maxOpenConn" yaml:"MaxOpenConn" `
	// MaxIdleConn maximum number of idle database connections
	MaxIdleConn int `json:"maxIdleConn" yaml:"MaxIdleConn" `
	// Cache cache size
	Cache int `json:"cache" yaml:"Cache"`
}

DB database config

type Server

type Server struct {
	// Address listen address
	Address string `json:"address" yaml:"Address"`
	// CertFile certificate verification file
	CertFile string `json:"CertFile" yaml:"CertFile"`
	// KeyFile certificate
	KeyFile string `json:"keyFile" yaml:"KeyFile"`
	// Release is it a release version
	Release bool `json:"release" yaml:"Release"`
}

Server server config

Jump to

Keyboard shortcuts

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