Documentation
¶
Index ¶
- Constants
- Variables
- func GenOpenId() string
- func GenRandString(length int, elem StringElem) (code string)
- func GenSerialNo(prefix string, suffix string) string
- func GenUUIDv1() (id string, err error)
- func GenUUIDv4() (id string, err error)
- func SetupGenerator(generator GeneratorType, machine string) error
- type GeneratorType
- type IGenerator
- type StringElem
Constants ¶
View Source
const ( SnowflakeGenerator = GeneratorType(1) SnoyflakeGenerator = GeneratorType(2) )
View Source
const ( ElemLowerCharAndNum = StringElem(1) ElemUpperCharAndNum = StringElem(2) ElemAllChar = StringElem(3) )
Variables ¶
View Source
var ( Snowflake *snowflakeGenerator ErrNodeOverflow = errors.New("machine bit overflow") ErrNodeNotSetup = errors.New("node has not been setup") )
View Source
var ( Snoyflake *snoyflakeGenerator ErrInvalidIPFormat = errors.New("ip format error") )
Functions ¶
func GenRandString ¶
func GenRandString(length int, elem StringElem) (code string)
* Gen Rand String
func SetupGenerator ¶ added in v0.0.7
func SetupGenerator(generator GeneratorType, machine string) error
Types ¶
type GeneratorType ¶ added in v0.0.7
type GeneratorType uint8
type IGenerator ¶ added in v0.0.7
type StringElem ¶
type StringElem int
Click to show internal directories.
Click to hide internal directories.