Documentation
¶
Overview ¶
Package transport provides functionality for managing gRPC connections and communication in the Yandex Cloud Go SDK. It includes interfaces and implementations for connection management, endpoint resolution, and connection pooling.
The package contains the following subpackages:
- grpc: Implements gRPC-specific functionality including connection pooling and client management
- middleware: Provides interceptors and middleware components for extending gRPC functionality
Key components in the main package:
- Connector: Interface for retrieving gRPC client connections
- ConnectorImpl: Implementation of the Connector interface with connection pooling
- SingleConnector: Simplified connector for single endpoint scenarios
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface {
GetConnection(ctx context.Context, method protoreflect.FullName, opts ...grpc.CallOption) (grpc.ClientConnInterface, error)
}
Connector is an interface for retrieving gRPC client connections to specified methods with context and options.
type ConnectorImpl ¶
type ConnectorImpl struct {
// contains filtered or unexported fields
}
ConnectorImpl is an implementation of the Connector interface, managing gRPC connections using endpoints resolution and pooling.
func NewConnector ¶
func NewConnector(endpoints endpoints.EndpointsResolver, connectionPool *transportgrpc.ConnPool) *ConnectorImpl
NewConnector initializes and returns a ConnectorImpl instance with the provided endpoints resolver and connection pool.
func (*ConnectorImpl) GetConnection ¶
func (c *ConnectorImpl) GetConnection(ctx context.Context, method protoreflect.FullName, opts ...grpc.CallOption) (grpc.ClientConnInterface, error)
GetConnection retrieves a gRPC client connection for the given method, resolving the endpoint via the endpointsResolver.
type SingleConnector ¶
type SingleConnector struct {
// contains filtered or unexported fields
}
SingleConnector provides a gRPC connection handler using a single predefined endpoint resolver.
func NewSingleConnector ¶
func NewSingleConnector(add string, opts ...grpc.DialOption) *SingleConnector
NewSingleConnector creates a SingleConnector that utilizes a single gRPC endpoint with the specified address and options.
func (*SingleConnector) GetConnection ¶
func (s *SingleConnector) GetConnection(ctx context.Context, method protoreflect.FullName, opts ...grpc.CallOption) (grpc.ClientConnInterface, error)
GetConnection retrieves a gRPC client connection for the specified method and options, resolving the appropriate endpoint.