event

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EventInit event init
	EventInit uint32 = 1 << 1
	// EventResource resource event
	EventResource uint32 = 1 << 2
	// EventContainer container create event
	EventContainer uint32 = 1 << 3
	// EventResourceStats resource stats
	EventResourceStats uint32 = 1 << 4
	// EventContainerStats container stats
	EventContainerStats uint32 = 1 << 5
	// EventFlagAll all event
	EventFlagAll = 0xffffffff
)

Functions

func MatchEvent

func MatchEvent(event, flag uint32) bool

MatchEvent returns the flag has the target event

func NewContainerEvent

func NewContainerEvent(target metadata.Container) rpcpb.EventNotify

NewContainerEvent create container event

func NewContainerStatsEvent

func NewContainerStatsEvent(stats *metapb.ContainerStats) rpcpb.EventNotify

NewContainerStatsEvent create container stats event

func NewInitEvent

func NewInitEvent(snap Snapshot) (*rpcpb.InitEventData, error)

NewInitEvent create init event

func NewResourceEvent

func NewResourceEvent(target metadata.Resource, leaderID uint64, removed bool, create bool) rpcpb.EventNotify

NewResourceEvent create resource event

func NewResourceStatsEvent

func NewResourceStatsEvent(stats *metapb.ResourceStats) rpcpb.EventNotify

NewResourceStatsEvent create resource stats event

Types

type Snapshot

type Snapshot struct {
	Resources  []metadata.Resource
	Containers []metadata.Container
	Leaders    map[uint64]uint64
}

Snapshot cache snapshot

Jump to

Keyboard shortcuts

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