Documentation ¶
Overview ¶
Package sacks holds the Sack interface, the Brief project's abstraction of a collection of messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Sack ¶
type Sack interface { Query(*bql.Query) ([]msgs.MessageId, error) Lookup(msgs.MessageId) (*msgs.Message, error) // SetDocket sets the docket k's entry to v, timestamped at t. // v MUST NOT be retained. // // Implementations are free to discard t and replace it with the timestamp // when a SetDocket request came in. Implementations that provide a certain // internal monotonicity may decide to do this. // // Commonly called with t=time.Now(). SetDocket(id msgs.MessageId, t time.Time, k string, v []byte) error // Sack sacks a raw byte slice. // Sack MUST fail if the given message is not structurally valid in the // RFC 822 sense, or does not have exactly one Message-Id. // Sack MAY fail if the Message-Id is already taken in the Sack. It MAY // also change the Message-Id and create an alternate representation for an // already present message. // Docket may be nil. // Sack may fail for other reasons such add read-only status or // out-of-space conditions in the underlying storage medium. // // NOTE: Sack by design does have a bare []byte parameter and *not* e.g. // dockets.Undocketed since the latter is a sacks/fssacks-specific concept. Sack(msgs.Docket, []byte) (msgs.MessageId, error) }
Sack represents a postbag: an unordered collection of mail messages, indexed by their Message-Id. A Sack is safe for concurrent use. A Sack's operations are atomic.
Click to show internal directories.
Click to hide internal directories.