mobserver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	OldValue   string
	NewValue   string
	ChangeType ChangeType
}

Change ...

type ChangeEvent

type ChangeEvent struct {
	Source    ChangeEventSource
	Namespace string
	Changes   map[string]*Change
}

ChangeEvent ...

type ChangeEventSource

type ChangeEventSource int

ChangeEventSource ...

const (
	// Apollo change event source:apollo
	Apollo ChangeEventSource = iota
)

type ChangeType

type ChangeType int

ChangeType ...

const (
	// ADD change type:add
	ADD ChangeType = iota
	// MODIFY change type:modify
	MODIFY
	// DELETE change type:delete
	DELETE
)

func (ChangeType) String

func (c ChangeType) String() string

String ...

type ConfigObserver

type ConfigObserver struct {
	// contains filtered or unexported fields
}

ConfigObserver listen config change event

func NewConfigObserver

func NewConfigObserver(applyChangeEvent EventHandFunc) *ConfigObserver

NewConfigObserver ...

func (*ConfigObserver) HandleChangeEvent

func (ob *ConfigObserver) HandleChangeEvent(event *ChangeEvent)

HandleChangeEvent send event to listen chan

func (*ConfigObserver) StartWatch

func (ob *ConfigObserver) StartWatch(ctx context.Context)

StartWatch watch change event

type EventHandFunc

type EventHandFunc func(context.Context, *ChangeEvent)

EventHandFunc handle event change

Jump to

Keyboard shortcuts

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