client

package
v1.18.6 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 27 Imported by: 97

Documentation

Index

Constants

View Source
const (
	AddressFamilyIPv6 = "ipv6"
	AddressFamilyIPv4 = "ipv4"
)

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 added in v0.15.7

func DefaultSockPath() string

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

func FormatStatusResponse added in v0.15.7

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 added in v0.15.7

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 FormatStatusResponseRemoteClusters added in v1.15.6

func FormatStatusResponseRemoteClusters(w io.Writer, clusters []*models.RemoteCluster, verbosity RemoteClustersStatusVerbosity)

func Hint added in v0.15.7

func Hint(err error) error

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

func NewRuntime added in v0.15.7

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

func NewTransport added in v1.16.0

func NewTransport(host string) (*http.Transport, error)

func NumReadyClusters added in v1.15.6

func NumReadyClusters(clusters []*models.RemoteCluster) int

func WithBasePath added in v1.15.0

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

func WithHost added in v1.15.0

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 added in v0.15.7

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.

func (*Client) ConfigGet

func (c *Client) ConfigGet() (*models.DaemonConfiguration, error)

ConfigGet returns a daemon configuration.

func (*Client)