eventstore

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStore

type EventStore struct {
	// contains filtered or unexported fields
}

EventStore perists details for events which are to be sent to the Cacophony Events API.

func Open

func Open(fileName string) (*EventStore, error)

Open opens the event store. It should be closed later with the Close() method.

func (*EventStore) All

func (s *EventStore) All() ([]EventTimes, error)

All returns all the events stored in the event store as EventTimes instances. Events with identical details are grouped together into a single EventTimes instance.

func (*EventStore) Close

func (s *EventStore) Close()

Close releases resources used by the EventStore. It should be called once the EventStore is no longer required.

func (*EventStore) Discard

func (s *EventStore) Discard(ev EventTimes) error

Discard removes an event from from the store.

func (*EventStore) Queue

func (s *EventStore) Queue(details []byte, timestamp time.Time) error

Queue recordings an event in the event store. The details provided uniquely identify the event, but the contents are opaque to the event store.

type EventTimes

type EventTimes struct {
	Details    []byte
	Timestamps []time.Time
}

EventTimes holds

Jump to

Keyboard shortcuts

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