conf

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustLoad

func MustLoad(path string, v interface{}, opts ...Option) error

Types

type ApiConf

type ApiConf struct {
	ServiceConf `mapstructure:",squash"`
	Addr        string `json:"Addr,default=:8080"`
	Mode        string `json:"Mode,default=release"`
	Timeout     int64  `json:"Timeout,default=60"`
}

type DbConf

type DbConf struct {
	DSN string `json:"dsn"`
}

type JwtAuth

type JwtAuth struct {
	Secret string `json:"Secret"`
}

type Option

type Option func(opt *options)

Option defines the method to customize the config options.

type RedisConf

type RedisConf struct {
	Addr     string `json:"addr,default=127.0.0.1:6379"`
	Pass     string `json:"pass,default="`
	DataBase int64  `json:"database,default=1"`
	Timeout  int64  `json:"timeout,default=60"`
}

type ServiceConf

type ServiceConf struct {
	Name       string `json:"Name"`
	Mode       string `json:"Mode,default=release"`
	MetricsUrl string `json:"MetricsUrl"`
	Prometheus string `json:"Prometheus"`
}

Jump to

Keyboard shortcuts

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