shorthand

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

shorthand package contains the interfaces used by chronogen create shorthand support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator[T any] interface {
	// AddFlags registers the flags on the command. Note that we cannot
	// set any of the shorthand commands to be required, as we want
	// to allow `-f` usage.
	AddFlags(*cobra.Command)
	// GenerateSpec parses the flag inputs and returns a spec to create the object.
	GenerateSpec() (T, error)
	// IsEmpty determines if the feature flags have been used.
	// If they aren't, then we go ahead and use the file input.
	IsEmpty() bool
}

Creator is the interface for creating entities using CLI flags. All custom logic for parsing flags must go into CreateObject.

func NewMutingRule

func NewMutingRule() Creator[*models.Configv1MutingRule]

NewMutingRule returns a new shorthand create for muting rules

Jump to

Keyboard shortcuts

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