conf_center

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegisteredConfigCenter

func GetRegisteredConfigCenter() map[string]ConfigCenter

func RegisterConfigCenter

func RegisterConfigCenter(c ConfigCenter)

Types

type Client added in v0.0.20

type Client interface {
	Get() ([]byte, error)
	Set(func([]byte)) error
	Listener(func([]byte)) error
}

type Config

type Config struct {
	// 配置格式
	Format string `flag:"name:format;default:toml;usage:配置格式"`
	// 配置类型
	Type string `flag:"name:conf_type;default:local;usage:配置类型"`
	// config字段顺序不能变,ConfigCenter 保持在最后
	ConfigCenter ConfigCenter
}

type ConfigCenter

type ConfigCenter interface {
	Config() any
	io.Closer
	Handle(func([]byte)) error
	Type() string
}

func GetConfigCenter

func GetConfigCenter(configType string) ConfigCenter

type ConfigType

type ConfigType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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