Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialContext ¶
func DialContext(ctx context.Context, rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error)
DialContext dials the Gitaly at the given address with the provided options. Valid address formats are 'unix:<socket path>' for Unix sockets, 'tcp://<host:port>' for insecure TCP connections and 'tls://<host:port>' for TCP+TLS connections.
The returned ClientConns are configured with tracing and correlation id interceptors to ensure they are propagated correctly. They're also configured to send Keepalives with settings matching what Gitaly expects.
connOpts should not contain `grpc.WithInsecure` as DialContext determines whether it is needed or not from the scheme. `grpc.TransportCredentials` should not be provided either as those are handled internally as well.
func WithGitalyDNSResolver ¶
func WithGitalyDNSResolver(opts *DNSResolverBuilderConfig) grpc.DialOption
WithGitalyDNSResolver defines a gRPC dial option for injecting Gitaly's custom DNS resolver. This resolver watches for the changes of target URL periodically and update the target subchannels accordingly.
Types ¶
type DNSResolverBuilderConfig ¶
type DNSResolverBuilderConfig dnsresolver.BuilderConfig
DNSResolverBuilderConfig exposes the DNS resolver builder option. It is used to build Gitaly custom DNS resolver.
func DefaultDNSResolverBuilderConfig ¶
func DefaultDNSResolverBuilderConfig() *DNSResolverBuilderConfig
DefaultDNSResolverBuilderConfig returns the default options for building DNS resolver.
type Dialer ¶
type Dialer func(ctx context.Context, address string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error)
Dialer is used by the Pool to create a *grpc.ClientConn.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a pool of GRPC connections. Connections created by it are safe for concurrent use.
func NewPoolWithOptions ¶
func NewPoolWithOptions(poolOptions ...PoolOption) *Pool
NewPoolWithOptions creates a new connection pool that's ready for use.
type PoolOption ¶
type PoolOption func(*poolOptions)
func WithDialOptions ¶
func WithDialOptions(dialOptions ...grpc.DialOption) PoolOption
WithDialOptions sets gRPC options to use for the gRPC Dial call.
func WithDialer ¶
func WithDialer(dialer Dialer) PoolOption
WithDialer sets the dialer that is called for each new gRPC connection the pool establishes.