client

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// DontConnect is used to mark a socket to not be connected.
	DontConnect = "-"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Connect tries to connect the client to the specified image and runtime services.
	Connect(ConnectOptions) error
	// Close closes any existing client connections.
	Close()
	// CheckConnection checks if we have (un-Close()'d as opposed to working) connections.
	CheckConnection(ConnectOptions) error
	// HasRuntimeService checks if the client is configured with runtime services.
	HasRuntimeService() bool

	// We expose full image and runtime client services.
	criv1.ImageServiceClient
	criv1.RuntimeServiceClient
}

Client is the interface we expose to our CRI client.

func NewClient

func NewClient(options Options) (Client, error)

NewClient creates a new client instance.

type ConnectOptions

type ConnectOptions struct {
	// Wait indicates whether Connect() should wait (indefinitely) for the server.
	Wait bool
	// Reconnect indicates whether CheckConnection() should attempt to Connect().
	Reconnect bool
}

ConnectOptions contains options for connecting to the server.

type DialNotifyFn

type DialNotifyFn func(string, int, int, os.FileMode, error)

DialNotifyFn is a function to call after a successful net.Dial[Timeout]().

type Options

type Options struct {
	// ImageSocket is the socket path for the CRI image service.
	ImageSocket string
	// RuntimeSocket is the socket path for the CRI runtime service.
	RuntimeSocket string
	// DialNotify is an optional function to notify after net.Dial returns for a socket.
	DialNotify DialNotifyFn
}

Options contains the configurable options of our CRI client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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