Documentation ¶
Index ¶
- Variables
- func NewStore() configstores.Store
- type AgolloRepository
- func (a *AgolloRepository) AddChangeListener(listener *changeListener)
- func (a *AgolloRepository) Connect() error
- func (a *AgolloRepository) Get(namespace string, key string) (interface{}, error)
- func (a *AgolloRepository) Range(namespace string, f func(key interface{}, value interface{}) bool) error
- func (a *AgolloRepository) SetConfig(r *repoConfig)
- type ConfigStore
- func (c *ConfigStore) Delete(ctx context.Context, req *configstores.DeleteRequest) error
- func (c *ConfigStore) Get(ctx context.Context, req *configstores.GetRequest) ([]*configstores.ConfigurationItem, error)
- func (c *ConfigStore) GetAppId() string
- func (c *ConfigStore) GetDefaultGroup() string
- func (c *ConfigStore) GetDefaultLabel() string
- func (c *ConfigStore) GetStoreName() string
- func (c *ConfigStore) Init(config *configstores.StoreConfig) error
- func (c *ConfigStore) Set(ctx context.Context, req *configstores.SetRequest) error
- func (c *ConfigStore) StopSubscribe()
- func (c *ConfigStore) Subscribe(req *configstores.SubscribeReq, ch chan *configstores.SubscribeResp) error
- type DefaultLogger
- func (d *DefaultLogger) Debug(v ...interface{})
- func (d *DefaultLogger) Debugf(format string, params ...interface{})
- func (d *DefaultLogger) Error(v ...interface{})
- func (d *DefaultLogger) Errorf(format string, params ...interface{})
- func (d *DefaultLogger) Info(v ...interface{})
- func (d *DefaultLogger) Infof(format string, params ...interface{})
- func (d *DefaultLogger) Warn(v ...interface{})
- func (d *DefaultLogger) Warnf(format string, params ...interface{})
- type RepoForListener
- type Repository
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoConfig = errors.New("configuration illegal:no config data")
Functions ¶
func NewStore ¶
func NewStore() configstores.Store
Types ¶
type AgolloRepository ¶
type AgolloRepository struct {
// contains filtered or unexported fields
}
Implement Repository interface
func (*AgolloRepository) AddChangeListener ¶
func (a *AgolloRepository) AddChangeListener(listener *changeListener)
func (*AgolloRepository) Connect ¶
func (a *AgolloRepository) Connect() error
func (*AgolloRepository) Get ¶
func (a *AgolloRepository) Get(namespace string, key string) (interface{}, error)
func (*AgolloRepository) Range ¶
func (a *AgolloRepository) Range(namespace string, f func(key interface{}, value interface{}) bool) error
func (*AgolloRepository) SetConfig ¶
func (a *AgolloRepository) SetConfig(r *repoConfig)
type ConfigStore ¶
type ConfigStore struct {
// contains filtered or unexported fields
}
func (*ConfigStore) Delete ¶
func (c *ConfigStore) Delete(ctx context.Context, req *configstores.DeleteRequest) error
Delete deletes configuration from configuration store.
func (*ConfigStore) Get ¶
func (c *ConfigStore) Get(ctx context.Context, req *configstores.GetRequest) ([]*configstores.ConfigurationItem, error)
Get gets configuration from configuration store.
func (*ConfigStore) GetAppId ¶
func (c *ConfigStore) GetAppId() string
func (*ConfigStore) GetDefaultGroup ¶
func (c *ConfigStore) GetDefaultGroup() string
func (*ConfigStore) GetDefaultLabel ¶
func (c *ConfigStore) GetDefaultLabel() string
func (*ConfigStore) GetStoreName ¶
func (c *ConfigStore) GetStoreName() string
func (*ConfigStore) Init ¶
func (c *ConfigStore) Init(config *configstores.StoreConfig) error
Init SetConfig the configuration store.
func (*ConfigStore) Set ¶
func (c *ConfigStore) Set(ctx context.Context, req *configstores.SetRequest) error
Set saves configuration into configuration store.
func (*ConfigStore) StopSubscribe ¶
func (c *ConfigStore) StopSubscribe()
func (*ConfigStore) Subscribe ¶
func (c *ConfigStore) Subscribe(req *configstores.SubscribeReq, ch chan *configstores.SubscribeResp) error
Subscribe gets configuration from configuration store and subscribe the updates.
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
An adapter to implement log.LoggerInterface in agollo package.
func NewDefaultLogger ¶
func NewDefaultLogger(logger log.ErrorLogger) *DefaultLogger
func (*DefaultLogger) Debug ¶
func (d *DefaultLogger) Debug(v ...interface{})
func (*DefaultLogger) Debugf ¶
func (d *DefaultLogger) Debugf(format string, params ...interface{})
func (*DefaultLogger) Error ¶
func (d *DefaultLogger) Error(v ...interface{})
func (*DefaultLogger) Errorf ¶
func (d *DefaultLogger) Errorf(format string, params ...interface{})
func (*DefaultLogger) Info ¶
func (d *DefaultLogger) Info(v ...interface{})
func (*DefaultLogger) Infof ¶
func (d *DefaultLogger) Infof(format string, params ...interface{})
func (*DefaultLogger) Warn ¶
func (d *DefaultLogger) Warn(v ...interface{})
func (*DefaultLogger) Warnf ¶
func (d *DefaultLogger) Warnf(format string, params ...interface{})
type RepoForListener ¶
type Repository ¶
type Repository interface { SetConfig(r *repoConfig) Connect() error // subscribe AddChangeListener(listener *changeListener) // query Get(namespace string, key string) (interface{}, error) // process every items under the namespace Range(namespace string, f func(key, value interface{}) bool) error }
An interface to abstract different apollo sdks,also making it easier to write unit tests.
Click to show internal directories.
Click to hide internal directories.