package endpoint

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

Index

Functions

func ContextNodeID

func ContextNodeID(ctx context.Context) (nodeID uint32, ok bool)

func New

func New(address string, opts ...Option) *endpoint

func WithNodeID

func WithNodeID(ctx context.Context, nodeID uint32) context.Context

Types

type Endpoint

type Endpoint interface {
	Info

	String() string
	Copy() Endpoint
	Touch(opts ...Option)
}

type Info

type Info interface {
	NodeID
	Address() string
	Location() string
	LastUpdated() time.Time
	LoadFactor() float32
	OverrideHost() string

	// Deprecated: LocalDC check "local" by compare endpoint location with discovery "selflocation" field.
	// It work good only if connection url always point to local dc.
	// Will be removed after Oct 2024.
	// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
	LocalDC() bool
}

type NodeID

type NodeID interface {
	NodeID() uint32
}

type Option

type Option func(e *endpoint)

func WithID

func WithID(id uint32) Option

func WithIPV4

func WithIPV4(ipv4 []string) Option

func WithIPV6

func WithIPV6(ipv6 []string) Option

func WithLastUpdated

func WithLastUpdated(ts time.Time) Option

func WithLoadFactor

func WithLoadFactor(loadFactor float32) Option

func WithLocalDC

func WithLocalDC(local bool) Option

func WithLocation

func WithLocation(location string) Option

func WithServices

func WithServices(services []string) Option

func WithSslTargetNameOverride

func WithSslTargetNameOverride(nameOverride string) Option

Source Files

context.go endpoint.go

Version
v3.99.8
Published
Feb 12, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
5 minutes ago

Tools for package owners.