Documentation ¶
Index ¶
- type Event
- type EventDescription
- type EventStore
- func (s *EventStore) Add(event *Event) error
- func (s *EventStore) All() ([]EventTimes, error)
- func (s *EventStore) Close()
- func (s *EventStore) Delete(key uint64) error
- func (s *EventStore) DeleteKeys(keys []uint64) error
- func (s *EventStore) Discard(ev EventTimes) error
- func (s *EventStore) Get(key uint64) ([]byte, error)
- func (s *EventStore) GetKeys() ([]uint64, error)
- func (s *EventStore) Queue(details []byte, timestamp time.Time) error
- type EventTimes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Timestamp time.Time Description EventDescription `json:"description"` }
type EventDescription ¶
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) Add ¶
func (s *EventStore) Add(event *Event) error
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) Delete ¶
func (s *EventStore) Delete(key uint64) error
func (*EventStore) DeleteKeys ¶
func (s *EventStore) DeleteKeys(keys []uint64) error
func (*EventStore) Discard ¶
func (s *EventStore) Discard(ev EventTimes) error
Discard removes an event from from the store.
func (*EventStore) GetKeys ¶
func (s *EventStore) GetKeys() ([]uint64, error)
func (*EventStore) Queue ¶
func (s *EventStore) Queue(details []byte, timestamp time.Time) error
Use Add for adding new events now. This is keept for testing migrations Queue recordings an event in the event store. The details provided uniquely identify the event, but the contents are opaque to the event store.