Documentation ¶
Index ¶
- Constants
- Variables
- func Empty(value interface{}) bool
- func GetCmdStatus() int
- func IsTestMode() bool
- func NotEmpty(value interface{}) bool
- func SetCmdStatus(status int)
- func SetCmdStatusError()
- func SetCmdStatusUserCancel()
- func SetStderr(e io.WriteCloser)
- func SetStdout(o io.WriteCloser)
- func Stderr() io.WriteCloser
- func Stdout() io.WriteCloser
- type Bool
- type Checker
- type CodeError
- func ConvertError(err error) *CodeError
- func NewAlreadyDoneError(desc string) *CodeError
- func NewEmptyError() *CodeError
- func NewError(code int, desc string) *CodeError
- func NewErrorWithCode(code int) *CodeError
- func NewErrorWithError(code int, desc string, err error) *CodeError
- func SetTestMode() *CodeError
- func (c *CodeError) AppendDesc(desc string) *CodeError
- func (c *CodeError) AppendDescF(f string, a ...interface{}) *CodeError
- func (c *CodeError) AppendError(err error) *CodeError
- func (c *CodeError) Error() string
- func (c *CodeError) HeaderInsertDesc(desc string) *CodeError
- func (c *CodeError) HeaderInsertDescF(f string, a ...interface{}) *CodeError
- func (c *CodeError) IsCancel() bool
- func (c *CodeError) SetCode(code int) *CodeError
- type Int
- type Int64
- type String
Constants ¶
View Source
const ( TrueString = "true" FalseString = "false" ResumeApiV1 = "v1" ResumeApiV2 = "v2" DefaultLineSeparate = "\t" BLOCK_BITS = 22 // Indicate that the blocksize is 4M BLOCK_SIZE = 1 << BLOCK_BITS // BLOCK SIZE )
View Source
const ( StatusOK = 0 // process success StatusError = 1 // process error StatusUserCancel = 2 // 用户取消 )
此处需要明确出值
View Source
const (
EnvKeyTest = "qshell_test"
)
Variables ¶
View Source
var ( ErrorCodeUnknown = -10000 ErrorCodeCancel = -10001 ErrorCodeParamNotExist = -11000 ErrorCodeParamMissing = -11001 ErrorCodeLineHeader = -11002 ErrorCodeAlreadyDone = -15000 )
View Source
var (
CancelError = NewError(ErrorCodeCancel, "user cancel")
)
Functions ¶
func GetCmdStatus ¶ added in v2.9.1
func GetCmdStatus() int
func IsTestMode ¶ added in v2.9.1
func IsTestMode() bool
func SetCmdStatus ¶ added in v2.9.1
func SetCmdStatus(status int)
func SetCmdStatusError ¶ added in v2.9.1
func SetCmdStatusError()
func SetCmdStatusUserCancel ¶ added in v2.9.1
func SetCmdStatusUserCancel()
func SetStderr ¶
func SetStderr(e io.WriteCloser)
func SetStdout ¶
func SetStdout(o io.WriteCloser)
func Stderr ¶
func Stderr() io.WriteCloser
func Stdout ¶
func Stdout() io.WriteCloser
Types ¶
type CodeError ¶
func ConvertError ¶
func NewAlreadyDoneError ¶
func NewEmptyError ¶
func NewEmptyError() *CodeError
func NewErrorWithCode ¶
func SetTestMode ¶ added in v2.9.1
func SetTestMode() *CodeError
func (*CodeError) AppendDesc ¶
func (*CodeError) AppendDescF ¶
func (*CodeError) AppendError ¶
func (*CodeError) HeaderInsertDesc ¶
func (*CodeError) HeaderInsertDescF ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.