common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 10 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:")
)
View Source
var NotFoundReg = regexp.MustCompile(`model: (.+?) not found`)

Functions

func BindFlags

func BindFlags(cmd *cobra.Command)

BindFlags bind the environment with flags.

func CheckResponseStatus

func CheckResponseStatus(resp *http.Response) 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