uuid

package
v0.0.0-...-3f120a3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID uuid.UUID

UUID google uuid

func New

func New() UUID

New 生成UUIDv4

func NewOrderedUUID

func NewOrderedUUID() (ou UUID, err error)

NewOrderedUUID 生成有序UUID

func NewUUIDv1

func NewUUIDv1() (u1 UUID, err error)

NewUUIDv1 生成UUIDv1

func Parse

func Parse(s string) (UUID, error)

Parse 将字符串解析为 UUID

func (UUID) Format

func (b UUID) Format() string

Format 返回uuid字符串, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

func (UUID) GormDBDataType

func (b UUID) GormDBDataType(db *gorm.DB, _ *schema.Field) string

GormDBDataType 数据库的数据类型

func (UUID) MarshalJSON

func (b UUID) MarshalJSON() ([]byte, error)

func (*UUID) Scan

func (b *UUID) Scan(value interface{}) (err error)

Scan scan uuid

func (UUID) String

func (b UUID) String() string

String 返回uuid字符串

func (*UUID) UnmarshalJSON

func (b *UUID) UnmarshalJSON(by []byte) (err error)

func (UUID) Value

func (b UUID) Value() (driver.Value, error)

Value get uuid value

Jump to

Keyboard shortcuts

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