clients

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package clients contains the interface for using plugin clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInProcessClient

func NewInProcessClient(plugin v1.PluginServer) *inProcessPlugin

NewInProcessClient creates a plugin client from a built-in plugin server.

Types

type ExternalServerConfig

type ExternalServerConfig struct {
	// Server is the address of a server for the plugin.
	Server string `yaml:"server,omitempty" json:"server,omitempty" toml:"server,omitempty"`
	// Insecure is whether to use an insecure connection to the plugin server.
	Insecure bool `yaml:"insecure,omitempty" json:"insecure,omitempty" toml:"insecure,omitempty"`
	// TLSCAFile is the path to a CA for verifying certificates.
	TLSCAFile string `yaml:"tls-ca-file,omitempty" json:"tls-ca-file,omitempty" toml:"tls-ca-file,omitempty"`
	// TLSCertFile is the path to a certificate for authenticating to the plugin server.
	TLSCertFile string `yaml:"tls-cert-file,omitempty" json:"tls-cert-file,omitempty" toml:"tls-cert-file,omitempty"`
	// TLSKeyFile is the path to a key for authenticating to the plugin server.
	TLSKeyFile string `yaml:"tls-key-file,omitempty" json:"tls-key-file,omitempty" toml:"tls-key-file,omitempty"`
	// TLSSkipVerify is whether to skip verifying the plugin server's certificate.
	TLSSkipVerify bool `yaml:"tls-skip-verify,omitempty" json:"tls-skip-verify,omitempty" toml:"tls-skip-verify,omitempty"`
}

ExternalServerConfig is the configuration for an external plugin server.

type PluginClient

type PluginClient interface {
	v1.PluginClient

	// Storage returns a storage client.
	Storage() v1.StorageQuerierPluginClient
	// Auth returns an auth client.
	Auth() v1.AuthPluginClient
	// Events returns an events client.
	Events() v1.WatchPluginClient
	// IPAM returns an IPAM client.
	IPAM() v1.IPAMPluginClient
}

PluginClient is an extension of the interface for a plugin client. It provides methods for converting the client into other plugin clients.

func NewExternalProcessClient

func NewExternalProcessClient(ctx context.Context, path string) (PluginClient, error)

NewExternalProcessClient creates a new plugin client for an external plugin process.

func NewExternalServerClient

func NewExternalServerClient(ctx context.Context, cfg *ExternalServerConfig) (PluginClient, error)

NewExternalServerClient creates a new plugin client for an external plugin server.

Jump to

Keyboard shortcuts

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