event

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxMessagesPerEventType int = 5
)

Variables

This section is empty.

Functions

func Record

func Record(name string, detail string)

func Recordf

func Recordf(name string, format string, args ...interface{})

func StartDefaultEventStore

func StartDefaultEventStore(stopCh <-chan struct{})

Types

type Event

type Event struct {
	Name       string
	Detail     string
	Occurrence time.Time
}

type EventCount

type EventCount struct {
	Key            string    `json:"message"`
	Count          int       `json:"count"`
	LastOccurrence time.Time `json:"last_occurrence"`
}

type EventGroup

type EventGroup struct {
	Name           string       `json:"name"`
	Total          int          `json:"total"`
	Counts         []EventCount `json:"counts"`
	LastOccurrence time.Time    `json:"last_occurrence"`
}

func Query

func Query() []EventGroup

func (*EventGroup) Merge

func (e *EventGroup) Merge(event Event)

type EventStore

type EventStore struct {
	// contains filtered or unexported fields
}
var DefaultStore *EventStore

func NewEventStore

func NewEventStore() *EventStore

func (*EventStore) Query

func (store *EventStore) Query() []EventGroup

func (*EventStore) Record

func (store *EventStore) Record(name string, detail string)

func (*EventStore) Recordf

func (store *EventStore) Recordf(name string, format string, args ...interface{})

func (*EventStore) Start

func (store *EventStore) Start(stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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