responsemeta

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: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIntResponseTrailerMetadata

func GetIntResponseTrailerMetadata(trailer metadata.MD, key ResponseMetadataTrailerKey) (int, error)

GetIntResponseTrailerMetadata retrieves an integer value for the given key in the trailer metadata of a SpiceDB API response.

func GetResponseTrailerMetadata added in v0.6.0

func GetResponseTrailerMetadata(trailer metadata.MD, key ResponseMetadataTrailerKey) (string, error)

GetResponseTrailerMetadata retrieves a string value for the given key in the trailer metadata of a SpiceDB API response.

func GetResponseTrailerMetadataOrNil added in v0.7.0

func GetResponseTrailerMetadataOrNil(trailer metadata.MD, key ResponseMetadataTrailerKey) (*string, error)

GetResponseTrailerMetadataOrNil retrieves a string value for the given key in the trailer metadata of a SpiceDB API response or nil if not found.

func ListResponseTrailerMetadata added in v0.6.0

func ListResponseTrailerMetadata(trailer metadata.MD, key ResponseMetadataTrailerKey) ([]string, error)

ListResponseTrailerMetadata retrieves the string value(s) for the given key in the trailer metadata of a SpiceDB API response.

func SetResponseHeaderMetadata

func SetResponseHeaderMetadata(ctx context.Context, values map[ResponseMetadataHeaderKey]string) error

SetResponseHeaderMetadata sets the external response metadata header on the given context.

func SetResponseTrailerMetadata

func SetResponseTrailerMetadata(ctx context.Context, values map[ResponseMetadataTrailerKey]string) error

SetResponseTrailerMetadata sets the external response metadata trailer on the given context.

Types

type ResponseMetadataHeaderKey

type ResponseMetadataHeaderKey string

ResponseMetadataHeaderKey defines a key in the response metadata header.

const (
	// RequestID is the key in the response header metadata for the request's tracking ID, if any.
	RequestID ResponseMetadataHeaderKey = "io.spicedb.respmeta.requestid"

	// ServerVersion is the key in the response header metadata holding the version of the server
	// handling the API request, if requested via a request header.
	ServerVersion ResponseMetadataHeaderKey = "io.spicedb.debug.version"
)

type ResponseMetadataTrailerKey

type ResponseMetadataTrailerKey string

ResponseMetadataTrailerKey defines a key in the response metadata trailer.

const (
	// DispatchedOperationsCount is the key in the response trailer metadata for
	// the number of dispatched operations that were needed to perform the overall
	// API call.
	DispatchedOperationsCount ResponseMetadataTrailerKey = "io.spicedb.respmeta.dispatchedoperationscount"

	// CachedOperationsCount is the key in the response trailer metadata for
	// the number of *cached* operations that would have been otherwise dispatched
	// to perform the overall API call.
	CachedOperationsCount ResponseMetadataTrailerKey = "io.spicedb.respmeta.cachedoperationscount"

	// DebugInformation contains the JSON-encoded form of the debug information for the API call,
	// if requested and supported.
	//
	// NOTE: deprecated in favor of the Check response containing the trace. The JSON will now
	// contain a note indicating to look on the response object itself.
	DebugInformation ResponseMetadataTrailerKey = "io.spicedb.respmeta.debuginfo"
)

Jump to

Keyboard shortcuts

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