cmd

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 19 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
client
Package client implements client flags for chronoctl CLI commands and gives commands access to client objects that can be used to make API calls.
Package client implements client flags for chronoctl CLI commands and gives commands access to client objects that can be used to make API calls.
dry
Package dry implements the dry run flag for chronoctl commands.
Package dry implements the dry run flag for chronoctl commands.
file
package file contains commands related to file operations.
package file contains commands related to file operations.
groups
Groups is a package for shared CLI groups.
Groups is a package for shared CLI groups.
output
Package output provides functionality to write output in different formats.
Package output provides functionality to write output in different formats.
parsing
Package parsing contains methods for parsing strings into various types.
Package parsing contains methods for parsing strings into various types.
ptr
Package ptr contains functions to create references from constant values, typically for representing optional values.
Package ptr contains functions to create references from constant values, typically for representing optional values.
ruleevaluations
Package ruleevaluations contains all commands related to rule evaluations
Package ruleevaluations contains all commands related to rule evaluations
shorthand
shorthand package contains the interfaces used by chronogen create shorthand support.
shorthand package contains the interfaces used by chronogen create shorthand support.
sliceutil
Package sliceutil contains utility functions for working with slices.
Package sliceutil contains utility functions for working with slices.
timesutil
Package timesutil provides utilities for parsing and validating RFC3339 timestamps
Package timesutil provides utilities for parsing and validating RFC3339 timestamps
transport
Package transport provides methods to create an HTTP transport that can communicate with the Chronosphere API.
Package transport provides methods to create an HTTP transport that can communicate with the Chronosphere API.
unstable
Package unstable implements the unstable cobra command
Package unstable implements the unstable cobra command

Jump to

Keyboard shortcuts

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