requestmeta

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// RequestServerVersion, if specified in a request header, asks SpiceDB to return its
	// server version in the response header (if supported).
	// Value: `1`
	RequestServerVersion BoolRequestMetadataHeaderKey = "io.spicedb.requestversion"

	// RequestDebugInformation, if specified in a request header, asks SpiceDB to return debug information
	// for the API call (if applicable and supported).
	// NOTE: deprecated in favor of setting with_tracing on Check requests.
	// Value: `1`
	RequestDebugInformation BoolRequestMetadataHeaderKey = "io.spicedb.requestdebuginfo"

	// RequestOverlapKey, if specified in a request header, indicates to SpiceDB
	// that all requests with the same overlap value should be protected from
	// the New Enemy Problem. This is only used with the CockroachDB datastore,
	// and only if user-provided request overlap is enabled.
	RequestOverlapKey RequestMetadataHeaderKey = "io.spicedb.requestoverlapkey"
)

Variables

This section is empty.

Functions

func AddRequestHeaders

func AddRequestHeaders(ctx context.Context, keys ...BoolRequestMetadataHeaderKey) context.Context

AddRequestHeaders returns a new context with the given values as request headers.

func SetRequestHeaders

func SetRequestHeaders(ctx context.Context, values map[RequestMetadataHeaderKey]string) context.Context

SetRequestHeaders returns a new context with the given values as request headers.

func WithOverlapKey added in v0.9.0

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

WithOverlapKey returns a new context with the overlap key set.

Types

type BoolRequestMetadataHeaderKey

type BoolRequestMetadataHeaderKey RequestMetadataHeaderKey

BoolRequestMetadataHeaderKey defines a key for a boolean value in the request metadata header.

type RequestMetadataHeaderKey

type RequestMetadataHeaderKey string

RequestMetadataHeaderKey defines a key in the request metadata header.

Jump to

Keyboard shortcuts

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