apollo

package
v0.0.0-...-2828018 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TmpFileSuffix = ".tmp"

Variables

This section is empty.

Functions

func NewHandler

func NewHandler() common.AgentHandler

Types

type Apollo

type Apollo struct {
	Worker []WorkerContract
	Wg     *sync.WaitGroup
	// contains filtered or unexported fields
}

func (*Apollo) AfterCompletion

func (a *Apollo) AfterCompletion(ctx context.Context) error

func (*Apollo) PostHandle

func (a *Apollo) PostHandle(param *common.HandlerParam, ctx context.Context) error

func (*Apollo) PreHandle

func (a *Apollo) PreHandle(ctx context.Context) error

func (*Apollo) SetRunMode

func (a *Apollo) SetRunMode(mode string)

func (*Apollo) WriteData

func (a *Apollo) WriteData(worker WorkerContract, ctx context.Context)

type ConfigData

type ConfigData map[string]map[string]string

type DefaultWorker

type DefaultWorker struct {
	Meta *MetaConfig
	Data *sync.Map
	// contains filtered or unexported fields
}

func (*DefaultWorker) CloseChan

func (w *DefaultWorker) CloseChan()

func (*DefaultWorker) DeleteDataKey

func (w *DefaultWorker) DeleteDataKey(key string)

func (*DefaultWorker) GetChan

func (w *DefaultWorker) GetChan() chan struct{}

func (*DefaultWorker) GetConfig

func (w *DefaultWorker) GetConfig(wg *sync.WaitGroup, ctx context.Context)

func (*DefaultWorker) GetData

func (w *DefaultWorker) GetData() *sync.Map

func (*DefaultWorker) GetMeta

func (w *DefaultWorker) GetMeta() *MetaConfig

func (*DefaultWorker) IsAllInOne

func (w *DefaultWorker) IsAllInOne() bool

func (*DefaultWorker) SetMeta

func (w *DefaultWorker) SetMeta(meta *MetaConfig)

type MetaConfig

type MetaConfig struct {
	Address    string
	Cluster    string
	ClientIp   string
	AppId      string
	Secret     string
	Namespaces []string
	FileName   string
	Syntax     string
}

type WorkerContract

type WorkerContract interface {
	SetMeta(meta *MetaConfig)
	GetMeta() *MetaConfig
	GetConfig(wg *sync.WaitGroup, ctx context.Context)
	GetChan() chan struct{}
	CloseChan()
	GetData() *sync.Map
	DeleteDataKey(key string)
	IsAllInOne() bool
}

func NewDefaultWorker

func NewDefaultWorker(allInOne bool, interval time.Duration, mode string) WorkerContract

Jump to

Keyboard shortcuts

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