client

package
v0.0.0-...-9a5b211 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, cfg Config) (client *Client, err error)

func (*Client) Close

func (c *Client) Close() error

Close closes the Client connection to the auth server.

func (*Client) GetConnection

func (c *Client) GetConnection() *grpc.ClientConn

GetConnection returns GRPC connection.

type Config

type Config struct {
	HostPort          string
	AuthToken         string
	ConnectionOptions ConnectionOptions
}

func (*Config) CheckAndSetDefaults

func (c *Config) CheckAndSetDefaults() error

type ConnectionOptions

type ConnectionOptions struct {
	// Optional: To set the host:port for this client to connect to.
	TLSConfig *tls.Config

	DialOptions []grpc.DialOption

	DialTimeout time.Duration

	// Enables keep alive ping from client to the server, which can help detect abruptly closed connections faster.
	EnableKeepAliveCheck bool

	// After a duration of this time if the client doesn't see any activity it
	// pings the server to see if the transport is still alive.
	// If set below 10s, a minimum value of 10s will be used instead.
	KeepAliveTime time.Duration

	// After having pinged for keepalive check, the client waits for a duration
	// of Timeout and if no activity is seen even after that the connection is
	// closed.
	KeepAliveTimeout time.Duration

	// If true, client sends keepalive pings even with no active RPCs. If false,
	// when there are no active RPCs, Time and Timeout will be ignored and no
	// keepalive pings will be sent.
	KeepAlivePermitWithoutStream bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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