flags

package
v0.0.0-...-83ec391 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SinkToString

func SinkToString(dest duckv1.Destination) string

SinkToString prepares a Sink for list output Deprecated: use (*sink.Reference).AsText instead.

Types

type EventtypeFlags

type EventtypeFlags struct {
	Type   string
	Source string
	Broker string
}

func (*EventtypeFlags) Add

func (e *EventtypeFlags) Add(cmd *cobra.Command)

type ListPrintFlags

type ListPrintFlags struct {
	GenericPrintFlags  *genericclioptions.PrintFlags
	HumanReadableFlags *commands.HumanPrintFlags
	PrinterHandler     func(h hprinters.PrintHandler)
}

ListFlags composes common printer flag structs used in the list command.

func NewListPrintFlags

func NewListPrintFlags(printer func(h hprinters.PrintHandler)) *ListPrintFlags

NewListFlags returns flags associated with humanreadable, template, and "name" printing, with default values set.

func (*ListPrintFlags) AddFlags

func (f *ListPrintFlags) AddFlags(cmd *cobra.Command)

AddFlags receives a *cobra.Command reference and binds flags related to humanreadable and template printing.

func (*ListPrintFlags) AllowedFormats

func (f *ListPrintFlags) AllowedFormats() []string

AllowedFormats is the list of formats in which data can be displayed

func (*ListPrintFlags) EnsureWithNamespace

func (f *ListPrintFlags) EnsureWithNamespace()

EnsureWithNamespace ensures that humanreadable flags return a printer capable of printing with a "namespace" column.

func (*ListPrintFlags) Print

func (f *ListPrintFlags) Print(obj runtime.Object, w io.Writer) error

Print is to print an Object to a Writer

func (*ListPrintFlags) ToPrinter

func (f *ListPrintFlags) ToPrinter() (hprinters.ResourcePrinter, error)

ToPrinter attempts to find a composed set of ListTypesFlags suitable for returning a printer based on current flag values.

type SinkFlags

type SinkFlags struct {
	Sink         string
	SinkMappings map[string]schema.GroupVersionResource
}

SinkFlags holds information about given sink together with optional mappings to allow ease of referencing the common types.

func NewSinkFlag

func NewSinkFlag(mapping map[string]schema.GroupVersionResource) *SinkFlags

NewSinkFlag is a constructor function to create SinkFlags from provided map

func (*SinkFlags) Add

func (i *SinkFlags) Add(cmd *cobra.Command)

Add configures Sink flag with name 'Sink' amd short name 's'

func (*SinkFlags) AddToFlagSet

func (i *SinkFlags) AddToFlagSet(fs *pflag.FlagSet, fname, short string)

AddToFlagSet configures Sink flag with given flag name and a short flag name pass empty short flag name if you don't want to set one

func (*SinkFlags) AddWithFlagName

func (i *SinkFlags) AddWithFlagName(cmd *cobra.Command, fname, short string)

AddWithFlagName configures Sink flag with given flag name and a short flag name pass empty short flag name if you don't want to set one.

func (*SinkFlags) Parse

func (i *SinkFlags) Parse(namespace string) (*sink.Reference, error)

Parse returns the sink reference, which may refer to URL or to Kubernetes resource. The namespace given should be the current namespace within the context.

func (*SinkFlags) ResolveSink

func (i *SinkFlags) ResolveSink(ctx context.Context, knclient clientdynamic.KnDynamicClient, namespace string) (*duckv1.Destination, error)

ResolveSink returns the Destination referred to by the flags in the acceptor. It validates that any object the user is referring to exists.

func (*SinkFlags) WithDefaultMappings

func (i *SinkFlags) WithDefaultMappings() *SinkFlags

WithDefaultMappings will return a copy of SinkFlags with provided mappings and the default ones.

type SourceTypeFilters

type SourceTypeFilters struct {
	Filters []string
}

SourceTypeFilters defines flags used for kn source list to filter sources on types

func (*SourceTypeFilters) Add

func (s *SourceTypeFilters) Add(cmd *cobra.Command, what string)

Add attaches the SourceTypeFilters flags to given command

type Traffic

type Traffic struct {
	RevisionsPercentages []string
	RevisionsTags        []string
	UntagRevisions       []string
}

func (*Traffic) Add

func (t *Traffic) Add(cmd *cobra.Command)

func (*Traffic) AddTagFlag

func (t *Traffic) AddTagFlag(cmd *cobra.Command)

AddTagFlag adds the flag --tag to the command

func (*Traffic) AddTrafficFlag

func (t *Traffic) AddTrafficFlag(cmd *cobra.Command)

AddTrafficFlag adds the flag --traffic to the command

func (*Traffic) AddUntagFlag

func (t *Traffic) AddUntagFlag(cmd *cobra.Command)

AddUntagFlag adds the flag --untag to the command

func (*Traffic) Changed

func (t *Traffic) Changed(cmd *cobra.Command) bool

func (*Traffic) PercentagesChanged

func (t *Traffic) PercentagesChanged(cmd *cobra.Command) bool

func (*Traffic) TagsChanged

func (t *Traffic) TagsChanged(cmd *cobra.Command) bool

Jump to

Keyboard shortcuts

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