event

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Timestamp int64  `json:"timestamp"`
	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 defines the structure of an event

func New

func New(timestamp time.Time, summary, category string) (*Event, error)

New creates a new event.

func NewNotification

func NewNotification(summary string) (*Event, error)

NewNotification creates a new notification event.

func (*Event) AddAttribute

func (e *Event) AddAttribute(key string, value interface{}) error

AddAttribute adds an attribute to the Event

type Events

type Events []*Event

Events stores events

Jump to

Keyboard shortcuts

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