mutator

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 12

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 = status.Errorf(codes.FailedPrecondition, "mutation replay")
	// ErrSize occurs when the mutation size is larger than the allowed upper
	// bound.
	ErrSize = status.Errorf(codes.InvalidArgument, "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 = status.Errorf(codes.InvalidArgument, "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 = status.Errorf(codes.InvalidArgument, "mutation: invalid signature")
	// ErrUnauthorized occurs when the mutation has not been signed by a key in the
	// previous entry.
	ErrUnauthorized = status.Errorf(codes.PermissionDenied, "mutation: unauthorized")
)

Functions

This section is empty.

Types

type LogMessage

type LogMessage struct {
	LogID     int64
	ID        water.Mark
	LocalID   int64
	CreatedAt time.Time
	Mutation  *pb.SignedEntry
	ExtraData *pb.Committed
}

LogMessage represents a change to a user, and associated data.

type VerifyMutationFn

type VerifyMutationFn func(mutation *pb.SignedEntry) error

VerifyMutationFn verifies that a mutation is internally consistent.

Directories

Path Synopsis
Package entry implements a simple replacement strategy as a mapper.
Package entry implements a simple replacement strategy as a mapper.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL