observe

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeSet EventType = iota
	EventTypeDelete

	TopicKvEntries      topic = "kv_entries"
	TopicCatalogEntries topic = "catalog_entries"
	TopicMembers        topic = "members"
)

Variables

This section is empty.

Functions

func EmitCatalogEntry

func EmitCatalogEntry(et EventType, entry *entries.Entry) chan struct{}

func EmitKvEntry

func EmitKvEntry(et EventType, entry *entries.SignedEntry) chan struct{}

func EmitMember

func EmitMember(et EventType, member *MemberFqdn) chan struct{}

func OffAll

func OffAll()

func OffCatalogEntries

func OffCatalogEntries(et EventType, listener ...ListenerOf[*entries.Entry])

func OffKvEntries

func OffKvEntries(et EventType, listener ...ListenerOf[*entries.SignedEntry])

func OffMembers

func OffMembers(et EventType, listener ...ListenerOf[*MemberFqdn])

func OnCatalogEntries

func OnCatalogEntries(et EventType, listener ListenerOf[*entries.Entry], middlewares ...func(emitter.Event))

func OnKvEntries

func OnKvEntries(et EventType, listener ListenerOf[*entries.SignedEntry], middlewares ...func(emitter.Event))

func OnMembers

func OnMembers(et EventType, listener ListenerOf[*MemberFqdn], middlewares ...func(emitter.Event))

func Topics

func Topics() []string

Types

type EventType

type EventType int

func GetEventType

func GetEventType(e emitter.Event) EventType

type ListCatalogEntries

type ListCatalogEntries interface {
	Observe(of *emitter.EventOf[*entries.Entry])
}

type ListMembers

type ListMembers interface {
	Observe(of *emitter.EventOf[*MemberFqdn])
}

type ListSigEntries

type ListSigEntries interface {
	Observe(of *emitter.EventOf[*entries.SignedEntry])
}

type ListenerOf

type ListenerOf[T any] interface {
	Observe(e *emitter.EventOf[T])
}

type MemberFqdn

type MemberFqdn struct {
	Fqdn   string
	Member *entries.Member
}

Jump to

Keyboard shortcuts

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