client

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 2 modules, 5 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 (
	// 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