Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID uint64
ID is the ID of a message stored in a log. It is monotonically increasing, except when the log is entirely cleared (in which case, the set of IDs is reset).
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is a replay message log that stores messages (encoded as json objects) sequentially in a set of files.
Once messages are ack'd (by calling ClearUpTo), they are removed from the log.
One log instance (with a specific config) is meant to store only a single type of message.
The log functions are safe for concurrent access.
func (*Log) ClearUpTo ¶
ClearUpTo removes all existing log entries up to (and including) the passed target ID.
func (*Log) ReadAfter ¶
ReadAfter reads all entries stored after (i.e. NOT including) the passed fromID, calling the passed function for each entry.
If needed, it's the responsibility of the f function to reset or copy the contents of the m object.
Reads from this function may interact with calls to Store() such that it is undefined if a call to Store() concurrent to a call to ReadAfter will cause the message to be generated.