clients

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromExtension added in v0.5.4

func FromExtension[T any](
	ctx context.Context,
	client managementv1.ManagementClient,
	serviceName string,
	constructor func(grpc.ClientConnInterface) T,
) (T, error)

func NewManagementClient added in v0.5.4

func NewManagementClient(ctx context.Context, opts ...ManagementClientOption) (managementv1.ManagementClient, error)

Types

type ConnStats added in v0.12.0

type ConnStats struct {
	Timestamp time.Time
	Raw       unix.TCPInfo
}

func (*ConnStats) DeliveryRate added in v0.12.0

func (c *ConnStats) DeliveryRate() uint64

Returns the socket throughput in bytes per second

func (*ConnStats) HumanizedBytesReceived added in v0.12.0

func (c *ConnStats) HumanizedBytesReceived() string

func (*ConnStats) HumanizedBytesSent added in v0.12.0

func (c *ConnStats) HumanizedBytesSent() string

func (*ConnStats) RTT added in v0.12.0

func (c *ConnStats) RTT() time.Duration

type ConnStatsQuerier added in v0.12.0

type ConnStatsQuerier interface {
	QueryConnStats() (ConnStats, error)
}

Experimental on darwin systems

type GatewayClient added in v0.5.4

type GatewayClient interface {
	grpc.ServiceRegistrar
	ConnStatsQuerier
	// credentials.PerRPCCredentials
	// Connect returns a ClientConnInterface connected to the streaming server.
	// The connection remains active until the provided context is canceled.
	Connect(context.Context) (grpc.ClientConnInterface, future.Future[error])
	RegisterSplicedStream(cc grpc.ClientConnInterface, name string)
	ClientConn() grpc.ClientConnInterface
}

func NewGatewayClient added in v0.5.4

func NewGatewayClient(
	ctx context.Context,
	address string,
	ip ident.Provider,
	kr keyring.Keyring,
	trustStrategy trust.Strategy,
) (GatewayClient, error)

type Locker added in v0.5.4

type Locker[T any] interface {
	// Use obtains exclusive ownership of the client, then calls the provided
	// function with the client. Ownership of the client is maintained until the
	// function returns.
	// It is safe to call Use if the Locker is nil; it will simply return false.
	Use(func(T)) bool
	// Close releases the client. After Close is called, Use() will return false.
	Close()
}

func NewLocker added in v0.5.4

func NewLocker[T any](cc grpc.ClientConnInterface, builder func(grpc.ClientConnInterface) T) Locker[T]

type ManagementClientOption added in v0.5.4

type ManagementClientOption func(*ManagementClientOptions)

func WithAddress added in v0.5.4

func WithAddress(addr string) ManagementClientOption

func WithDialOptions added in v0.5.4

func WithDialOptions(options ...grpc.DialOption) ManagementClientOption

type ManagementClientOptions added in v0.5.4

type ManagementClientOptions struct {
	// contains filtered or unexported fields
}

func (*ManagementClientOptions) Apply added in v0.5.4

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL