event

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Byter

type Byter interface {
	Bytes() []byte
}

type ConcreteEvent

type ConcreteEvent struct {
	Kind string    `json:"kind"`
	ID   uint64    `json:"id"`
	At   time.Time `json:"at"`
	Data any       `json:"data"`
}

func (*ConcreteEvent) Highlight

func (e *ConcreteEvent) Highlight() []string

Highlight informs the diff renderer of a list of event data keys that it should make more visible in the data flow.

func (*ConcreteEvent) Key

func (e *ConcreteEvent) Key() string

Key relays Data.Key if implemented. The keyer interface is used by the diff output of `node events` command.

func (*ConcreteEvent) KeysToDelete

func (e *ConcreteEvent) KeysToDelete() []string

KeysToDelete relays Data.KeysToDelete if implemented. The keysToDeleter interface is used by the diff output of `node events` command.

func (ConcreteEvent) Render

func (e ConcreteEvent) Render() string

func (ConcreteEvent) String

func (e ConcreteEvent) String() string

type ContextSetter

type ContextSetter interface {
	SetContext(ctx context.Context)
}

type Event

type Event struct {
	// Kind can be either "patch" or "event".
	// A patch is a change to the cluster dataset.
	//
	// Event subscribers can maintain a clone of the
	// cluster dataset by:
	// installing a full dataset with received full dataset
	// or
	// patching a full dataset with received patch events
	Kind string `json:"kind"`

	// ID is a unique event id
	ID uint64 `json:"id"`

	// At is the time the event was published
	At time.Time `json:"at"`

	// Data is the free-format dataset of the event
	Data json.RawMessage `json:"data"`
}

Event describes a opensvc daemon event

func ToEvent

func ToEvent(i any, id uint64) *Event

func (Event) AsConcreteEvent

func (e Event) AsConcreteEvent(data any) *ConcreteEvent

func (Event) Render

func (e Event) Render() string

Render formats a opensvc agent event

func (Event) String

func (e Event) String() string

type Kinder

type Kinder interface {
	Kind() string
}

type ReadCloser

type ReadCloser interface {
	Reader
	Close() error
}

type Reader

type Reader interface {
	Read() (*Event, error)
}

type ServedByGetter

type ServedByGetter interface {
	GetServedBy() string
}

type Stringer

type Stringer interface {
	String() string
}

type Timer

type Timer interface {
	Time() time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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