meta

package
v3.80.13 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// outgoing headers
	HeaderDatabase           = "x-ydb-database"
	HeaderTicket             = "x-ydb-auth-ticket"
	HeaderVersion            = "x-ydb-sdk-build-info"
	HeaderRequestType        = "x-ydb-request-type"
	HeaderTraceID            = "x-ydb-trace-id"
	HeaderApplicationName    = "x-ydb-application-name"
	HeaderClientCapabilities = "x-ydb-client-capabilities"
	HeaderClientPid          = "x-ydb-client-pid"

	// outgoing hints
	HintSessionBalancer = "session-balancer"

	// incomming headers
	HeaderServerHints   = "x-ydb-server-hints"
	HeaderConsumedUnits = "x-ydb-consumed-units"

	// incoming hints
	HintSessionClose = "session-close"
)

Variables

This section is empty.

Functions

func CallTrailerCallback

func CallTrailerCallback(ctx context.Context, md metadata.MD)

func TraceID

func TraceID(ctx context.Context, opts ...func(opts *newTraceIDOpts)) (context.Context, string, error)

func WithAllowFeatures

func WithAllowFeatures(ctx context.Context, features ...string) context.Context

WithAllowFeatures returns a copy of parent context with allowed client feature

func WithApplicationName

func WithApplicationName(ctx context.Context, applicationName string) context.Context

WithApplicationName returns a copy of parent context with custom user-agent info

func WithRequestType

func WithRequestType(ctx context.Context, requestType string) context.Context

WithRequestType returns a copy of parent context with custom request type

func WithTraceID

func WithTraceID(ctx context.Context, traceID string) context.Context

WithTraceID returns a copy of parent context with traceID

func WithTrailerCallback

func WithTrailerCallback(ctx context.Context, callback MetadataCallback) context.Context

Types

type Meta

type Meta struct {
	// contains filtered or unexported fields
}

func New

func New(
	database string,
	credentials credentials.Credentials,
	trace *trace.Driver,
	opts ...Option,
) *Meta

func (*Meta) Context

func (m *Meta) Context(ctx context.Context) (_ context.Context, err error)

type MetadataCallback

type MetadataCallback func(md metadata.MD)

type Option

type Option func(m *Meta)

func AllowOption

func AllowOption(feature string) Option

func ForbidOption

func ForbidOption(feature string) Option

func WithApplicationNameOption

func WithApplicationNameOption(applicationName string) Option

func WithRequestTypeOption

func WithRequestTypeOption(requestType string) Option

Jump to

Keyboard shortcuts

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