client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 15 Imported by: ? modules, 0 packages

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

View Source
const (
	DefaultConnectTimeout = 5 * time.Second
)

Variables

View Source
var (
	ErrRetryTimeoutExceeded = errors.New("retry timeout exceeded")
)

Functions

func RetryWithBackoff

func RetryWithBackoff(ctx context.Context, timeout time.Duration, fn func() error) error

Types

type CheckStatusResponse

type CheckStatusResponse struct {
	Status        api.Status
	FailureReason string
}

type Client

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

func New

func New(target string, opts ...Option) (*Client, error)

func (*Client) CheckStatus

func (c *Client) CheckStatus(ctx context.Context) (CheckStatusResponse, error)

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

func (*Client) ConnectWithTimeout

func (c *Client) ConnectWithTimeout(ctx context.Context, timeout time.Duration) error

func (*Client) InitForcefulShutdown

func (c *Client) InitForcefulShutdown(ctx context.Context) (CheckStatusResponse, error)

func (*Client) InitGracefulShutdown

func (c *Client) InitGracefulShutdown(ctx context.Context, req api.InitGracefulShutdownRequest) (CheckStatusResponse, error)

type Dialer

type Dialer func(network string, address string) (net.Conn, error)

type Option

type Option func(o *options)

func WithDialer

func WithDialer(dialer Dialer) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

Jump to

Keyboard shortcuts

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