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: 0

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