client

package
v1.6.22 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 24 Imported by: 73

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnonDialer added in v1.5.17

func AnonDialer(address string, timeout time.Duration) (net.Conn, error)

AnonDialer returns a dialer for a socket

NOTE: It is only used for testing.

func RemoveSocket added in v1.3.9

func RemoveSocket(address string) error

RemoveSocket removes the socket at the specified address if it exists on the filesystem

func WithLocal

func WithLocal(publisher events.Publisher) func(context.Context, shim.Config) (shimapi.ShimService, io.Closer, error)

WithLocal uses an in process shim

Types

type Client

type Client struct {
	shimapi.ShimService
	// contains filtered or unexported fields
}

Client is a shim client containing the connection to a shim

func New

func New(ctx context.Context, config shim.Config, opt Opt) (*Client, error)

New returns a new shim client

func (*Client) Close

func (c *Client) Close() error

Close the client connection

func (*Client) IsAlive

func (c *Client) IsAlive(ctx context.Context) (bool, error)

IsAlive returns true if the shim can be contacted. NOTE: a negative answer doesn't mean that the process is gone.

func (*Client) KillShim

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

KillShim kills the shim forcefully and wait for the process to disappear

func (*Client) StopShim

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

StopShim signals the shim to exit and wait for the process to disappear

type Opt

Opt is an option for a shim client configuration

func WithConnect

func WithConnect(address string, onClose func()) Opt

WithConnect connects to an existing shim

func WithStart

func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHandler func()) Opt

WithStart executes a new shim process

Jump to

Keyboard shortcuts

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