uid

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 7 Imported by: 7

README

uid

Generate ID By time Nano

go mod

import "github.com/xs23933/uid"

id := uid.New()
fmt.Printf("%s, %v", id.String(), id)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Nil Null
	Nil = UID{}
)

Functions

This section is empty.

Types

type UID

type UID [size]byte

UID UID

func FromBytes

func FromBytes(data []byte) (UID, error)

func FromString

func FromString(input string) (UID, error)

FromString parse string

func New

func New() UID

New build uid

func (UID) Bytes

func (u UID) Bytes() []byte

Bytes out bytes

func (UID) GormDataType

func (UID) GormDataType() string

GormDataType schema.Field DataType

func (UID) IsEmpty

func (u UID) IsEmpty() bool

IsEmpty check is Empty

func (UID) MarshalBinary

func (u UID) MarshalBinary() ([]byte, error)

MarshalBinary MarshalBinary interface

func (UID) MarshalText

func (u UID) MarshalText() ([]byte, error)

MarshalText MarshalText interface

func (*UID) Scan

func (u *UID) Scan(src interface{}) error

Scan driver.Scaner

func (UID) String

func (u UID) String() string

String out string

func (*UID) UnmarshalBinary

func (u *UID) UnmarshalBinary(data []byte) error

UnmarshalBinary UnmarshalBinary interface

func (*UID) UnmarshalText

func (u *UID) UnmarshalText(text []byte) error

UnmarshalText UnmarshalText interface

func (UID) Value

func (u UID) Value() (driver.Value, error)

Value driver.sql

Jump to

Keyboard shortcuts

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