util

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ki = 1 << 10
	Mi = 1 << 20
	Gi = 1 << 30
	Ti = 1 << 40
	Pi = 1 << 50
	Ei = 1 << 60

	JSONMarshalIndent = "  "
)

<binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei refer from: resource/quantity.go

Variables

View Source
var (
	DefaultPage = NewPageConfig(1, 10)
)

immutable default page

Functions

func Bytes2StringNoCopy

func Bytes2StringNoCopy(bs []byte) string

func New

func New[T any](val T) *T

func NewBool

func NewBool(bVar bool) *bool

func NewFloat32

func NewFloat32(f32 float32) *float32

func NewFloat64

func NewFloat64(f64 float64) *float64

func NewInt32

func NewInt32(i32 int32) *int32

func NewInt64

func NewInt64(i64 int64) *int64

func NewString

func NewString(str string) *string

func SilentHandleError

func SilentHandleError(handle string, err error)

func String2BytesNoCopy

func String2BytesNoCopy(s string) []byte

func StringConcat

func StringConcat(s ...string) string

func URLWithHTTP

func URLWithHTTP(url string) string

Types

type Func

type Func func() error

type Page

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

func NewPageConfig

func NewPageConfig(pageNum, pageSize int64) *Page

func (*Page) Page

func (p *Page) Page() *int64

func (*Page) Pair

func (p *Page) Pair() (*int64, *int64)

func (*Page) Size

func (p *Page) Size() *int64

func (*Page) WithOffsetNum

func (p *Page) WithOffsetNum(offsetNum int64) *Page

func (*Page) WithPageNum

func (p *Page) WithPageNum(pageNum int64) *Page

func (*Page) WithPageSize

func (p *Page) WithPageSize(pageSize int64) *Page

Jump to

Keyboard shortcuts

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