Documentation ¶
Index ¶
- Constants
- Variables
- type ConfigCenter
- type EtcdConfigCenter
- func (e *EtcdConfigCenter) Close()
- func (e *EtcdConfigCenter) DelNamespace(ns string) error
- func (e *EtcdConfigCenter) GetNamespace(ns string) (*config.Namespace, error)
- func (e *EtcdConfigCenter) ListAllNamespace() ([]*config.Namespace, error)
- func (e *EtcdConfigCenter) SetNamespace(ns string, value string) error
- type FileConfigCenter
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)
Click to show internal directories.
Click to hide internal directories.