ids

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllToString

func AllToString(ids []Id) []string

Types

type Id added in v0.48.0

type Id string

Id is a generic identifier for entities

func Empty

func Empty() Id

func FromBytes

func FromBytes(bytes []byte) (Id, error)

func FromUUID added in v0.6.0

func FromUUID(uuid uuid.UUID) Id

func New

func New() Id

func NewID added in v0.36.2

func NewID(values ...any) Id

NewID computes a UUID string hashing the provided values

func ParseID added in v0.28.1

func ParseID(id string) (Id, error)

func (Id) AsUUID added in v0.48.0

func (id Id) AsUUID() uuid.UUID

func (Id) Compare added in v0.48.0

func (id Id) Compare(other Id) int

func (Id) IsEmpty added in v0.48.0

func (id Id) IsEmpty() bool

func (Id) IsNotEmpty added in v0.48.0

func (id Id) IsNotEmpty() bool

func (Id) OrDefault added in v0.48.0

func (id Id) OrDefault(defaultId Id) Id

OrDefault returns the defaultId if id is empty, otherwise returns id

func (Id) OrNew added in v0.48.0

func (id Id) OrNew() Id

OrNew returns a new Id if id is empty, otherwise returns id

func (Id) SelfOrNew added in v0.48.0

func (id Id) SelfOrNew() Id

SelfOrNew returns a new Id if id is empty, otherwise returns id Deprecated: use OrNew instead

func (Id) String added in v0.48.0

func (id Id) String() string

func (Id) ToBytes added in v0.48.0

func (id Id) ToBytes() []byte

func (Id) Validate added in v0.48.0

func (id Id) Validate() error

Jump to

Keyboard shortcuts

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