watcher

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// Id is registry id
	Id string
	// Type defines type of event
	Type EventType
	// Timestamp is event timestamp
	Timestamp time.Time
	// Service is registry service
	Service *discovery.Service
}

Event is registry event

type EventType

type EventType int

EventType defines registry event type

const (
	// Create is emitted when a new service is registered
	Create EventType = iota
	// Delete is emitted when an existing service is unregsitered
	Delete
	// Update is emitted when an existing service is updated
	Update
)

func (EventType) String

func (t EventType) String() string

String returns human readable event type

type Result

type Result struct {
	Action  string
	Service *discovery.Service
}

type WatchOption

type WatchOption func(*WatchOptions)

type WatchOptions

type WatchOptions struct {
	// Specify a service to watch
	// If blank, the watch is for all services
	Service string
	// Other options for implementations of the interface
	// can be stored in a context
	Context context.Context
}

type Watcher

type Watcher interface {
	// Next is a blocking call
	Next() (*Result, error)
	Stop()
}

Jump to

Keyboard shortcuts

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