client

package
v0.0.0-...-9514e8a Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StatusAllDetails causes no additional status details to be printed by
	// FormatStatusResponse.
	StatusNoDetails = StatusDetails{}
	// StatusAllDetails causes all status details to be printed by FormatStatusResponse.
	StatusAllDetails = StatusDetails{
		AllAddresses:                true,
		AllControllers:              true,
		AllNodes:                    true,
		AllRedirects:                true,
		AllClusters:                 true,
		BPFMapDetails:               true,
		KubeProxyReplacementDetails: true,
		ClockSourceDetails:          true,
	}
)

Functions

func DefaultSockPath

func DefaultSockPath() string

DefaultSockPath returns default UNIX domain socket path or path set using CILIUM_SOCK env variable

func FormatStatusResponse

func FormatStatusResponse(w io.Writer, sr *models.StatusResponse, sd StatusDetails)

FormatStatusResponse writes a StatusResponse as a string to the writer. The bit mask sd controls whether a additional details are printed about a certain aspect of the status. In case there are errors, some details may be printed regardless of the value of sd.

func FormatStatusResponseBrief

func FormatStatusResponseBrief(w io.Writer, sr *models.StatusResponse)

FormatStatusResponseBrief writes a one-line status to the writer. If everything ok, this is "ok", otherwise a message of the form "error in ..."

func Hint

func Hint(err error) error

Hint tries to improve the error message displayed to the user.

func NewRuntime

func NewRuntime(opts ...func(options *runtimeOptions)) (*runtime_client.Runtime, error)

func WithBasePath

func WithBasePath(basePath string) func(options *runtimeOptions)

func WithHost

func WithHost(host string) func(options *runtimeOptions)

Types

type Client

type Client struct {
	clientapi.CiliumAPI
}

func NewClient

func NewClient(host string) (*Client, error)

NewClient creates a client for the given `host`. If host is nil then use SockPath provided by CILIUM_SOCK or the cilium default SockPath

func NewDefaultClient

func NewDefaultClient() (*Client, error)

NewDefaultClient creates a client with default parameters connecting to UNIX domain socket.

func NewDefaultClientWithTimeout

func NewDefaultClientWithTimeout(timeout time.Duration) (*Client, error)

NewDefaultClientWithTimeout creates a client with default parameters connecting to UNIX domain socket and waits for cilium-agent availability.

type StatusDetails

type StatusDetails struct {
	// AllAddress causes all addresses to be printed by FormatStatusResponse.
	AllAddresses bool
	// AllControllers causes all controllers to be printed by FormatStatusResponse.
	AllControllers bool
	// AllNodes causes all nodes to be printed by FormatStatusResponse.
	AllNodes bool
	// AllRedirects causes all redirects to be printed by FormatStatusResponse.
	AllRedirects bool
	// AllClusters causes all clusters to be printed by FormatStatusResponse.
	AllClusters bool
	// BPFMapDetails causes BPF map details to be printed by FormatStatusResponse.
	BPFMapDetails bool
	// KubeProxyReplacementDetails causes BPF kube-proxy details to be printed by FormatStatusResponse.
	KubeProxyReplacementDetails bool
	// ClockSourceDetails causes BPF time-keeping internals to be printed by FormatStatusResponse.
	ClockSourceDetails bool
}

Jump to

Keyboard shortcuts

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