Documentation ¶
Index ¶
- Constants
- Variables
- type ApiContext
- type ApiContextImpl
- type EtcdStorageImpl
- func (this *EtcdStorageImpl) Del(keys []string, apiContext ...ApiContext) error
- func (this *EtcdStorageImpl) Get(key string, apiCtx ...ApiContext) (string, error)
- func (this *EtcdStorageImpl) GetWatcher() clientv3.Watcher
- func (this *EtcdStorageImpl) Pull(keys []string, apiContext ...ApiContext) (map[string]string, error)
- func (this *EtcdStorageImpl) Set(key string, value string, apiContext ...ApiContext) error
- func (this *EtcdStorageImpl) SetContext(ctx context.Context) Storage
- func (this *EtcdStorageImpl) SetOptions(options ...Option)
- type Option
- type OptionImpl
- type Registry
- type RegistryImpl
- func (this *RegistryImpl) Boot() error
- func (this *RegistryImpl) Del(keys []string, apiContext ...ApiContext) error
- func (this *RegistryImpl) Get(key string, apiContext ...ApiContext) (string, error)
- func (this *RegistryImpl) GetWatcher() clientv3.Watcher
- func (this *RegistryImpl) On(name string, handler func(config *viper.Viper, storage Storage) error)
- func (this *RegistryImpl) Pull(keys []string, apiContext ...ApiContext) (map[string]string, error)
- func (this *RegistryImpl) RegisterEnv(object map[string]string) int
- func (this *RegistryImpl) Save(file string, handlers ...func(fs *os.File, storage Storage) error) error
- func (this *RegistryImpl) Set(key string, value string, apiContext ...ApiContext) error
- func (this *RegistryImpl) SetEntryPort(host string, options ...Option)
- func (this *RegistryImpl) SetFile(file string) Registry
- func (this *RegistryImpl) SetOptions(options ...Option)
- func (this *RegistryImpl) Watch()
- type Storage
Constants ¶
View Source
const ( EntryPoints = "entryPoints" Username = "username" Password = "password" TimeOut = "timeout" HostName = "host" HostSchema = "127.0.0.1:2380" DotDiv = "," CnfFile = "file" DefaultTimeOut = 10 * time.Second WatchEventPrefix = "watcher." )
Variables ¶
View Source
var (
EmptyGet = errors.New("empty get")
)
Functions ¶
This section is empty.
Types ¶
type ApiContext ¶
ApiContext 接口
type ApiContextImpl ¶
type ApiContextImpl struct { Ctx context.Context CancelHandler context.CancelFunc Opts []clientv3.OpOption }
ApiContextImpl 参数上下文
func (*ApiContextImpl) GetContext ¶
func (this *ApiContextImpl) GetContext() context.Context
func (*ApiContextImpl) GetOptions ¶
func (this *ApiContextImpl) GetOptions() []clientv3.OpOption
func (*ApiContextImpl) SetContext ¶
func (this *ApiContextImpl) SetContext(ctx context.Context, fn ...context.CancelFunc) ApiContext
func (*ApiContextImpl) SetOptions ¶
func (this *ApiContextImpl) SetOptions(option ...clientv3.OpOption) ApiContext
type EtcdStorageImpl ¶
func (*EtcdStorageImpl) Del ¶
func (this *EtcdStorageImpl) Del(keys []string, apiContext ...ApiContext) error
func (*EtcdStorageImpl) Get ¶
func (this *EtcdStorageImpl) Get(key string, apiCtx ...ApiContext) (string, error)
func (*EtcdStorageImpl) GetWatcher ¶
func (this *EtcdStorageImpl) GetWatcher() clientv3.Watcher
func (*EtcdStorageImpl) Pull ¶
func (this *EtcdStorageImpl) Pull(keys []string, apiContext ...ApiContext) (map[string]string, error)
func (*EtcdStorageImpl) Set ¶
func (this *EtcdStorageImpl) Set(key string, value string, apiContext ...ApiContext) error
func (*EtcdStorageImpl) SetContext ¶
func (this *EtcdStorageImpl) SetContext(ctx context.Context) Storage
func (*EtcdStorageImpl) SetOptions ¶
func (this *EtcdStorageImpl) SetOptions(options ...Option)
type OptionImpl ¶
type OptionImpl struct {
K, Val string
}
func (*OptionImpl) Copy ¶
func (this *OptionImpl) Copy() Option
func (*OptionImpl) Key ¶
func (this *OptionImpl) Key() string
func (*OptionImpl) String ¶
func (this *OptionImpl) String() string
func (*OptionImpl) V ¶
func (this *OptionImpl) V() string
func (*OptionImpl) Value ¶
func (this *OptionImpl) Value() interface{}
type Registry ¶
type Registry interface { Storage Boot() error SetFile(file string) Registry SetEntryPort(host string, options ...Option) Save(file string, handlers ...func(fs *os.File, storage Storage) error) error }
func RegistryOf ¶
type RegistryImpl ¶
type RegistryImpl struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *RegistryImpl
func (*RegistryImpl) Boot ¶
func (this *RegistryImpl) Boot() error
func (*RegistryImpl) Del ¶
func (this *RegistryImpl) Del(keys []string, apiContext ...ApiContext) error
func (*RegistryImpl) Get ¶
func (this *RegistryImpl) Get(key string, apiContext ...ApiContext) (string, error)
func (*RegistryImpl) GetWatcher ¶
func (this *RegistryImpl) GetWatcher() clientv3.Watcher
func (*RegistryImpl) Pull ¶
func (this *RegistryImpl) Pull(keys []string, apiContext ...ApiContext) (map[string]string, error)
func (*RegistryImpl) RegisterEnv ¶
func (this *RegistryImpl) RegisterEnv(object map[string]string) int
RegisterEnv 注册环境变量
func (*RegistryImpl) Set ¶
func (this *RegistryImpl) Set(key string, value string, apiContext ...ApiContext) error
func (*RegistryImpl) SetEntryPort ¶
func (this *RegistryImpl) SetEntryPort(host string, options ...Option)
func (*RegistryImpl) SetFile ¶
func (this *RegistryImpl) SetFile(file string) Registry
func (*RegistryImpl) SetOptions ¶
func (this *RegistryImpl) SetOptions(options ...Option)
func (*RegistryImpl) Watch ¶
func (this *RegistryImpl) Watch()
type Storage ¶
type Storage interface { Del(keys []string, apiContext ...ApiContext) error SetOptions(options ...Option) Get(key string, apiContext ...ApiContext) (string, error) Set(key string, value string, apiContext ...ApiContext) error GetWatcher() clientv3.Watcher Pull(keys []string, apiContext ...ApiContext) (map[string]string, error) }
func NewEtcdStorage ¶
Click to show internal directories.
Click to hide internal directories.