Documentation ¶
Index ¶
- Constants
- func AtoF32(s string) float32
- func AtoF64(s string) float64
- func AtoI64(s string) int64
- func AtoU64(s string) uint64
- func BackgroundContext() context.Context
- func Bytes2StringNoCopy(bs []byte) string
- func BytesGB(bs []byte) float64
- func BytesKB(bs []byte) float64
- func BytesMB(bs []byte) float64
- func BytesOf(bs []byte) string
- func CST2Timestamp(cst string) string
- func ConRun(fns ...Fn)
- func DefaultHTTPClient() *http.Client
- func F32toa(f32 float32) string
- func F64toa(f64 float64) string
- func GetTypeByteSize(varOf any) uintptr
- func GetValueByteSize(varOf any) int
- func GzipIOReader2File(ioReader io.Reader, fileName string) (err error)
- func HandleCloseError(msg string, closer io.Closer)
- func I64toa(i64 int64) string
- func IOGetStr(readCloser io.ReadCloser) string
- func IsSpace(s string) bool
- func IsURLWithHTTP(url string) bool
- func IsURLWithHTTPS(url string) bool
- func IsURLWithScheme(url string) bool
- func MapOk[Map ~map[K]V, K comparable, V any](m Map, k K) bool
- func MarshalJSONPretty(v any) (string, error)
- func New[T any](val T) *T
- func NewBool(bVar bool) *bool
- func NewFloat32(f32 float32) *float32
- func NewFloat64(f64 float64) *float64
- func NewInt32(i32 int32) *int32
- func NewInt64(i64 int64) *int64
- func NewString(str string) *string
- func NilStruct() struct{}
- func OSCreateAbsoluteDir(dir string) error
- func OSCreateAbsolutePath(filePath string) error
- func OSFilePathExists(filePath string) bool
- func OSOpenFileWithCreate(filePath string) (*os.File, error)
- func OSRemoveFile(filePath string) error
- func ReadYaml(a any, filePath string) error
- func SeqRun(fns ...Fn)
- func SilentFatalError(err error)
- func SilentHandleError(detail string, err error)
- func SilentPanicError(err error)
- func String2BytesNoCopy(s string) []byte
- func StringConcat(s ...string) string
- func StringJoin(sep string, s ...string) string
- func StringReplaceAlls(s, to string, from ...string) string
- func TODOContext() context.Context
- func TarIOReader2File(ioReader io.Reader, filePath string) (err error)
- func Timestamp2CST(timestamp string) string
- func U64toa(u64 uint64) string
- func URLWithHTTP(url string) string
- func URLWithoutHTTP(url string) string
- type Byteser
- type Fn
- type Func
- type JSONEncoder
- type Page
- func (p *Page) Page() *int64
- func (p *Page) PageIntValue() int
- func (p *Page) PageValue() int64
- func (p *Page) Pair() (*int64, *int64)
- func (p *Page) PairValue() (int64, int64)
- func (p *Page) Size() *int64
- func (p *Page) SizeIntValue() int
- func (p *Page) SizeValue() int64
- func (p *Page) WithOffsetNum(offsetNum int64) *Page
- func (p *Page) WithPageNum(pageNum int64) *Page
- func (p *Page) WithPageSize(pageSize int64) *Page
- type Sizer
- type StdJSONEncoder
- type Stringer
Constants ¶
View Source
const ( Ki = 1 << 10 Mi = 1 << 20 Gi = 1 << 30 Ti = 1 << 40 Pi = 1 << 50 Ei = 1 << 60 )
<binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei refer from: resource/quantity.go
View Source
const ( JSONMarshalPrefix = "" JSONMarshalIndent = " " )
View Source
const ( DirMaxPerm = 0755 FileMaxPerm = 0644 )
View Source
const ( Space = " " // ASCII 32 Tab = "\t" // ASCII 9 Newline = "\n" // ASCII 10 CarriageReturn = "\r" // ASCII 13 VerticalTab = "\v" // ASCII 11 FormFeed = "\f" // ASCII 12 )
space run as string, space character as string
View Source
const ( DurationMinute = time.Second * 60 DurationHour = DurationMinute * 60 DurationHalfDay = DurationHour * 12 DurationDay = DurationHalfDay * 2 DurationWeek = DurationDay * 7 DurationMonth = DurationDay * 30 DurationYear = DurationDay * 365 )
View Source
const (
TimeLocationAsiaShanghai = "Asia/Shanghai"
)
Variables ¶
This section is empty.
Functions ¶
func BackgroundContext ¶ added in v1.1.0
func Bytes2StringNoCopy ¶
func CST2Timestamp ¶ added in v1.1.0
CST2Timestamp Convert (CST: UTC+8) to (Unix timestamp)
func DefaultHTTPClient ¶ added in v1.1.0
func GetTypeByteSize ¶ added in v1.1.0
func GetValueByteSize ¶ added in v1.1.0
func GzipIOReader2File ¶ added in v1.1.4
func HandleCloseError ¶ added in v1.1.0
HandleCloseError handle io closer error
func IOGetStr ¶ added in v1.1.3
func IOGetStr(readCloser io.ReadCloser) string
func IsURLWithHTTP ¶ added in v1.1.0
func IsURLWithHTTPS ¶ added in v1.1.0
func IsURLWithScheme ¶ added in v1.1.0
func MapOk ¶ added in v1.1.4
func MapOk[Map ~map[K]V, K comparable, V any](m Map, k K) bool
func MarshalJSONPretty ¶ added in v1.1.0
func NewFloat32 ¶
func NewFloat64 ¶
func OSCreateAbsoluteDir ¶ added in v1.1.0
func OSCreateAbsolutePath ¶ added in v1.1.0
func OSFilePathExists ¶ added in v1.1.0
func OSOpenFileWithCreate ¶ added in v1.1.0
func OSRemoveFile ¶ added in v1.1.0
func SilentFatalError ¶ added in v1.1.4
func SilentFatalError(err error)
SilentFatalError only used in dev env or test env, _test file not to use in production env
func SilentHandleError ¶
SilentHandleError only used in dev env or test env, _test file not to use in production env
func SilentPanicError ¶ added in v1.1.0
func SilentPanicError(err error)
SilentPanicError only used in dev env or test env, _test file not to use in production env
func String2BytesNoCopy ¶
func StringConcat ¶
func StringJoin ¶ added in v1.1.0
func StringReplaceAlls ¶ added in v1.1.0
func TODOContext ¶ added in v1.1.0
func TarIOReader2File ¶ added in v1.1.4
func Timestamp2CST ¶ added in v1.1.0
Timestamp2CST Convert (Unix timestamp) to (CST: UTC+8)
func URLWithHTTP ¶
func URLWithoutHTTP ¶ added in v1.1.0
Types ¶
type JSONEncoder ¶ added in v1.1.0
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
func NewPageConfig ¶
func (*Page) PageIntValue ¶ added in v1.1.0
func (*Page) SizeIntValue ¶ added in v1.1.0
func (*Page) WithOffsetNum ¶
func (*Page) WithPageNum ¶
func (*Page) WithPageSize ¶
type StdJSONEncoder ¶ added in v1.1.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.