apollo

package
v0.0.0-...-079b75e Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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

Delete deletes configuration from configuration store.

func (*ConfigStore) Get

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

Set saves configuration into configuration store.

func (*ConfigStore) StopSubscribe

func (c *ConfigStore) StopSubscribe()

func (*ConfigStore) Subscribe

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 RepoForListener interface {
	GetAppId() string
	GetStoreName() string
	// contains filtered or unexported methods
}

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.

Jump to

Keyboard shortcuts

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