core

package
v0.0.0-...-a8f75d9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PackageHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "package",
		Title: "Package Commands:",
	}
	PackageRepoHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "repository",
		Title: "Package Repository Commands:",
	}
	AppHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "app",
		Title: "App Commands:",
	}
	DevHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "dev",
		Title: "Development Commands:",
	}
	PackageManagementCommandsHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "package-management",
		Title: "Package Management Commands:",
	}
	PackageAuthoringCommandsHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "package-authoring",
		Title: "Package Authoring Commands:",
	}
	AppManagementCommandsHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "app-management",
		Title: "App Management Commands:",
	}
	RestOfCommandsHelpGroup = cobrautil.HelpSection{
		Key:   cmdGroupKey,
		Value: "",
		Title: "Available/Other Commands:",
	}
)

Functions

func NewValueNamespace

func NewValueNamespace(ns string) uitable.ValueString

func PrintTable

func PrintTable(ui ui.UI, table uitable.Table, columns *[]string) error

Types

type AuthoringUI

type AuthoringUI interface {
	PrintInformationalText(text string)
	PrintCmdExecutionText(text string)
	PrintActionableText(text string)
	AskForText(textOpts ui.TextOpts) (string, error)
	AskForChoice(opts ui.ChoiceOpts) (int, error)
	PrintCmdExecutionOutput(text string)
	PrintHeaderText(text string)
	PrintHeaderWithContextText(text string, context string)
}

type AuthoringUIImpl

type AuthoringUIImpl struct {
	// contains filtered or unexported fields
}

func NewAuthoringUIImpl

func NewAuthoringUIImpl(ui ui.UI) AuthoringUIImpl

func (AuthoringUIImpl) AskForChoice

func (uiImpl AuthoringUIImpl) AskForChoice(choiceOpts ui.ChoiceOpts) (int, error)

func (AuthoringUIImpl) AskForText

func (uiImpl AuthoringUIImpl) AskForText(textOpts ui.TextOpts) (string, error)

func (AuthoringUIImpl) PrintActionableText

func (uiImpl AuthoringUIImpl) PrintActionableText(text string)

func (AuthoringUIImpl) PrintCmdExecutionOutput

func (uiImpl AuthoringUIImpl) PrintCmdExecutionOutput(output string)

func (AuthoringUIImpl) PrintCmdExecutionText

func (uiImpl AuthoringUIImpl) PrintCmdExecutionText(text string)

func (AuthoringUIImpl) PrintHeaderText

func (uiImpl AuthoringUIImpl) PrintHeaderText(text string)

func (AuthoringUIImpl) PrintHeaderWithContextText

func (uiImpl AuthoringUIImpl) PrintHeaderWithContextText(text string, context string)

func (AuthoringUIImpl) PrintInformationalText

func (uiImpl AuthoringUIImpl) PrintInformationalText(text string)

type ConfigFactory

type ConfigFactory interface {
	ConfigurePathResolver(func() (string, error))
	ConfigureContextResolver(func() (string, error))
	ConfigureYAMLResolver(func() (string, error))
	ConfigureClient(float32, int)
	RESTConfig() (*rest.Config, error)
	DefaultNamespace() (string, error)
}

type ConfigFactoryImpl

type ConfigFactoryImpl struct {
	// contains filtered or unexported fields
}

func NewConfigFactoryImpl

func NewConfigFactoryImpl() *ConfigFactoryImpl

func (*ConfigFactoryImpl) ConfigureClient

func (f *ConfigFactoryImpl) ConfigureClient(qps float32, burst int)

func (*ConfigFactoryImpl) ConfigureContextResolver

func (f *ConfigFactoryImpl) ConfigureContextResolver(resolverFunc func() (string, error))

func (*ConfigFactoryImpl) ConfigurePathResolver

func (f *ConfigFactoryImpl) ConfigurePathResolver(resolverFunc func() (string, error))

func (*ConfigFactoryImpl) ConfigureYAMLResolver

func (f *ConfigFactoryImpl) ConfigureYAMLResolver(resolverFunc func() (string, error))

func (*ConfigFactoryImpl) DefaultNamespace

func (f *ConfigFactoryImpl) DefaultNamespace() (string, error)

func (*ConfigFactoryImpl) RESTConfig

func (f *ConfigFactoryImpl) RESTConfig() (*rest.Config, error)

type DedupingMessagesUI

type DedupingMessagesUI struct {
	// contains filtered or unexported fields
}

func NewDedupingMessagesUI

func NewDedupingMessagesUI(ui MessagesUI) *DedupingMessagesUI

func (*DedupingMessagesUI) Notify

func (ui *DedupingMessagesUI) Notify(msgs []string)

func (*DedupingMessagesUI) NotifySection

func (ui *DedupingMessagesUI) NotifySection(msg string, args ...interface{})

type DepsFactory

type DepsFactory interface {
	RESTHost() (string, error)
	DynamicClient(opts DynamicClientOpts) (dynamic.Interface, error)
	CoreClient() (kubernetes.Interface, error)
	KappCtrlClient() (kcclient.Interface, error)
	PackageClient() (pkgclient.Interface, error)
}

type DepsFactoryImpl

type DepsFactoryImpl struct {
	// contains filtered or unexported fields
}

func NewDepsFactoryImpl

func NewDepsFactoryImpl(configFactory ConfigFactory, ui ui.UI) *DepsFactoryImpl

func (*DepsFactoryImpl) CoreClient

func (f *DepsFactoryImpl) CoreClient() (kubernetes.Interface, error)

func (*DepsFactoryImpl) DynamicClient

func (f *DepsFactoryImpl) DynamicClient(opts DynamicClientOpts) (dynamic.Interface, error)

func (*DepsFactoryImpl) KappCtrlClient

func (f *DepsFactoryImpl) KappCtrlClient() (kcclient.Interface, error)

func (*DepsFactoryImpl) PackageClient

func (f *DepsFactoryImpl) PackageClient() (pkgclient.Interface, error)

func (*DepsFactoryImpl) RESTHost

func (f *DepsFactoryImpl) RESTHost() (string, error)

RESTHost ideally should be on ConfigFactory (TODO remove)

type DynamicClientOpts

type DynamicClientOpts struct{}

type Example

type Example struct {
	Description string
	Args        []string
}

type Examples

type Examples []Example

func (Examples) Description

func (es Examples) Description(nameFlag string, opts PackageCommandTreeOpts) string

type FileSource

type FileSource interface {
	Bytes() ([]byte, error)
}

type FlagsFactory

type FlagsFactory struct {
	// contains filtered or unexported fields
}

func NewFlagsFactory

func NewFlagsFactory(configFactory ConfigFactory, depsFactory DepsFactory) FlagsFactory

func (FlagsFactory) NewNamespaceNameFlag

func (f FlagsFactory) NewNamespaceNameFlag(str *string, envVariableKey string) *NamespaceNameFlag

type InputFile

type InputFile struct {
	// contains filtered or unexported fields
}

func NewInputFile

func NewInputFile(file string) InputFile

func (InputFile) Bytes

func (f InputFile) Bytes() ([]byte, error)

type KubeAPIFlags

type KubeAPIFlags struct {
	QPS   float32
	Burst int
}

func (*KubeAPIFlags) Configure

func (f *KubeAPIFlags) Configure(config ConfigFactory)

func (*KubeAPIFlags) Set

func (f *KubeAPIFlags) Set(cmd *cobra.Command, flagsFactory FlagsFactory)

type KubeconfigContextFlag

type KubeconfigContextFlag struct {
	// contains filtered or unexported fields
}

func NewKubeconfigContextFlag

func NewKubeconfigContextFlag(envVariableKey string) *KubeconfigContextFlag

func (*KubeconfigContextFlag) Resolve

func (s *KubeconfigContextFlag) Resolve() error

func (*KubeconfigContextFlag) Set

func (s *KubeconfigContextFlag) Set(val string) error

func (*KubeconfigContextFlag) String

func (s *KubeconfigContextFlag) String() string

func (*KubeconfigContextFlag) Type

func (s *KubeconfigContextFlag) Type() string

func (*KubeconfigContextFlag) Value

func (s *KubeconfigContextFlag) Value() (string, error)

type KubeconfigFlags

type KubeconfigFlags struct {
	Path    *KubeconfigPathFlag
	Context *KubeconfigContextFlag
	YAML    *KubeconfigYAMLFlag
}

func (*KubeconfigFlags) Set

func (f *KubeconfigFlags) Set(cmd *cobra.Command, flagsFactory FlagsFactory, opts PackageCommandTreeOpts)

type KubeconfigPathFlag

type KubeconfigPathFlag struct {
	// contains filtered or unexported fields
}

func NewKubeconfigPathFlag

func NewKubeconfigPathFlag(envVariableKey string) *KubeconfigPathFlag

func (*KubeconfigPathFlag) Resolve

func (s *KubeconfigPathFlag) Resolve() error

func (*KubeconfigPathFlag) Set

func (s *KubeconfigPathFlag) Set(val string) error

func (*KubeconfigPathFlag) String

func (s *KubeconfigPathFlag) String() string

func (*KubeconfigPathFlag) Type

func (s *KubeconfigPathFlag) Type() string

func (*KubeconfigPathFlag) Value

func (s *KubeconfigPathFlag) Value() (string, error)

type KubeconfigYAMLFlag

type KubeconfigYAMLFlag struct {
	// contains filtered or unexported fields
}

func NewKubeconfigYAMLFlag

func NewKubeconfigYAMLFlag(envVariableKey string) *KubeconfigYAMLFlag

func (*KubeconfigYAMLFlag) Resolve

func (s *KubeconfigYAMLFlag) Resolve() error

func (*KubeconfigYAMLFlag) Set

func (s *KubeconfigYAMLFlag) Set(val string) error

func (*KubeconfigYAMLFlag) String

func (s *KubeconfigYAMLFlag) String() string

func (*KubeconfigYAMLFlag) Type

func (s *KubeconfigYAMLFlag) Type() string

func (*KubeconfigYAMLFlag) Value

func (s *KubeconfigYAMLFlag) Value() (string, error)

type LocalFileSource

type LocalFileSource struct {
	// contains filtered or unexported fields
}

func NewLocalFileSource

func NewLocalFileSource(path string) LocalFileSource

func (LocalFileSource) Bytes

func (s LocalFileSource) Bytes() ([]byte, error)

type MessagesUI

type MessagesUI interface {
	NotifySection(msg string, args ...interface{})
	Notify(msgs []string)
}

type NamespaceFlags

type NamespaceFlags struct {
	Name string
}

func (*NamespaceFlags) Set

func (s *NamespaceFlags) Set(cmd *cobra.Command, flagsFactory FlagsFactory)

func (*NamespaceFlags) SetWithPackageCommandTreeOpts

func (s *NamespaceFlags) SetWithPackageCommandTreeOpts(cmd *cobra.Command, flagsFactory FlagsFactory, opts PackageCommandTreeOpts)

type NamespaceNameFlag

type NamespaceNameFlag struct {
	// contains filtered or unexported fields
}

func NewNamespaceNameFlag

func NewNamespaceNameFlag(value *string, configFactory ConfigFactory, envVariableKey string) *NamespaceNameFlag

func (*NamespaceNameFlag) Resolve

func (s *NamespaceNameFlag) Resolve() error

func (*NamespaceNameFlag) Set

func (s *NamespaceNameFlag) Set(val string) error

func (*NamespaceNameFlag) String

func (s *NamespaceNameFlag) String() string

func (*NamespaceNameFlag) Type

func (s *NamespaceNameFlag) Type() string

type PackageCommandTreeOpts

type PackageCommandTreeOpts struct {
	BinaryName     string
	PositionalArgs bool

	Color bool
	JSON  bool

	AlwaysAllowTogglingWait bool
}

type PlainMessagesUI

type PlainMessagesUI struct {
	// contains filtered or unexported fields
}

func NewPlainMessagesUI

func NewPlainMessagesUI(ui ui.UI) *PlainMessagesUI

func (*PlainMessagesUI) Notify

func (ui *PlainMessagesUI) Notify(msgs []string)

func (*PlainMessagesUI) NotifySection

func (ui *PlainMessagesUI) NotifySection(msg string, args ...interface{})

type SecureNamespaceFlags

type SecureNamespaceFlags struct {
	AllowedSharedNamespaces bool
}

func (*SecureNamespaceFlags) CheckForDisallowedSharedNamespaces

func (s *SecureNamespaceFlags) CheckForDisallowedSharedNamespaces(namespace string) error

func (*SecureNamespaceFlags) Set

func (s *SecureNamespaceFlags) Set(cmd *cobra.Command)

type StatusLoggingUI

type StatusLoggingUI struct {
	// contains filtered or unexported fields
}

func NewStatusLoggingUI

func NewStatusLoggingUI(ui ui.UI) StatusLoggingUI

func (StatusLoggingUI) PrintLogLine

func (s StatusLoggingUI) PrintLogLine(message string, messageBlock string, errorBlock bool, timestamp time.Time)

func (StatusLoggingUI) PrintMessage

func (s StatusLoggingUI) PrintMessage(message string)

func (StatusLoggingUI) PrintMessageBlockDiff

func (s StatusLoggingUI) PrintMessageBlockDiff(oldBlock string, newBlock string, timestamp time.Time)

func (StatusLoggingUI) PrintMessagef

func (s StatusLoggingUI) PrintMessagef(message string, args ...interface{})

type StdinSource

type StdinSource struct{}

func NewStdinSource

func NewStdinSource() StdinSource

func (StdinSource) Bytes

func (s StdinSource) Bytes() ([]byte, error)

type ValueAge

type ValueAge struct {
	T time.Time
}

func NewValueAge

func NewValueAge(t time.Time) ValueAge

func (ValueAge) Compare

func (t ValueAge) Compare(other uitable.Value) int

func (ValueAge) String

func (t ValueAge) String() string

func (ValueAge) Value

func (t ValueAge) Value() uitable.Value

type ValueSemver

type ValueSemver struct {
	V string
}

func NewValueSemver

func NewValueSemver(v string) ValueSemver

func (ValueSemver) Compare

func (t ValueSemver) Compare(other uitable.Value) int

func (ValueSemver) String

func (t ValueSemver) String() string

func (ValueSemver) Value

func (t ValueSemver) Value() uitable.Value

type ValueStringsSingleLine

type ValueStringsSingleLine struct {
	S []string
}

func NewValueStringsSingleLine

func NewValueStringsSingleLine(s []string) ValueStringsSingleLine

func (ValueStringsSingleLine) Compare

func (t ValueStringsSingleLine) Compare(other uitable.Value) int

func (ValueStringsSingleLine) String

func (t ValueStringsSingleLine) String() string

func (ValueStringsSingleLine) Value

type ValueTruncated

type ValueTruncated struct {
	V   uitable.Value
	Max int
}

func NewValueTruncated

func NewValueTruncated(v uitable.Value, max int) ValueTruncated

func (ValueTruncated) Compare

func (t ValueTruncated) Compare(other uitable.Value) int

func (ValueTruncated) String

func (t ValueTruncated) String() string

func (ValueTruncated) Value

func (t ValueTruncated) Value() uitable.Value

type ValueUnknownBool

type ValueUnknownBool struct {
	B *bool
}

func NewValueUnknownBool

func NewValueUnknownBool(b *bool) ValueUnknownBool

func (ValueUnknownBool) Compare

func (t ValueUnknownBool) Compare(other uitable.Value) int

func (ValueUnknownBool) String

func (t ValueUnknownBool) String() string

func (ValueUnknownBool) Value

func (t ValueUnknownBool) Value() uitable.Value

type WaitFlags

type WaitFlags struct {
	Enabled       bool
	CheckInterval time.Duration
	Timeout       time.Duration
}

func (*WaitFlags) Set

func (f *WaitFlags) Set(cmd *cobra.Command, flagsFactory FlagsFactory, opts *WaitFlagsOpts)

type WaitFlagsOpts

type WaitFlagsOpts struct {
	AllowDisableWait bool
	DefaultInterval  time.Duration
	DefaultTimeout   time.Duration
}

Jump to

Keyboard shortcuts

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