Documentation ¶
Index ¶
- Constants
- Variables
- type Add
- type Constraint
- type Delete
- type Entry
- type ID
- type Queue
- func (q *Queue) Boundaries(ctx context.Context) (ID, ID, error)
- func (q *Queue) Commit(ctx context.Context, b []byte) (ID, error)
- func (q *Queue) CommitAt(ctx context.Context, at ID, b []byte) error
- func (q *Queue) Load(ctx context.Context, id ID) ([]byte, error)
- func (q *Queue) MoveTail(ctx context.Context, id, base ID) error
- func (q *Queue) NewReader(ctx context.Context, head, tail ID) *Reader
- func (q *Queue) Open(ctx context.Context, head, tail ID) (io.Reader, error)
- func (q *Queue) OpenAsZNG(ctx context.Context, zctx *zed.Context, head, tail ID) (*zngio.Reader, error)
- func (q *Queue) Path() *storage.URI
- func (q *Queue) ReadHead(ctx context.Context) (ID, error)
- func (q *Queue) ReadTail(ctx context.Context) (ID, ID, error)
- type Reader
- type Store
- func (s *Store) All(ctx context.Context) ([]Entry, error)
- func (s *Store) Delete(ctx context.Context, key string, c Constraint) error
- func (s *Store) Insert(ctx context.Context, e Entry) error
- func (s *Store) Keys(ctx context.Context, key string) ([]string, error)
- func (s *Store) Lookup(ctx context.Context, key string) (Entry, error)
- func (s *Store) Move(ctx context.Context, oldKey string, newEntry Entry) error
- func (s *Store) Update(ctx context.Context, e Entry, c Constraint) error
- func (s *Store) Values(ctx context.Context) ([]interface{}, error)
- type Update
Constants ¶
const MaxReadRetry = 10
Variables ¶
var ( ErrEmpty = errors.New("empty log") ErrFailed = errors.New("transaction failed") )
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) CommitAt ¶
CommitAt commits a new serialized ZNG sequence to the journal presuming the previous state conformed to the journal position "at". The entry is written at the next position in the log if possible. Otherwise, a write conflict occurs and an error is returned.
func (*Queue) MoveTail ¶
MoveTail moves the tail of the journal to the indicated ID and does no validation. Use with caution. This update must be made by an exclusive write-lock that is outside the scope of the journal package. Unlike HEAD, TAIL is not a hint and must be consistent with the actual log entries at all times.
func (*Queue) NewReader ¶
NewReader returns a zngio.Reader that concatenates the journal files in sequence from tail to head. Since ZNG is stored in the journal, this produce a byte stream suitable for wrapper in a zngio.Reader.