configcenter

package
v0.0.0-...-89d789c Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigCenterTypeFile = "file"
	ConfigCenterTypeEtcd = "etcd"
)
View Source
const (
	DefaultEtcdDialTimeout = 3 * time.Second
)

Variables

View Source
var (
	ErrNamespaceNotFound = errors.New("namespace not found")
)

Functions

This section is empty.

Types

type ConfigCenter

type ConfigCenter interface {
	GetNamespace(ns string) (*config.Namespace, error)
	ListAllNamespace() ([]*config.Namespace, error)
}

func CreateConfigCenter

func CreateConfigCenter(cfg config.ConfigCenter) (ConfigCenter, error)

type EtcdConfigCenter

type EtcdConfigCenter struct {
	// contains filtered or unexported fields
}

func CreateEtcdConfigCenter

func CreateEtcdConfigCenter(cfg config.ConfigEtcd) (*EtcdConfigCenter, error)

func NewEtcdConfigCenter

func NewEtcdConfigCenter(etcdClient *clientv3.Client, basePath string, strictParse bool) *EtcdConfigCenter

func (*EtcdConfigCenter) Close

func (e *EtcdConfigCenter) Close()

func (*EtcdConfigCenter) DelNamespace

func (e *EtcdConfigCenter) DelNamespace(ns string) error

func (*EtcdConfigCenter) GetNamespace

func (e *EtcdConfigCenter) GetNamespace(ns string) (*config.Namespace, error)

func (*EtcdConfigCenter) ListAllNamespace

func (e *EtcdConfigCenter) ListAllNamespace() ([]*config.Namespace, error)

func (*EtcdConfigCenter) SetNamespace

func (e *EtcdConfigCenter) SetNamespace(ns string, value string) error

type FileConfigCenter

type FileConfigCenter struct {
	// contains filtered or unexported fields
}

FileConfigCenter is only for test use, please do not use it in production environment.

func CreateFileConfigCenter

func CreateFileConfigCenter(nsdir string) (*FileConfigCenter, error)

func (*FileConfigCenter) GetNamespace

func (f *FileConfigCenter) GetNamespace(ns string) (*config.Namespace, error)

func (*FileConfigCenter) ListAllNamespace

func (f *FileConfigCenter) ListAllNamespace() ([]*config.Namespace, error)

Jump to

Keyboard shortcuts

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