cli

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package cli provides the BindPlane command line client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrerunsToExistingCmd added in v1.17.0

func AddPrerunsToExistingCmd(cmd *cobra.Command, loader Loader, prerunAdders ...PreRunAdder) *cobra.Command

AddPrerunsToExistingCmd adds preruns to an existing command in the order they are given

Types

type Factory

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

Factory is used to build and load resources for the CLI.

func NewFactory

func NewFactory(routeBuilder server.RouteBuilder) *Factory

NewFactory creates a new factory.

func (*Factory) BuildApplier

func (f *Factory) BuildApplier(ctx context.Context) (apply.Applier, error)

BuildApplier builds an applier.

func (*Factory) BuildClient

func (f *Factory) BuildClient(ctx context.Context) (client.BindPlane, error)

BuildClient builds a client.

func (*Factory) BuildCopier

func (f *Factory) BuildCopier(ctx context.Context) (copy.Copier, error)

BuildCopier builds a copier.

func (*Factory) BuildDeleter

func (f *Factory) BuildDeleter(ctx context.Context) (delete.Deleter, error)

BuildDeleter builds a deleter.

func (*Factory) BuildGetter

func (f *Factory) BuildGetter(ctx context.Context) (get.Getter, error)

BuildGetter builds a getter.

func (*Factory) BuildInitializer

func (f *Factory) BuildInitializer(ctx context.Context) (initialize.Initializer, error)

BuildInitializer builds an initializer.

func (*Factory) BuildInstaller

func (f *Factory) BuildInstaller(ctx context.Context) (install.Installer, error)

BuildInstaller builds an installer.

func (*Factory) BuildLabeler

func (f *Factory) BuildLabeler(ctx context.Context) (label.Labeler, error)

BuildLabeler builds a labeler.

func (*Factory) BuildLogger

func (f *Factory) BuildLogger(_ context.Context) (*zap.Logger, error)

BuildLogger builds a logger, if it doesn't already exist.

func (*Factory) BuildMetricsProvider added in v1.25.0

func (f *Factory) BuildMetricsProvider(_ context.Context) (metrics.Provider, error)

BuildMetricsProvider builds the meter provider for the server

func (*Factory) BuildPrinter

func (f *Factory) BuildPrinter(ctx context.Context) (printer.Printer, error)

BuildPrinter builds a printer.

func (*Factory) BuildProfiler

func (f *Factory) BuildProfiler(_ context.Context) (profile.Profiler, error)

BuildProfiler builds a profiler.

func (*Factory) BuildRollouter

func (f *Factory) BuildRollouter(ctx context.Context) (rollout.Rollouter, error)

BuildRollouter builds a rollouter.

func (*Factory) BuildServer

func (f *Factory) BuildServer(ctx context.Context) (serve.Server, error)

BuildServer builds a server.

func (*Factory) BuildStore

func (f *Factory) BuildStore(ctx context.Context) (store.Store, error)

BuildStore builds the store for the server

func (*Factory) BuildSyncer

func (f *Factory) BuildSyncer(ctx context.Context) (sync.Syncer, error)

BuildSyncer builds a syncer.

func (*Factory) BuildTracer

func (f *Factory) BuildTracer(_ context.Context) (tracer.Tracer, error)

BuildTracer builds the tracer for the server

func (*Factory) BuildUpdater

func (f *Factory) BuildUpdater(ctx context.Context) (update.Updater, error)

BuildUpdater builds an updater.

func (*Factory) BuildVersioner

func (f *Factory) BuildVersioner(ctx context.Context) (version.Versioner, error)

BuildVersioner builds a versioner.

func (*Factory) LoadConfig

func (f *Factory) LoadConfig(_ context.Context, path string) error

LoadConfig loads the configuration from the given path.

func (*Factory) LoadCurrentProfile

func (f *Factory) LoadCurrentProfile(ctx context.Context) error

LoadCurrentProfile loads the current profile.

func (*Factory) LoadEmptyConfig

func (f *Factory) LoadEmptyConfig(_ context.Context) error

LoadEmptyConfig loads an empty configuration set to the default profile

func (*Factory) LoadProfile

func (f *Factory) LoadProfile(ctx context.Context, name string) error

LoadProfile loads the BindPlane profile from the given path.

func (*Factory) SupportsServer added in v1.21.0

func (f *Factory) SupportsServer() bool

SupportsServer returns true if the OS is not windows.

func (*Factory) ValidateConfig

func (f *Factory) ValidateConfig(_ context.Context) error

ValidateConfig validates the configuration.

type Loader

type Loader interface {
	// LoadConfig loads the configuration from the given path
	LoadConfig(ctx context.Context, path string) error

	// LoadProfile loads the profile with the given name
	LoadProfile(ctx context.Context, name string) error

	// ValidateConfig validates the configuration.
	ValidateConfig(ctx context.Context) error
}

Loader is an interface for loading the BindPlane configuration

type PreRun added in v1.17.0

type PreRun func(cmd *cobra.Command, args []string) error

PreRun is a function that runs before the command

func AddLoadConfigPrerun

func AddLoadConfigPrerun(cmd *cobra.Command, loader Loader) PreRun

AddLoadConfigPrerun adds the load config pre run to the command

func AddValidationPrerun

func AddValidationPrerun(_ *cobra.Command, loader Loader) PreRun

AddValidationPrerun adds the validation pre run to the command

func CombinePreruns added in v1.17.0

func CombinePreruns(oldPreRun PreRun, newPreRuns []PreRun) PreRun

CombinePreruns combines preruns into a single prerun

type PreRunAdder added in v1.17.0

type PreRunAdder func(cmd *cobra.Command, loader Loader) PreRun

PreRunAdder is a function that adds a pre run to a command

Directories

Path Synopsis
commands
apply
Package apply provides the apply command, which upserts resources from a file to the store.
Package apply provides the apply command, which upserts resources from a file to the store.
copy
Package copy provides the copy command.
Package copy provides the copy command.
delete
Package delete provides the delete command, as well as subcommands for deleting specific resources and resource types.
Package delete provides the delete command, as well as subcommands for deleting specific resources and resource types.
get
Package get provides the get command, which displays one or more resources, as well as subcommands for each resource type.
Package get provides the get command, which displays one or more resources, as well as subcommands for each resource type.
initialize
Package initialize provides the initialize command, which initializes an installation.
Package initialize provides the initialize command, which initializes an installation.
initialize/question
Package question is used to create questions for the initialize command.
Package question is used to create questions for the initialize command.
install
Package install provides the install command, which installs a new agent.
Package install provides the install command, which installs a new agent.
label
Package label contains the label command.
Package label contains the label command.
profile
Package profile provides commands for managing BindPlane profile configurations.
Package profile provides commands for managing BindPlane profile configurations.
rollout
Package rollout contains the rollout commands for the BindPlane CLI.
Package rollout contains the rollout commands for the BindPlane CLI.
root
Package root provides the root command
Package root provides the root command
serve
Package serve provides the `serve` command for the CLI.
Package serve provides the `serve` command for the CLI.
sync
Package sync provides the sync command, which synchronizes an agent-version from github with the store.
Package sync provides the sync command, which synchronizes an agent-version from github with the store.
update
Package update contains the update command, which upgrades a specific agent
Package update contains the update command, which upgrades a specific agent
version
Package version provides the version command, which prints the BindPlane version.
Package version provides the version command, which prints the BindPlane version.
Package helpers contains helper functions for the CLI
Package helpers contains helper functions for the CLI
Package printer provides an interface for printing resources, and several implementations.
Package printer provides an interface for printing resources, and several implementations.

Jump to

Keyboard shortcuts

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