uid

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID snowflake.ID

func New

func New() ID

func Parse added in v0.5.5

func Parse(b []byte) (ID, error)

func ParsePolymorphicID added in v0.5.8

func ParsePolymorphicID(pid PolymorphicID) (ID, error)

func ParseString added in v0.5.5

func ParseString(s string) (ID, error)

func (*ID) MarshalText

func (u *ID) MarshalText() ([]byte, error)

func (ID) String

func (u ID) String() string

func (*ID) UnmarshalText

func (u *ID) UnmarshalText(b []byte) error

type PolymorphicID added in v0.5.8

type PolymorphicID string

PolymorphicID is a reference of the format "u:<idstr>" for users, "m:<idstr>" for machines, and "g:<idstr>" for groups

func NewGroupPolymorphicID added in v0.5.8

func NewGroupPolymorphicID(id ID) PolymorphicID

func NewMachinePolymorphicID added in v0.5.8

func NewMachinePolymorphicID(id ID) PolymorphicID

func NewUserPolymorphicID added in v0.5.8

func NewUserPolymorphicID(id ID) PolymorphicID

func (PolymorphicID) ID added in v0.5.8

func (p PolymorphicID) ID() (ID, error)

func (PolymorphicID) IsGroup added in v0.5.8

func (p PolymorphicID) IsGroup() bool

func (PolymorphicID) IsMachine added in v0.5.8

func (p PolymorphicID) IsMachine() bool

func (PolymorphicID) IsUser added in v0.5.8

func (p PolymorphicID) IsUser() bool

func (PolymorphicID) String added in v0.5.9

func (p PolymorphicID) String() string

Jump to

Keyboard shortcuts

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