crdbx

package
v0.0.635 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTransactionConsistency

func SetTransactionConsistency(c *pop.Connection, level ConsistencyLevel, fallback ConsistencyLevel) error

SetTransactionConsistency sets the transaction consistency level for CockroachDB.

func SetTransactionReadOnly added in v0.0.595

func SetTransactionReadOnly(c *pop.Connection) error

SetTransactionReadOnly sets the transaction to read only for CockroachDB.

Types

type ConsistencyLevel

type ConsistencyLevel string

ConsistencyLevel is the consistency level. swagger:enum ConsistencyLevel

const (
	// ConsistencyLevelUnset is the unset / default consistency level.
	ConsistencyLevelUnset ConsistencyLevel = ""
	// ConsistencyLevelStrong is the strong consistency level.
	ConsistencyLevelStrong ConsistencyLevel = "strong"
	// ConsistencyLevelEventual is the eventual consistency level using follower read timestamps.
	ConsistencyLevelEventual ConsistencyLevel = "eventual"
)

func ConsistencyLevelFromRequest

func ConsistencyLevelFromRequest(r *http.Request) ConsistencyLevel

ConsistencyLevelFromRequest extracts the consistency level from a request.

func ConsistencyLevelFromString

func ConsistencyLevelFromString(in string) ConsistencyLevel

ConsistencyLevelFromString converts a string to a ConsistencyLevel. If the string is not recognized or unset, ConsistencyLevelStrong is returned.

type ConsistencyRequestParameters

type ConsistencyRequestParameters struct {
	// Read Consistency Level (preview)
	//
	// The read consistency level determines the consistency guarantee for reads:
	//
	// - strong (slow): The read is guaranteed to return the most recent data committed at the start of the read.
	// - eventual (very fast): The result will return data that is about 4.8 seconds old.
	//
	// The default consistency guarantee can be changed in the Ory Network Console or using the Ory CLI with
	// `ory patch project --replace '/previews/default_read_consistency_level="strong"'`.
	//
	// Setting the default consistency level to `eventual` may cause regressions in the future as we add consistency
	// controls to more APIs. Currently, the following APIs will be affected by this setting:
	//
	// - `GET /admin/identities`
	//
	// This feature is in preview and only available in Ory Network.
	//
	// required: false
	// in: query
	Consistency ConsistencyLevel `json:"consistency"`
}

Control API consistency guarantees

swagger:model consistencyRequestParameters

Jump to

Keyboard shortcuts

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