utils

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PageIndexDefault = 1
	PageSizeDefault  = 20
)

Variables

This section is empty.

Functions

func EightBitRand

func EightBitRand() string

func GenMicTime

func GenMicTime() int64

生成毫秒时间戳

func GenMicTimeStr

func GenMicTimeStr() string

生成毫秒时间戳字符串

func ID

func ID(result sql.Result, err error) (int64, error)

ID

func Map2Struct

func Map2Struct(input, result interface{})

func MicTimeToFormatStr

func MicTimeToFormatStr() string

毫秒时间戳转字符串

func MicTimeToStr

func MicTimeToStr(i64 int64) string

毫秒时间戳转字符串

func OddsCompute

func OddsCompute(o1, o2 float64) bool

func R

func R(result sql.Result, err error) error

影响结果判断

func S2F64

func S2F64(idS string) (float64, error)

func S2I32

func S2I32(idS string) (int32, error)

func S2ID

func S2ID(idS string) (int64, error)

func S2N

func S2N(idS string) (int64, error)

func StrMicTimeToStr

func StrMicTimeToStr(s string) (string, error)

毫秒时间戳转字符串

func StrToMicTime

func StrToMicTime(s string) string

字符串转毫秒时间戳

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

func V

func V(fns ...vFn) error

验证

Types

type Page

type Page struct {
	PageIndex int64 `json:"page_index"` // 页面索引
	PageSize  int64 `json:"page_size"`  // 每页大小
	PageTotal int64 `json:"page_total"` // 总分页数
	Count     int64 `json:"count"`      // 当页记录数
	Total     int64 `json:"total"`      // 总记录数
}

分页

func (*Page) InitPage

func (p *Page) InitPage(total int64)

* 初始化分页

Jump to

Keyboard shortcuts

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