event

package
v3.8.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 1 Imported by: 16

Documentation

Index

Constants

View Source
const (
	// NotificationEventCategory category for notification events.
	NotificationEventCategory = "notifications"
)

Variables

This section is empty.

Functions

func AddCustomAttributes

func AddCustomAttributes(e *Event, customAttributes []attribute.Attribute)

AddCustomAttributes add customAttributes to the Event

Types

type Event

type Event struct {
	Summary  string `json:"summary"`
	Category string `json:"category,omitempty"`
	// Attributes are optional, they represent additional information that
	// can be attached to an event.
	Attributes map[string]interface{} `json:"attributes,omitempty"`
}

Event is the data type to represent arbitrary, one-off messages for key activities on a system. Ex:

Event{
  Category: "gear",
  Summary:  "gear has been changed",
  Attributes: map[string]interface{}{
    "oldGear":      3,
    "newGear":      4,
    "transmission": "manual",
  },
}

func New

func New(summary, category string) *Event

New creates a new event.

func NewNotification

func NewNotification(summary string) *Event

NewNotification creates a new notification event.

func NewWithAttributes

func NewWithAttributes(summary, category string, attributes map[string]interface{}) *Event

NewWithAttributes creates a new event with the given attributes

Jump to

Keyboard shortcuts

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