event

package
v4.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: BSD-2-Clause, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(priority int, category, evtType, details string)

Callback defines the callback functions for client event reports

type Manager

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

Holds state for the event reporting system

func NewEventManager

func NewEventManager() *Manager

func (*Manager) EventService

func (e *Manager) EventService() (stoppable.Stoppable, error)

func (*Manager) RegisterEventCallback

func (e *Manager) RegisterEventCallback(name string,
	myFunc Callback) error

RegisterEventCallback records the given function to receive ReportableEvent objects. It returns the internal index of the callback so that it can be deleted later.

func (*Manager) Report

func (e *Manager) Report(priority int, category, evtType, details string)

Report reports an event from the client to api users, providing a priority, category, eventType, and details

func (*Manager) UnregisterEventCallback

func (e *Manager) UnregisterEventCallback(name string)

UnregisterEventCallback deletes the callback identified by the index. It returns an error if it fails.

type Reporter

type Reporter interface {
	Report(priority int, category, evtType, details string)
}

Reporter reporting api (used internally)

Jump to

Keyboard shortcuts

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