uuid

package
v0.0.0-...-a33e9ff Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 3 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 []byte

UUID represents a 16-byte universally unique identifier this type is a wrapper around google/uuid with the following differences

  • type is a byte slice instead of [16]byte so that it is compatible with some db drivers
  • db serialization converts uuid to bytes as opposed to string

func MustNewUUID

func MustNewUUID() UUID

func MustParsePtrUUID

func MustParsePtrUUID(s *string) UUID

MustParsePtrUUID returns a UUID parsed from the given string representation returns nil if the input is empty string panics if the given input is malformed

func MustParseUUID

func MustParseUUID(s string) UUID

MustParseUUID returns a UUID parsed from the given string representation returns nil if the input is empty string panics if the given input is malformed

func ParseUUID

func ParseUUID(s string) (UUID, error)

ParseUUID decodes s into a UUID or returns an error.

func UUIDPtr

func UUIDPtr(u UUID) *UUID

UUIDPtr simply returns a pointer for the given value type

func (*UUID) Scan

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

Scan implements sql.Scanner interface to allow this type to be parsed transparently by database drivers

func (UUID) String

func (u UUID) String() string

String returns the 36 byte hexstring representation of this uuid return empty string if this uuid is nil

func (UUID) Value

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

Value implements sql.Valuer so that UUIDs can be written to databases transparently. This method returns a byte slice representation of uuid

Jump to

Keyboard shortcuts

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