events

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventType

func EventType(e Event) reflect.Type

Types

type Error

type Error struct {
	Time
	// contains filtered or unexported fields
}

func NewError

func NewError(err error) *Error

func (*Error) Error

func (e *Error) Error() string

type Event

type Event interface {
	When() time.Time
	String() string
}

type EventList

type EventList []Event

type Interrupt

type Interrupt struct {
	Time
	// contains filtered or unexported fields
}

func NewInterrupt

func NewInterrupt(data any) *Interrupt

func (*Interrupt) Data

func (i *Interrupt) Data() any

func (*Interrupt) String

func (i *Interrupt) String() string

type Message

type Message struct {
	Time
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(cmd int, data any) *Message

func (*Message) Command

func (e *Message) Command() int

func (*Message) Data

func (e *Message) Data() any

func (*Message) Index

func (e *Message) Index() uint64

func (*Message) String

func (e *Message) String() string

type Queue

type Queue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue() *Queue

func (*Queue) Capacity

func (e *Queue) Capacity() int

func (*Queue) Events

func (e *Queue) Events() int

func (*Queue) Pop

func (e *Queue) Pop() Event

func (*Queue) Push

func (e *Queue) Push(evt Event)

type Response

type Response struct {
	Time
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(msg *Message, rsp any) *Response

func (*Response) Command

func (e *Response) Command() int

func (*Response) Index

func (e *Response) Index() uint64

func (*Response) Received

func (e *Response) Received() time.Time

func (*Response) Response

func (e *Response) Response() any

func (*Response) String

func (e *Response) String() string

type Signal

type Signal struct {
	Time
	// contains filtered or unexported fields
}

func NewSignal

func NewSignal(sig os.Signal) *Signal

func (*Signal) Signal

func (e *Signal) Signal() os.Signal

func (*Signal) String

func (e *Signal) String() string

type Time

type Time struct {
	TStamp time.Time
}

func NewTime

func NewTime() *Time

func (*Time) SetNow

func (e *Time) SetNow()

func (*Time) SetWhen

func (e *Time) SetWhen(val time.Time)

func (*Time) String

func (e *Time) String() string

func (*Time) When

func (e *Time) When() time.Time

Jump to

Keyboard shortcuts

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