mid

package
v0.0.0-...-c3bbbbb Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetID

func GetID(id string) (int64, error)

GetID get value of id

func GetNext

func GetNext(name string) (int64, error)

Next generate a auto increment version ID for the given key

func IncrementCounter

func IncrementCounter(name string, num int64) (int64, error)

func ResetID

func ResetID(id string, value int64) (int64, error)

ResetID reset id gen to value

Types

type MIdGen

type MIdGen struct {
	Id  string `bson:"_id" json:"id"`
	Seq int64  `bson:"seq" json:"seq"`
}

func (MIdGen) String

func (id MIdGen) String() string

Jump to

Keyboard shortcuts

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