rpcclient

package
v0.30.310 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 18 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

Client provides and manages v1 client session.

func New

func New(cfg *Config, ignoreAccessTokenError bool) (*Client, error)

New creates a new client from a given configuration.

func NewFromURL

func NewFromURL(url string, ignoreAccessTokenError bool) (*Client, error)

NewFromURL creates a new client from a URL.

func (*Client) Close

func (c *Client) Close() error

Close shuts down the client's connections.

func (*Client) Conn

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

Conn returns the current in-use connection

func (*Client) Opts

func (c *Client) Opts() []grpc.CallOption

Opts returns the current Call options

type Config

type Config struct {
	// Endpoint of the server
	Endpoint string

	// DialTimeout is the timeout for failing to establish a connection.
	DialTimeout time.Duration

	// DialKeepAliveTime is the time after which client pings the server to see if
	// transport is alive.
	DialKeepAliveTime time.Duration

	// DialKeepAliveTimeout is the time that the client waits for a response for the
	// keep-alive probe. If the response is not received in this time, the connection is closed.
	DialKeepAliveTimeout time.Duration

	// TLS holds the client secure credentials, if any.
	TLS *tls.Config

	// DialOptions is a list of dial options for the grpc client (e.g., for interceptors).
	// For example, pass "grpc.WithBlock()" to block until the underlying connection is up.
	// Without this, Dial returns immediately and connecting the server happens in background.
	DialOptions []grpc.DialOption

	// Context is the default client context; it can be used to cancel grpc dial out and
	// other operations that do not have an explicit context.
	Context context.Context

	StorageFolder    string
	EnvAuthTokenName string
	UserAgent        string

	CallerIdentity credentials.CallerIdentity
}

Config for the client

func (*Config) LoadAuthToken

func (c *Config) LoadAuthToken() (*retriable.AuthToken, string, error)

LoadAuthToken returns AuthToken

func (*Config) Storage

func (c *Config) Storage() *retriable.Storage

Storage returns the current storage

Jump to

Keyboard shortcuts

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