apollo

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// AppID app id const.
	AppID = "app_id"
	// NamespaceList namespace list const.
	NamespaceList = "namespace_list"
	// Cluster cluster const.
	Cluster = "cluster"
	// ignore namespace.
	IgnoreNameSpace = "ignoreNameSpace"

	Ignore = "true"
)

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, v ...interface{})

func Errorf

func Errorf(format string, v ...interface{})

func Infof

func Infof(format string, v ...interface{})

func NewApolloSource

func NewApolloSource(remoteInfo *archaius.RemoteInfo) (source.ConfigSource, error)

NewApolloSource get a apollo source singleton, and pull configs at once after init apollo client.

Types

type Source

type Source struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Source apollo source.

func (*Source) AddDimensionInfo

func (as *Source) AddDimensionInfo(_ map[string]string) error

AddDimensionInfo no use.

func (*Source) Cleanup

func (as *Source) Cleanup() error

Cleanup clean apollo cache from apollo client.

func (*Source) Delete

func (as *Source) Delete(_ string) error

Delete no use.

func (*Source) GetConfigurationByKey

func (as *Source) GetConfigurationByKey(key string) (interface{}, error)

GetConfigurationByKey get config by key, key's format is: {namespace}.field1.field2.

func (*Source) GetConfigurations

func (as *Source) GetConfigurations() (map[string]interface{}, error)

GetConfigurations get config cache map from apollo client.

func (*Source) GetPriority

func (as *Source) GetPriority() int

GetPriority get priority.

func (*Source) GetSourceName

func (as *Source) GetSourceName() string

GetSourceName get source name.

func (*Source) Set

func (as *Source) Set(_ string, _ interface{}) error

Set no use.

func (*Source) SetPriority

func (as *Source) SetPriority(priority int)

SetPriority set priority.

func (*Source) UpdateCallback

func (as *Source) UpdateCallback(apolloEvent *apollo.ChangeEvent) error

UpdateCallback callback function when config updates.

func (*Source) Watch

func (as *Source) Watch(callBack source.EventHandler) error

Watch register change event handler and start refresh configs interval.

Jump to

Keyboard shortcuts

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