Documentation ¶
Overview ¶
Package events provides an event log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Document map[string]interface{} `json:"doc" msgpack:"doc" firestore:"doc"` // Index for event (read only). Index int64 `json:"idx" msgpack:"idx" firestore:"idx"` // Timestamp (read only). The time at which the event was created. // Firestore sets this to the document create time. Timestamp int64 `json:"ts" msgpack:"ts" firestore:"-"` }
Event in an event log. If this format changes, you should also change in firestore and other backends that don't directly use this struct on set.
type Events ¶
type Events interface { // EventAdd adds (appends) event to the log. EventAdd(ctx context.Context, path string, d Document) (int64, error) // EventsAdd adds (appends) events (in a batch if multiple) to the log. EventsAdd(ctx context.Context, path string, d []Document) (int64, error) // Events retrives events from log with the specified options. Events(ctx context.Context, path string, opt ...Option) (Iterator, error) // EventsDelete deletes all events at the specified path. EventsDelete(ctx context.Context, path string) (bool, error) // EventPosition returns current position of event logs at the specified path. EventPosition(ctx context.Context, path string) (*Position, error) // EventPositions returns current positions of event logs at the specified paths. EventPositions(ctx context.Context, paths []string) (map[string]*Position, error) // Increment document name at path n amount. // Returns the new value and the start of the index. Increment(ctx context.Context, path string, name string, n int64) (int64, int64, error) }
Events describes an append only event log.
type Iterator ¶
type Iterator interface { // Next document, or nil. Next() (*Event, error) // Release resources associated with the iterator. Release() }
Iterator is an iterator for Event's.
func NewIterator ¶
NewIterator returns an iterator for a Event slice.
Click to show internal directories.
Click to hide internal directories.