data

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 Empty

func Empty(value interface{}) bool

func GetCmdStatus added in v2.9.1

func GetCmdStatus() int

func IsTestMode added in v2.9.1

func IsTestMode() bool

func NotEmpty

func NotEmpty(value interface{}) 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 Bool

type Bool bool

Bool bool 引用类型

func GetNotEmptyBoolIfExist

func GetNotEmptyBoolIfExist(values ...*Bool) *Bool

func NewBool

func NewBool(b bool) *Bool

func (*Bool) Value

func (b *Bool) Value() bool

type Checker

type Checker interface {
	Check() *CodeError
}

type CodeError

type CodeError struct {
	Code int
	Desc string
}

func ConvertError

func ConvertError(err error) *CodeError

func NewAlreadyDoneError

func NewAlreadyDoneError(desc string) *CodeError

func NewEmptyError

func NewEmptyError() *CodeError

func NewError

func NewError(code int, desc string) *CodeError

func NewErrorWithCode

func NewErrorWithCode(code int) *CodeError

func NewErrorWithError

func NewErrorWithError(code int, desc string, err error) *CodeError

func SetTestMode added in v2.9.1

func SetTestMode() *CodeError

func (*CodeError) AppendDesc

func (c *CodeError) AppendDesc(desc string) *CodeError

func (*CodeError) AppendDescF

func (c *CodeError) AppendDescF(f string, a ...interface{}) *CodeError

func (*CodeError) AppendError

func (c *CodeError) AppendError(err error) *CodeError

func (*CodeError) Error

func (c *CodeError) Error() string

func (*CodeError) HeaderInsertDesc

func (c *CodeError) HeaderInsertDesc(desc string) *CodeError

func (*CodeError) HeaderInsertDescF

func (c *CodeError) HeaderInsertDescF(f string, a ...interface{}) *CodeError

func (*CodeError) IsCancel added in v2.9.2

func (c *CodeError) IsCancel() bool

func (*CodeError) SetCode

func (c *CodeError) SetCode(code int) *CodeError

type Int

type Int int

Int int 引用类型

func ErrorCode

func ErrorCode(err error) *Int

func GetNotEmptyIntIfExist

func GetNotEmptyIntIfExist(values ...*Int) *Int

func NewInt

func NewInt(i int) *Int

func (*Int) Value

func (i *Int) Value() int

type Int64

type Int64 int64

Int int 引用类型

func GetNotEmptyInt64IfExist

func GetNotEmptyInt64IfExist(values ...*Int64) *Int64

func NewInt64

func NewInt64(i int64) *Int64

func (*Int64) Value

func (i *Int64) Value() int64

type String

type String string

String string 引用类型

func GetNotEmptyStringIfExist

func GetNotEmptyStringIfExist(values ...*String) *String

func NewString

func NewString(s string) *String

func (*String) Value

func (s *String) Value() string

Jump to

Keyboard shortcuts

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