Documentation ¶
Index ¶
- Variables
- func Decode(data string, item interface{}) interface{}
- type ProviderType
- type RemoteConfig
- func (rc *RemoteConfig) GetConf(path string) interface{}
- func (rc *RemoteConfig) GetService(path string) []string
- func (rc *RemoteConfig) RegisterNode(path, nodeID string, ttl time.Duration) error
- func (rc *RemoteConfig) SubscribeConf(path string, val interface{}) error
- func (rc *RemoteConfig) SubscribeService(path string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ProviderType ¶
type ProviderType string
const ( Debug ProviderType = backend.Debug EtcdV3 = backend.EtcdV3 )
type RemoteConfig ¶
func New ¶
func New(ctx context.Context, typ ProviderType, endPoint, user, password string) (*RemoteConfig, error)
func NewWithProvider ¶
func (*RemoteConfig) GetConf ¶
func (rc *RemoteConfig) GetConf(path string) interface{}
func (*RemoteConfig) GetService ¶
func (rc *RemoteConfig) GetService(path string) []string
Get specified service nodes
func (*RemoteConfig) RegisterNode ¶
func (rc *RemoteConfig) RegisterNode(path, nodeID string, ttl time.Duration) error
Register node for service discovery
func (*RemoteConfig) SubscribeConf ¶
func (rc *RemoteConfig) SubscribeConf(path string, val interface{}) error
Subscribe remote config
func (*RemoteConfig) SubscribeService ¶
func (rc *RemoteConfig) SubscribeService(path string) error
Subscribe specified service
Click to show internal directories.
Click to hide internal directories.