event

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 4 Imported by: 20

Documentation

Overview

Package event provides an evented mechanism for hooking into platform specifics.

This is necessary as not all platforms have identical capabilities, so the reporting output (among other things) may differ slightly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name   string
	Fields Fields
}

Event is a representation of an operation performed by a platform, and is used for reporting.

func (*Event) Duration

func (e *Event) Duration(name string) time.Duration

Duration value.

func (*Event) Int

func (e *Event) Int(name string) int

Int value.

func (*Event) Int64

func (e *Event) Int64(name string) int64

Int64 value.

func (*Event) String

func (e *Event) String(name string) string

String value.

func (*Event) Strings

func (e *Event) Strings(name string) []string

Strings value.

type Events

type Events chan *Event

Events channel.

func (Events) Emit

func (e Events) Emit(name string, fields Fields)

Emit an event.

func (Events) Time

func (e Events) Time(name string, fields Fields) func()

Time an event.

type Fields

type Fields map[string]interface{}

Fields for an event.

Jump to

Keyboard shortcuts

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