cmd

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Overview

Inspired by `hugo gen doc` - see https://github.com/gohugoio/hugo/blob/release-0.69.0/commands/gendoc.go

Inspired by `hugo gen doc` - see https://github.com/gohugoio/hugo/blob/release-0.69.0/commands/gendoc.go

Index

Constants

View Source
const EOLMsg = "" /* 155-byte string literal not displayed */
View Source
const IngressConfigName = "ingress-config"

Variables

View Source
var KubeServerVersionConstraints string

KubeServerVersionConstraints the Kubernetes Cluster version's constraints is passed by ldflags

View Source
var (
	// Version information which is passed by ldflags
	Version string
)

Functions

func AbortSequence

func AbortSequence(params sequenceControlStruct) error

func AddOutputFormatFlag

func AddOutputFormatFlag(cmd *cobra.Command) *string

AddOutputFormatFlag adds the --output flag to the command

func AddWatchFlag

func AddWatchFlag(cmd *cobra.Command) *bool

AddWatchFlag ads the --watch flag to the command

func AddWatchTimeFlag

func AddWatchTimeFlag(cmd *cobra.Command) *int

AddWatchTimeFlag adds the --watch-time flag to the command

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func LookupHostname

func LookupHostname(hostname string, lookupFn resolveFunc, sleepFn sleepFunc) bool

func NewDefaultWatcher

func NewDefaultWatcher(eventHandler apiutils.EventHandlerInterface, filter apiutils.EventFilter, timeOut time.Duration) *apiutils.EventWatcher

NewDefaultWatcher creates a preconfigured EventWatcher used in cli commands

func NewRootCommand

func NewRootCommand(vChecker *version.VersionChecker) *cobra.Command

func NewVersionCommand

func NewVersionCommand(vChecker *version.VersionChecker) *cobra.Command

func PauseSequence

func PauseSequence(params sequenceControlStruct) error

func PrintAsJSON

func PrintAsJSON(writer io.Writer, events interface{})

PrintAsJSON prints events in JSON format to std::out

func PrintAsYAML

func PrintAsYAML(writer io.Writer, events interface{})

PrintAsYAML prints events in YAML format to std::out

func PrintEventWatcher

func PrintEventWatcher(context context.Context, watcher Watcher, format string, writer io.Writer)

PrintEventWatcher uses the given watcher type and prints its result to the given writer in the given format Note that this function is blocking until the watcher is canceled

func PrintEvents

func PrintEvents(writer io.Writer, format string, content interface{})

PrintEvents can be used to print events (and structs in general) to the given write either in YAML or JSON format

func ResumeSequence

func ResumeSequence(params sequenceControlStruct) error

func ServiceInSlice

func ServiceInSlice(service string, serviceList []*models.Service) bool

Types

type Authenticator

type Authenticator struct {
	Namespace         string
	CredentialManager CredentialGetSetter
	OauthStore        auth.OauthStore
}

func NewAuthenticator

func NewAuthenticator(namespace string, credentialManager CredentialGetSetter, oauthStore auth.OauthStore) *Authenticator

func (*Authenticator) Auth

func (a *Authenticator) Auth(authenticatorOptions AuthenticatorOptions) error

func (*Authenticator) GetCredentials

func (a *Authenticator) GetCredentials() (url.URL, string, error)

type AuthenticatorOptions

type AuthenticatorOptions struct {
	Endpoint string
	APIToken string
}

type CredentialGetSetter

type CredentialGetSetter interface {
	SetCreds(endPoint url.URL, apiToken string, namespace string) error
	GetCreds(namespace string) (url.URL, string, error)
}

type GetEventStruct

type GetEventStruct struct {
	KeptnContext *string
	Project      *string
	Stage        *string
	Service      *string
	PageSize     *string
	Output       *string
	NumOfPages   *int
	Watch        *bool
	WatchTime    *int
}

type MockedCredentialGetSetter

type MockedCredentialGetSetter struct {
	SetCredsFunc func(endPoint url.URL, apiToken string, namespace string) error
	GetCredsFunc func(namespace string) (url.URL, string, error)
}

func (*MockedCredentialGetSetter) GetCreds

func (m *MockedCredentialGetSetter) GetCreds(namespace string) (url.URL, string, error)

func (*MockedCredentialGetSetter) SetCreds

func (m *MockedCredentialGetSetter) SetCreds(endPoint url.URL, apiToken string, namespace string) error

type SecretCmdHandler

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

func (SecretCmdHandler) CreateSecret

func (h SecretCmdHandler) CreateSecret(secretName string, data []string, scope *string) error

func (SecretCmdHandler) DeleteSecret

func (h SecretCmdHandler) DeleteSecret(name string, scope *string) error

func (SecretCmdHandler) GetSecrets

func (h SecretCmdHandler) GetSecrets(outputFormat string) (string, error)

func (SecretCmdHandler) UpdateSecret

func (h SecretCmdHandler) UpdateSecret(secretName string, data []string, scope *string) error

type SequenceState

type SequenceState string

type Watcher

type Watcher interface {
	Watch(ctx context.Context) (<-chan []*models.KeptnContextExtendedCE, context.CancelFunc)
}

Watcher is the interface to an EventWatcher

Jump to

Keyboard shortcuts

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