uuid

package module
v0.0.0-...-daa44c2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 4 Imported by: 0

README

FUID - A more human Friendly UUID

FUID extends uuid with friendlyid to provide a more human friendly uuid.

FUID wraps a uuid, and only modifies the string representation of a uuid, including String(), Parse(), MarshalJson() and UnmarshalJson.

Install

go get github.com/edwardzjl/fuid

Usage

import uuid "github.com/edwardzjl/fuid"

id := uuid.New()

License

This project is under MIT License. See the LICENSE file for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Nil = UUID{uuid.Nil}

Functions

This section is empty.

Types

type UUID

type UUID struct {
	Content uuid.UUID
}

func MustParse

func MustParse(s string) UUID

func New

func New() UUID

func Parse

func Parse(raw string) (UUID, error)

func (UUID) MarshalJSON

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

func (*UUID) Scan

func (fid *UUID) Scan(src interface{}) error

func (UUID) String

func (fid UUID) String() string

func (UUID) URN

func (fid UUID) URN() string

URN returns the RFC 2141 URN form of uuid, urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid.

func (*UUID) UnmarshalJSON

func (fid *UUID) UnmarshalJSON(data []byte) error

func (UUID) Value

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

Jump to

Keyboard shortcuts

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