Documentation
¶
Overview ¶
Package endpoints provides functionality for managing service endpoints and endpoint resolution in the Yandex Cloud Go SDK. It handles endpoint management, resolution, and connection pooling for various cloud services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct {
// Addr is endpoint address in host:port format.
Addr string
// DialOptions is Endpoint specific connect options.
// Typical options:
// * 'plaintext': grpc.WithTransportCredentials(insecure.NewCredentials())
// * 'insecure': grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ InsecureSkipVerify: true }))
DialOptions []grpc.DialOption
}
Endpoint represents a gRPC connection target with specific connection options.
type EndpointOption ¶
type EndpointOption interface {
DialOption() grpc.DialOption
}
EndpointOption is an interface that represents a configurable option for creating a gRPC endpoint connection.
func Keepalive ¶
func Keepalive(params keepalive.ClientParameters) EndpointOption
Keepalive configures client-side keepalive parameters for gRPC connections using the provided parameters.
type EndpointParams ¶
type EndpointParams struct {
Addr string
Options []EndpointOption
}
EndpointParams represents the parameters required to configure an endpoint, including its address and options.
func NewEndpointParams ¶
func NewEndpointParams(addr string, opts ...EndpointOption) *EndpointParams
NewEndpointParams creates a new EndpointParams instance with the specified address and optional EndpointOptions.
func (*EndpointParams) Append ¶
func (ep *EndpointParams) Append(opts ...EndpointOption) *EndpointParams
Append adds one or more EndpointOption instances to the Options slice and returns the updated EndpointParams.
func (*EndpointParams) Build ¶
func (ep *EndpointParams) Build() *Endpoint
Build constructs an Endpoint using the provided address and dial options from the EndpointParams configuration.
type EndpointsResolver ¶
type EndpointsResolver interface {
Endpoint(ctx context.Context, method protoreflect.FullName, opts ...grpc.CallOption) (*Endpoint, error)
}
EndpointsResolver defines an interface to resolve gRPC service endpoints dynamically based on method and options. The Endpoint method retrieves an endpoint instance, ensuring identical pointers for similar method requests. Endpoint instances are not cached by the caller and can be used for connection management and pooling.
func NewSingleEndpointResolver ¶
func NewSingleEndpointResolver(addr string, opts ...grpc.DialOption) EndpointsResolver
NewSingleEndpointResolver creates an EndpointsResolver that resolves to a single gRPC endpoint with specified options.
func NoEndpointsResolver ¶
func NoEndpointsResolver() EndpointsResolver
NoEndpointsResolver returns an EndpointsResolver that always fails to resolve endpoints with a not found error.
func SingleEndpointResolver ¶
func SingleEndpointResolver(e *Endpoint) EndpointsResolver
SingleEndpointResolver returns an EndpointsResolver that always resolves to the specified single Endpoint.
type PrefixEndpointsResolver ¶
type PrefixEndpointsResolver struct {
// contains filtered or unexported fields
}
func NewPrefixEndpointsResolver ¶
func NewPrefixEndpointsResolver(p2e PrefixToEndpoint) *PrefixEndpointsResolver
func (*PrefixEndpointsResolver) Endpoint ¶
func (r *PrefixEndpointsResolver) Endpoint(_ context.Context, method protoreflect.FullName, _ ...grpc.CallOption) (*Endpoint, error)
func (*PrefixEndpointsResolver) PrefixToEndpoint ¶
func (r *PrefixEndpointsResolver) PrefixToEndpoint() PrefixToEndpoint
type PrefixToEndpoint ¶
type PrefixToEndpoint map[protoreflect.FullName]*EndpointParams
PrefixToEndpoint maps a protobuf FullName prefix to its EndpointParams.
func (PrefixToEndpoint) Clone ¶
func (p2e PrefixToEndpoint) Clone() PrefixToEndpoint
Clone returns a shallow copy of the PrefixToEndpoint map.
func (PrefixToEndpoint) Get ¶
func (p2e PrefixToEndpoint) Get(p protoreflect.FullName) *EndpointParams
Get returns the EndpointParams for the longest matching prefix of p. It walks up the namespace hierarchy until it finds a match or returns nil.
func (PrefixToEndpoint) Merge ¶
func (p2e PrefixToEndpoint) Merge(src PrefixToEndpoint) PrefixToEndpoint
Merge returns a new PrefixToEndpoint containing: 1) All entries from the original map that are not overridden by src (including any parent overrides), 2) All entries from src (overriding or adding as needed).
type TransportCredentialEndpointOption ¶
type TransportCredentialEndpointOption interface {
EndpointOption
// contains filtered or unexported methods
}
TransportCredentialEndpointOption defines an interface for specifying transport-layer security options for an endpoint.
func Plaintext ¶
func Plaintext() TransportCredentialEndpointOption
func SkipTLSVerify ¶
func SkipTLSVerify() TransportCredentialEndpointOption
SkipTLSVerify returns a TransportCredentialEndpointOption that disables TLS certificate verification for secure connections.