local

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDocker = errors.New("error communicating with docker")

ErrDocker is returned anytime an error specific to docker occurs.

Functions

This section is empty.

Types

type BrowserLauncher

type BrowserLauncher func(url string) error

BrowserLauncher for

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command is the local command, responsible for installing, uninstalling, or other local actions.

func New

func New(opts ...Option) (*Command, error)

New creates a new Command TODO: this method does too much

func (*Command) Install

func (c *Command) Install(ctx context.Context, user, pass string) error

Install handles the installation of Airbyte

func (*Command) Uninstall

func (c *Command) Uninstall(ctx context.Context) error

Uninstall handles the uninstallation of Airbyte.

type DockerClient

type DockerClient interface {
	ServerVersion(context.Context) (types.Version, error)
}

DockerClient primarily for testing purposes

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type HelmClient

type HelmClient interface {
	AddOrUpdateChartRepo(entry repo.Entry) error
	GetChart(string, *action.ChartPathOptions) (*chart.Chart, string, error)
	GetRelease(name string) (*release.Release, error)
	InstallOrUpgradeChart(ctx context.Context, spec *helmclient.ChartSpec, opts *helmclient.GenericHelmOptions) (*release.Release, error)
	UninstallReleaseByName(string) error
}

HelmClient primarily for testing purposes

type K8sClient

type K8sClient interface {
	// CreateIngress creates an ingress in the given namespace
	CreateIngress(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
	// ExistsIngress returns true if the ingress exists in the namespace, false otherwise.
	ExistsIngress(ctx context.Context, namespace string, ingress string) bool
	// UpdateIngress updates an existing ingress in the given namespace
	UpdateIngress(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error

	// ExistsNamespace returns true if the namespace exists, false otherwise
	ExistsNamespace(ctx context.Context, namespace string) bool
	// DeleteNamespace deletes the existing namespace
	DeleteNamespace(ctx context.Context, namespace string) error

	// CreateOrUpdateSecret will update or create the secret name with the payload of data in the specified namespace
	CreateOrUpdateSecret(ctx context.Context, namespace, name string, data map[string][]byte) error

	// GetServerVersion returns the k8s version.
	GetServerVersion() (string, error)
}

K8sClient primarily for testing purposes

type Option

type Option func(*Command)

Option for configuring the Command, primarily exists for testing

func WithBrowserLauncher

func WithBrowserLauncher(launcher BrowserLauncher) Option

WithBrowserLauncher define the browser launcher for this command.

func WithDockerClient

func WithDockerClient(client DockerClient) Option

WithDockerClient define the docker client for this command.

func WithHTTPClient

func WithHTTPClient(client HTTPClient) Option

WithHTTPClient define the http client for this command.

func WithHelmClient

func WithHelmClient(client HelmClient) Option

WithHelmClient define the helm client for this command.

func WithK8sClient

func WithK8sClient(client K8sClient) Option

WithK8sClient define the k8s client for this command.

func WithTelemetryClient

func WithTelemetryClient(client telemetry.Client) Option

WithTelemetryClient define the telemetry client for this command.

Jump to

Keyboard shortcuts

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