package meta

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/meta"

Index

Constants

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"
	HeaderUserAgent          = "x-ydb-user-agent"
	HeaderClientCapabilities = "x-ydb-client-capabilities"

	// outgoing hints
	HintSessionBalancer = "session-balancer"

	// incomming headers
	HeaderServerHints = "x-ydb-server-hints"

	// incoming hints
	HintSessionClose = "session-close"
)
const (
	VersionMajor = "3"
	VersionMinor = "35"
	VersionPatch = "0"
)
const Version = VersionMajor + "." + VersionMinor + "." + VersionPatch

Functions

func WithAllowFeatures

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

WithAllowFeatures returns a copy of parent context with allowed client feature

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 WithUserAgent

func WithUserAgent(ctx context.Context, userAgent string) context.Context

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

Types

type Meta

type Meta interface {
	Context(ctx context.Context) (context.Context, error)
}

func New

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

type Option

type Option func(m *meta)

func AllowOption

func AllowOption(feature string) Option

func ForbidOption

func ForbidOption(feature string) Option

func WithRequestTypeOption

func WithRequestTypeOption(requestType string) Option

func WithUserAgentOption

func WithUserAgentOption(userAgent string) Option

Source Files

context.go meta.go version.go

Directories

PathSynopsis
internal/meta/test
Version
v3.35.0
Published
Aug 19, 2022
Platform
js/wasm
Imports
6 packages
Last checked
2 minutes ago

Tools for package owners.