common

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: LGPL-3.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

View Source
const Precision = 8

Variables

This section is empty.

Functions

func GZipCompress added in v0.1.11

func GZipCompress(p []byte) ([]byte, error)

GZipCompress gzip compress

func GZipDecompress added in v0.1.11

func GZipDecompress(binary []byte) ([]byte, error)

GZipDecompress gzip decompress

func IsUUID added in v0.0.3

func IsUUID(id string) bool

func MarshalMsgpack

func MarshalMsgpack(v interface{}) ([]byte, error)

func NewUUID added in v0.0.3

func NewUUID() uuid.UUID

func PKCS7Padding added in v0.1.11

func PKCS7Padding(data []byte, blockSizes ...int) []byte

*

  • PKCS7补码
  • 这里可以参考下http://blog.studygolang.com/167.html

func ParseFloat64

func ParseFloat64(value interface{}, args ...float64) float64

ParseFloat64 parse interface to float64

func ParseInt

func ParseInt(value interface{}, args ...int) int

ParseInt parse interface to int

func ParseInt64

func ParseInt64(value interface{}, args ...int64) int64

ParseInt64 parse interface to int64

func Split added in v0.1.11

func Split(buf []byte, lim int) [][]byte

func UUIDWithString added in v0.0.3

func UUIDWithString(text string) uuid.UUID

UUIDWithString generate uuid with text

func UnPKCS7Padding added in v0.1.11

func UnPKCS7Padding(data []byte) []byte

*

  • 去除PKCS7的补码

func UnmarshalMsgpack

func UnmarshalMsgpack(data []byte, val interface{}) error

Types

type Integer

type Integer struct {
	// contains filtered or unexported fields
}
var Zero Integer

func NewInteger

func NewInteger(x uint64) (v Integer)

func NewIntegerFromString

func NewIntegerFromString(x string) (v Integer)

func (Integer) Add

func (x Integer) Add(y Integer) (v Integer)

func (Integer) Cmp

func (x Integer) Cmp(y Integer) int

func (Integer) Div

func (x Integer) Div(y int) (v Integer)

func (Integer) MarshalJSON

func (x Integer) MarshalJSON() ([]byte, error)

func (Integer) MarshalMsgpack

func (x Integer) MarshalMsgpack() ([]byte, error)

func (Integer) Mul

func (x Integer) Mul(y int) (v Integer)

func (*Integer) Scan added in v0.0.7

func (d *Integer) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database deserialization.

func (Integer) Sign

func (x Integer) Sign() int

func (Integer) String

func (x Integer) String() string

func (Integer) Sub

func (x Integer) Sub(y Integer) (v Integer)

func (Integer) ToDecimal added in v0.0.4

func (x Integer) ToDecimal() decimal.Decimal

func (*Integer) UnmarshalJSON

func (x *Integer) UnmarshalJSON(b []byte) error

func (*Integer) UnmarshalMsgpack

func (x *Integer) UnmarshalMsgpack(data []byte) error

func (Integer) Value added in v0.0.7

func (d Integer) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database serialization.

Jump to

Keyboard shortcuts

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