Documentation
¶
Overview ¶
Package mutator defines the operations to transform mutations into changes in the map as well as operations to write and read mutations to and from the database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MaxMutationSize represent the maximum allowed mutation size in bytes. MaxMutationSize = 16 * 1024 // ErrReplay occurs when two mutations acting on the same entry & revision // occur. ErrReplay = errors.New("mutation replay") // ErrSize occurs when the mutation size is larger than the allowed upper // bound. ErrSize = errors.New("mutation: too large") // ErrPreviousHash occurs when the mutation the hash of the previous // entry provided in the mutation does not match the previous entry // itself. ErrPreviousHash = errors.New("mutation: previous entry hash does not match the hash provided in the mutation") // ErrInvalidSig occurs when either the current or previous update entry // signature verification fails. ErrInvalidSig = errors.New("mutation: invalid signature") // previous entry. ErrUnauthorized = errors.New("mutation: unauthorized") )
Functions ¶
This section is empty.
Types ¶
type LogMessage ¶
LogMessage represents a change to a user, and associated data.
type MapLogItemFn ¶
type MapLogItemFn func(logItem *LogMessage, emit func(index []byte, mutation *pb.EntryUpdate)) error
MapLogItemFn takes a log item and emits 0 or more KV<index, mutations> pairs.
type ReduceMutationFn ¶
type ReduceMutationFn func(existingMapLeafValue, mutation *pb.SignedEntry) (*pb.SignedEntry, error)
ReduceMutationFn takes the existing mapleaf and a new mutation and returns the new value for that map leaf. ReduceMutationFn verifies that this is a valid mutation for this item. ReduceMutationFn must be idempotent.
Click to show internal directories.
Click to hide internal directories.