config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

基于viper包

Index

Constants

This section is empty.

Variables

View Source
var ConfigTemplate = `[version]
version = "v0.0.3"

[server]
addr = "localhost:9090"`

Functions

func New

func New(projectName string)

新建config

func NotExist

func NotExist() bool

配置文件不存在时返回ture,否则返回false

Types

type Config added in v0.1.0

type Config struct {
	viper.Viper
}

func (*Config) Init added in v0.1.0

func (cfg *Config) Init()

config初始化

Jump to

Keyboard shortcuts

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