endpoint

package
v3.95.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextNodeID added in v3.74.3

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

func New

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

func WithNodeID added in v3.74.3

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 added in v3.16.10

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 added in v3.74.3

type NodeID interface {
	NodeID() uint32
}

type Option added in v3.25.0

type Option func(e *endpoint)

func WithID

func WithID(id uint32) Option

func WithIPV4 added in v3.81.1

func WithIPV4(ipv4 []string) Option

func WithIPV6 added in v3.81.1

func WithIPV6(ipv6 []string) Option

func WithLastUpdated added in v3.11.8

func WithLastUpdated(ts time.Time) Option

func WithLoadFactor

func WithLoadFactor(loadFactor float32) Option

func WithLocalDC

func WithLocalDC(local bool) Option

func WithLocation added in v3.6.2

func WithLocation(location string) Option

func WithServices added in v3.10.0

func WithServices(services []string) Option

func WithSslTargetNameOverride added in v3.81.1

func WithSslTargetNameOverride(nameOverride string) Option

Jump to

Keyboard shortcuts

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