genericclioptions

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagOutputFormat      = "output"
	FlagShowManagedFields = "show-managed-fields"
)
View Source
const (
	FlagShowChoreoAPIs  = "show-choreo-apis"
	FlagShowDiffDetails = "show-diff-details"
)
View Source
const (
	FlagNamespace = "namespace"
)
View Source
const (
	FlagResultOutputFormat = "result-output-format"
)
View Source
const (
	FlagServerName = "servername"
)

Variables

View Source
var (
	SupportedResultOutputFormats = sets.New[string]().Insert([]string{"reconciler", "resource", "raw"}...)
)

Functions

func InitConfig

func InitConfig(cmd *cobra.Command) error

InitConfig reads in config file and ENV variables if set.

Types

type ChoreoConfig added in v0.0.15

type ChoreoConfig struct {
	ChoreoFlags *ChoreoFlags
	ClientFlags *ClientFlags
	ServerFlags *ServerFlags
}

func NewChoreoConfig added in v0.0.15

func NewChoreoConfig() *ChoreoConfig

func (*ChoreoConfig) AddFlags added in v0.0.15

func (r *ChoreoConfig) AddFlags(flags *pflag.FlagSet)

func (*ChoreoConfig) ToBranch added in v0.0.15

func (r *ChoreoConfig) ToBranch() string

func (*ChoreoConfig) ToBranchClient added in v0.0.15

func (r *ChoreoConfig) ToBranchClient() (branchclient.Client, error)

func (*ChoreoConfig) ToChoreoClient added in v0.0.15

func (r *ChoreoConfig) ToChoreoClient() (choreoclient.Client, error)

func (*ChoreoConfig) ToConfig added in v0.0.15

func (r *ChoreoConfig) ToConfig() *config.Config

func (*ChoreoConfig) ToDiscoveryClient added in v0.0.15

func (r *ChoreoConfig) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

func (*ChoreoConfig) ToProxy added in v0.0.15

func (r *ChoreoConfig) ToProxy() types.NamespacedName

func (*ChoreoConfig) ToResourceClient added in v0.0.15

func (r *ChoreoConfig) ToResourceClient() (resourceclient.Client, error)

func (*ChoreoConfig) ToResourceMapper added in v0.0.15

func (r *ChoreoConfig) ToResourceMapper() (resourcemapper.Mapper, error)

func (*ChoreoConfig) ToRunnerClient added in v0.0.15

func (r *ChoreoConfig) ToRunnerClient() (runnerclient.Client, error)

func (*ChoreoConfig) ToSnapshotClient added in v0.0.15

func (r *ChoreoConfig) ToSnapshotClient() (snapshotclient.Client, error)

type ChoreoFlags added in v0.0.15

type ChoreoFlags struct {
	Debug           *bool
	Address         *string
	Config          *string
	ConfigEnvPrefix *string
}

func NewChoreoFlags added in v0.0.15

func NewChoreoFlags() *ChoreoFlags

NewConfigFlags returns ConfigFlags with default values set

func (*ChoreoFlags) AddFlags added in v0.0.15

func (r *ChoreoFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type ClientFlags added in v0.0.15

type ClientFlags struct {
	Branch    *string
	Proxy     *string
	MaxRcvMsg *int
	Timeout   *int
	CacheDir  *string
}

ResourceFlags are flags for generic resources.

func NewClientFlags added in v0.0.15

func NewClientFlags() *ClientFlags

func (*ClientFlags) AddFlags added in v0.0.15

func (r *ClientFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type ClientGetter

type ClientGetter interface {
	// ToConfig returns config
	ToConfig() *config.Config
	// ToDiscoveryClient returns discovery client
	ToChoreoClient() (choreoclient.Client, error)
	// ToDiscoveryClient returns discovery client
	ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
	// ToResourceMapper returns a restmapper
	ToResourceMapper() (resourcemapper.Mapper, error)
	// ToResourceClient returns resource client
	ToResourceClient() (resourceclient.Client, error)
	// ToBranchClient returns branch client
	ToBranchClient() (branchclient.Client, error)
	// ToRunnerClient returns runner client
	ToRunnerClient() (runnerclient.Client, error)
	// TosnapshotClient returns snapshot client
	ToSnapshotClient() (snapshotclient.Client, error)
	// Branch()
	ToBranch() string
	// Proxy()
	ToProxy() types.NamespacedName
}

type ConfigFn added in v0.0.15

type ConfigFn func() *config.Config

type FileNameFlags added in v0.0.15

type FileNameFlags struct {
	Usage string

	Filenames *[]string
	Recursive *bool
}

FileNameFlags are flags for processing files. Usage of this struct by itself is discouraged. These flags are composed by ResourceBuilderFlags which should be used instead.

func NewFileNameFlags added in v0.0.15

func NewFileNameFlags(usage string) *FileNameFlags

func (*FileNameFlags) AddFlags added in v0.0.15

func (o *FileNameFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

type NoopClientGetter added in v0.0.15

type NoopClientGetter struct{}

func (NoopClientGetter) ToBranch added in v0.0.15

func (NoopClientGetter) ToBranch() string

Branch()

func (NoopClientGetter) ToBranchClient added in v0.0.15

func (NoopClientGetter) ToBranchClient() (branchclient.Client, error)

ToBranchClient returns branch client

func (NoopClientGetter) ToChoreoClient added in v0.0.15

func (NoopClientGetter) ToChoreoClient() (choreoclient.Client, error)

ToDiscoveryClient returns discovery client

func (NoopClientGetter) ToConfig added in v0.0.15

func (NoopClientGetter) ToConfig() *config.Config

func (NoopClientGetter) ToDiscoveryClient added in v0.0.15

ToDiscoveryClient returns discovery client

func (NoopClientGetter) ToProxy added in v0.0.15

Proxy()

func (NoopClientGetter) ToResourceClient added in v0.0.15

func (NoopClientGetter) ToResourceClient() (resourceclient.Client, error)

ToResourceClient returns resource client

func (NoopClientGetter) ToResourceMapper added in v0.0.15

func (NoopClientGetter) ToResourceMapper() (resourcemapper.Mapper, error)

ToResourceMapper returns a restmapper

func (NoopClientGetter) ToRunnerClient added in v0.0.15

func (NoopClientGetter) ToRunnerClient() (runnerclient.Client, error)

ToRunnerClient returns runner client

func (NoopClientGetter) ToSnapshotClient added in v0.0.15

func (NoopClientGetter) ToSnapshotClient() (snapshotclient.Client, error)

TosnapshotClient returns snapshot client

type ResourceClientFn added in v0.0.15

type ResourceClientFn func() (resourceclient.Client, error)

type ResourceFlags added in v0.0.15

type ResourceFlags struct {
	Namespace *string
}

ResourceFlags are flags for generic resources.

func NewResourceFlags added in v0.0.15

func NewResourceFlags() *ResourceFlags

func (*ResourceFlags) AddFlags added in v0.0.15

func (r *ResourceFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type ResourceMapperFn added in v0.0.15

type ResourceMapperFn func() (resourcemapper.Mapper, error)

type ResourceOutputFlags added in v0.0.15

type ResourceOutputFlags struct {
	Output            *string
	ShowManagedFields *bool
}

ResourceFlags are flags for generic resources.

func NewResourceOutputFlags added in v0.0.15

func NewResourceOutputFlags() *ResourceOutputFlags

func (*ResourceOutputFlags) AddFlags added in v0.0.15

func (r *ResourceOutputFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type RunOutputFlags added in v0.0.15

type RunOutputFlags struct {
	ShowChoreoAPIs    *bool
	ShowManagedFields *bool
	ShowDiffDetails   *bool
}

ResourceFlags are flags for generic resources.

func NewRunOutputFlags added in v0.0.15

func NewRunOutputFlags() *RunOutputFlags

func (*RunOutputFlags) AddFlags added in v0.0.15

func (r *RunOutputFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type RunResultFlags added in v0.0.15

type RunResultFlags struct {
	ResultOutputFormat *string
}

ResourceFlags are flags for generic resources.

func NewRunResultFlags added in v0.0.15

func NewRunResultFlags() *RunResultFlags

func (*RunResultFlags) AddFlags added in v0.0.15

func (r *RunResultFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

type ServerFlags added in v0.0.15

type ServerFlags struct {
	ServerName          *string
	CRDPath             *string
	DBPath              *string
	ReconcilerPath      *string
	LibraryPath         *string
	PostProcessingPath  *string
	OutputPath          *string
	InputPath           *string
	RefsPath            *string
	SchemaPath          *string
	RunningConfigsPath  *string
	InternalReconcilers *bool
	SDC                 *bool
}

ResourceFlags are flags for generic resources.

func NewServerFlags added in v0.0.15

func NewServerFlags() *ServerFlags

func (*ServerFlags) AddFlags added in v0.0.15

func (r *ServerFlags) AddFlags(flags *pflag.FlagSet)

AddFlags binds file name flags to a given flagset

Jump to

Keyboard shortcuts

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