apollo

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

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 added in v1.3.3

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

func Errorf added in v1.3.3

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

func Infof added in v1.3.3

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(labels 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(key 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(key string, value 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