util

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxSequence  max sequence in one time
	MaxSequence = 1000
	// WorkerBit worker bit
	WorkerBit = 10
	// SequenceBit sequence bit
	SequenceBit = 10
)

Variables

This section is empty.

Functions

func Div

func Div(x, y float64) float64

Div div

func DivWithRound

func DivWithRound(x, y float64, places int) float64

DivWithRound div with round

func Mul

func Mul(x, y float64) float64

Mul mul

func MulWithRound

func MulWithRound(x, y float64, places int) float64

MulWithRound mul with round

func Round

func Round(val float64, places int) float64

Round round

func ToDayEnd

func ToDayEnd(t time.Time) time.Time

ToDayEnd .

func ToDayNoon

func ToDayNoon(t time.Time) time.Time

ToDayNoon .

func ToDayStart

func ToDayStart(t time.Time) time.Time

ToDayStart .

Types

type SnowFlake

type SnowFlake struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SnowFlake snow flake

func NewSnowFlake

func NewSnowFlake() *SnowFlake

NewSnowFlake new

func (*SnowFlake) Generate

func (s *SnowFlake) Generate() (int64, error)

Generate generate

Jump to

Keyboard shortcuts

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