config

package
v0.0.0-...-c1e5b24 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(pattern string, def ...interface{}) value.Value

Get 获取配置值

func GetConfigurator

func GetConfigurator() configurator.Configurator

GetConfigurator 获取配置器

func Has

func Has(pattern string) bool

Has 检测多个匹配规则中是否存在配置

func Load

func Load(ctx context.Context, source string, file ...string) ([]*configurator.Configuration, error)

Load 加载配置项

func Match

func Match(patterns ...string) configurator.Matcher

Match 匹配多个规则

func NewConfigurator

func NewConfigurator(sources ...configurator.Source) configurator.Configurator

NewConfigurator 新建配置器

func Set

func Set(pattern string, value interface{}) error

Set 设置配置值

func SetConfigurator

func SetConfigurator(configurator configurator.Configurator)

SetConfigurator 设置配置器

func SetDefaultConfigurator

func SetDefaultConfigurator()

func SetSource

func SetSource(sources ...configurator.Source)

SetSource 通过设置配置源来设置配置器

func Store

func Store(ctx context.Context, source string, file string, content interface{}, override ...bool) error

Store 保存配置项

func Watch

func Watch(cb configurator.WatchCallbackFunc, names ...string)

Watch 设置监听回调

Types

This section is empty.

Directories

Path Synopsis
consul module

Jump to

Keyboard shortcuts

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