shortid

package
v0.19.784 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrefix

func GetPrefix(id string) (string, error)

func IsShortID

func IsShortID(val string) bool

func New

func New() string

New returns a new shortID

func NewNanoID

func NewNanoID(prefix string) string

NewNanoID returns a new nanoID

func ParseString

func ParseString(s string) (string, error)

ParseString parses a string uuid into a short id, returning an error if invalid

func ParseStrings

func ParseStrings(strs ...string) ([]string, error)

ParseStrings parses a list of string UUIDs into a list of shortids, failing all if any fail

func ParseUUID

func ParseUUID(u uuid.UUID) string

ParseUUID parses a uuid into a short id string

func RegisterFakes

func RegisterFakes()

func ToShortID

func ToShortID(s string) (string, error)

ToShortID coerces strings to shortids handling shortids or uuids as input An error will be returned for anything else, including empty string

func ToUUID

func ToUUID(s string) (uuid.UUID, error)

ToUUID converts a short id string back into a uuid

func ToUUIDs

func ToUUIDs(strs ...string) ([]uuid.UUID, error)

ToUUIDs parses a list of string shortids into a list of uuids, failing all if any fail

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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