cmd

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoApplyMapping = errors.New("no apply mapping found")

ErrNoApplyMapping allows an Applier to indicate that no mapping was found for the given object.

Functions

func DefaultApplier

func DefaultApplier(o *ApplyCommand, obj types.Object, out, err io.Writer) error

DefaultApplier applies configv1 and configunstable resources.

func New

func New(options Options) (*cobra.Command, error)

New returns a new chronoctl command.

func NewApplyCommand

func NewApplyCommand(options ApplyOptions) *cobra.Command

NewApplyCommand returns a new cobra command for apply.

Types

type Applier

type Applier func(o *ApplyCommand, obj types.Object, stdout io.Writer, stderr io.Writer) error

Applier represents a function that can apply an object. May return ErrNoApplyMapping.

type ApplyCommand

type ApplyCommand struct {
	ClientFlags *client.Flags

	UnstableClient config_unstable.ClientService
	ConfigV1Client config_v1.ClientService

	FileFlags *file.Flags
	File      io.ReadCloser

	DryRunFlags     *dry.Flags
	StrictModeFlags *StrictModeFlags

	Applier Applier
}

ApplyCommand is a command that allows an object to be upserted.

func NewApply

func NewApply(options ApplyOptions) *ApplyCommand

NewApply returns a new ApplyCommand

func (*ApplyCommand) Run

func (o *ApplyCommand) Run(stdout io.Writer, stderr io.Writer) error

Run runs the apply command.

type ApplyOptions

type ApplyOptions struct {
	Applier         Applier
	AdditionalFlags Flagger
}

ApplyOptions contains all options for the apply command.

type Flagger

type Flagger interface {
	AddFlags(cmd *cobra.Command)
}

Flagger is a interface for adding a flag to a cobra command.

type Options

type Options struct {
	ApplyOptions ApplyOptions
}

Options contain all the options for creating a new chronoctl command.

type StrictModeFlags

type StrictModeFlags struct {
	PermissiveParsing bool
}

StrictModeFlags indicated whether or not to allow permissive parsing.

func NewStrictModeFlags

func NewStrictModeFlags() *StrictModeFlags

NewStrictModeFlags returns a new StrictModeFlags set.

func (*StrictModeFlags) AddFlags

func (c *StrictModeFlags) AddFlags(cmd *cobra.Command)

AddFlags registers the strict mode vars onto a command.

Directories

Path Synopsis
package main
package main
Package cli provides utilities for use in the chronoctl CLI
Package cli provides utilities for use in the chronoctl CLI
pkg

Jump to

Keyboard shortcuts

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