config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyConfig = &emptyConfig{}

Functions

This section is empty.

Types

type Config

type Config interface {

	/*
		1. filter config item which start with prefix
		2. config item would be cutted out prefix
	*/
	WithoutPrefix(prefix string) Config

	/*
		1. filter config item which start with prefix (same to WithoutPrefix)
		2. config item would be retained prefix
	*/
	WithPrefix(prefix string) Config

	/*
	   get and return config value and exists or not
	*/
	Get(string) (any, bool)

	/*
	   get and return config int value if exists, but default if not
	*/
	GetInt(string, int) int

	/*
	   get and return config int64 value if exists, but default if not
	*/
	GetInt64(string, int64) int64

	/*
	   get and return config bool value if exists, but default if not
	*/
	GetBool(string, bool) bool

	/*
	   get and return config string value if exists, but default if not
	*/
	GetString(string, string) string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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