cmd

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Execute

func Execute()

func ExitCLI

func ExitCLI(errorCode int)

func OnError

func OnError(err error)

func RegisterCLIExitInterceptor

func RegisterCLIExitInterceptor(interceptor func(int))

func SkipConfigValidation

func SkipConfigValidation() setupOption

func SkipVersionMismatchCheck

func SkipVersionMismatchCheck() setupOption

func WithOptionalResourceName

func WithOptionalResourceName() setupOption

Types

type CobraRunFn

type CobraRunFn func(cmd *cobra.Command, args []string)

func WithResourceMiddleware

func WithResourceMiddleware(runFn RunFn, params ...Validator) CobraRunFn

func WithResultHandler

func WithResultHandler(runFn RunFn) CobraRunFn

type MiddlewareWrapper

type MiddlewareWrapper func(RunFn) RunFn

func WithParamsHandler

func WithParamsHandler(validators ...Validator) MiddlewareWrapper

type RunFn

type RunFn func(cmd *cobra.Command, args []string) (string, error)

type Validator

type Validator interface {
	Validate(cmd *cobra.Command, args []string) []error
}

Jump to

Keyboard shortcuts

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