Documentation ¶
Index ¶
- func ComposeCredentials(ctx context.Context, certPath string, keyPath string, caCertPath string) (credentials.TransportCredentials, error)
- func Credentials(_ context.Context, clientCert []byte, clientKey []byte, caCert []byte) (credentials.TransportCredentials, error)
- func Open(ctx context.Context, params ...Parameter) (e2wtypes.Wallet, error)
- func OpenWallet(_ context.Context, name string, credentials credentials.TransportCredentials, ...) (e2wtypes.Wallet, error)
- type ConnectionProvider
- type Endpoint
- type Metrics
- type Parameter
- func WithConnectionProviderName(name string) Parameter
- func WithCredentials(credentials credentials.TransportCredentials) Parameter
- func WithEndpoints(endpoints []*Endpoint) Parameter
- func WithMonitor(monitor Metrics) Parameter
- func WithName(name string) Parameter
- func WithPoolConnections(connections int32) Parameter
- func WithTimeout(timeout time.Duration) Parameter
- type PuddleConnectionProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeCredentials ¶
func ComposeCredentials(ctx context.Context, certPath string, keyPath string, caCertPath string) (credentials.TransportCredentials, error)
ComposeCredentials composes a set of transport credentials given individual certificate and key paths. The CA certificate path can be empty.
func Credentials ¶
func Credentials(_ context.Context, clientCert []byte, clientKey []byte, caCert []byte) (credentials.TransportCredentials, error)
Credentials composes a set of transport credentials given a client certificate and an optional CA certificate.
func OpenWallet ¶
func OpenWallet(_ context.Context, name string, credentials credentials.TransportCredentials, endpoints []*Endpoint) (e2wtypes.Wallet, error)
OpenWallet opens an existing wallet with the given name. Deprecated; use Open() instead.
Types ¶
type ConnectionProvider ¶
type ConnectionProvider interface { // Connection returns a connection and release function. Connection(ctx context.Context, endpoint *Endpoint) (*grpc.ClientConn, func(), error) Close(endpoints []*Endpoint) }
ConnectionProvider is an interface that provides GRPC connections.
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint specifies a host/port tuple.
func NewEndpoint ¶
NewEndpoint creates a new endpoint.
type Metrics ¶
type Metrics interface { // Presenter returns the presenter for the metrics. Presenter() string }
Metrics is an interface to a metrics provider.
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithConnectionProviderName ¶
WithConnectionProviderName sets the name for the connection provider. This is used to distinguish between different connection providers.
func WithCredentials ¶
func WithCredentials(credentials credentials.TransportCredentials) Parameter
WithCredentials sets the transport credentials for the wallet.
func WithEndpoints ¶
WithEndpoints sets the endpoints for the wallet.
func WithMonitor ¶
WithMonitor sets the monitor for the wallet.
func WithPoolConnections ¶
WithPoolConnections sets the number of connections for the wallet connection pool.
func WithTimeout ¶
WithTimeout sets the timeout for wallet requests.
type PuddleConnectionProvider ¶
type PuddleConnectionProvider struct {
// contains filtered or unexported fields
}
PuddleConnectionProvider provides connections using the Puddle connection pooler.
func (*PuddleConnectionProvider) Close ¶
func (c *PuddleConnectionProvider) Close(endpoints []*Endpoint)
Close closes connections to the given endpoints and specific connection provider.
func (*PuddleConnectionProvider) Connection ¶
func (c *PuddleConnectionProvider) Connection(ctx context.Context, endpoint *Endpoint) (*grpc.ClientConn, func(), error)
Connection returns a connection and release function.