consistency

package
v0.0.0-...-319cc75 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithOverlapKey

func WithOverlapKey(ctx context.Context, key string) context.Context

WithOverlapKey creates a new context including the SpiceDB overlap key that will be used for subsequent requests.

Types

type Strategy

type Strategy struct {
	V1Consistency *v1.Consistency
}

Strategy represents the strategy that a request can use in order to trade-off speed with latency. For more info see: https://authzed.com/docs/spicedb/concepts/consistency https://en.wikipedia.org/wiki/PACELC_theorem

func AtLeast

func AtLeast(revision string) *Strategy

AtLeast configures the request to evaluate at the provided database revision or newer.

This should be used to avoid read-after-write inconsistencies.

func Full

func Full() *Strategy

Full configures the request to evaluate at the most recent revision of the database.

This is the least performant, but guarantees read consistency.

func MinLatency

func MinLatency() *Strategy

MinLatency configures the request to evaluate at the database's preferred revision.

This provides the optimal performance and is the default if no consistency is specified.

func Snapshot

func Snapshot(revision string) *Strategy

Snapshot configures the request to evaluate at the provided database revision.

This should be very rarely used because SpiceDB is designed to pick the optimal revision for a request.

Jump to

Keyboard shortcuts

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