common

package
v0.5.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugFlag = "debug"
	HelpFlag  = "help"
)

Variables

View Source
var (
	GroupManagement = CreateGroup("management", "Management Commands:")
	GroupAdvanced   = CreateGroup("advanced", "Advanced Commands:")
	GroupOther      = CreateGroup("other", "Other Commands:")
)

Functions

func BindFlags

func BindFlags(cmd *cobra.Command)

BindFlags bind the environment with flags.

func CheckResponseStatus

func CheckResponseStatus(resp *http.Response, name string) error

func CreateGroup

func CreateGroup(name, title string) *cobra.Group

func InputByFlags

func InputByFlags(cmd *cobra.Command) bool

InputByFlags check whether user set flags.

Types

type ErrorResponse

type ErrorResponse struct {
	Message    string `json:"message"`
	Status     int    `json:"status"`
	StatusText string `json:"statusText"`
}

type RetryableError

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

func NewRetryableError

func NewRetryableError(msg string) *RetryableError

func (*RetryableError) Error

func (e *RetryableError) Error() string

Jump to

Keyboard shortcuts

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