Documentation ¶
Index ¶
- Variables
- func Dial(rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error)
- func DialContext(ctx context.Context, rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error)
- func FailOnNonTempDialError() []grpc.DialOption
- func ReceivePack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, ...) (int32, error)
- func UploadArchive(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, ...) (int32, error)
- func UploadPack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, ...) (int32, error)
- type Dialer
- type Pool
- type PoolOption
Constants ¶
This section is empty.
Variables ¶
var DefaultDialOpts = []grpc.DialOption{}
DefaultDialOpts hold the default DialOptions for connection to Gitaly over UNIX-socket
Functions ¶
func Dial ¶
func Dial(rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error)
Dial calls DialContext with the provided arguments and context.Background. Refer to DialContext's documentation for details.
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 FailOnNonTempDialError ¶
func FailOnNonTempDialError() []grpc.DialOption
FailOnNonTempDialError helps to identify if remote listener is ready to accept new connections.
func ReceivePack ¶
func ReceivePack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, stdout, stderr io.Writer, req *gitalypb.SSHReceivePackRequest) (int32, error)
ReceivePack proxies an SSH git-receive-pack (git push) session to Gitaly
func UploadArchive ¶
func UploadArchive(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, stdout, stderr io.Writer, req *gitalypb.SSHUploadArchiveRequest) (int32, error)
UploadArchive proxies an SSH git-upload-archive (git archive --remote) session to Gitaly
func UploadPack ¶
func UploadPack(ctx context.Context, conn *grpc.ClientConn, stdin io.Reader, stdout, stderr io.Writer, req *gitalypb.SSHUploadPackRequest) (int32, error)
UploadPack proxies an SSH git-upload-pack (git fetch) session to Gitaly
Types ¶
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.
func HealthCheckDialer ¶
HealthCheckDialer uses provided dialer as an actual dialer, but issues a health check request to the remote to verify the connection was set properly and could be used with no issues.
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 NewPool ¶
func NewPool(dialOptions ...grpc.DialOption) *Pool
NewPool creates a new connection pool that's ready for 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.