uuid

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

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 41

Documentation

Overview

Sorry.

Index

Constants

View Source
const (
	Size = satori.Size
)

Variables

View Source
var (
	Nil = UUID{}
)

Functions

func IsNil

func IsNil(id UUID) bool

Types

type NullUUID

type NullUUID struct {
	UUID  UUID
	Valid bool
}

NullUUID can be used with the standard sql package to represent a UUID value that can be NULL in the database

func (*NullUUID) Scan

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

Scan implements the sql.Scanner interface.

func (NullUUID) Value

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

Value implements the driver.Valuer interface.

type UUID

type UUID satori.UUID

func FromBytes

func FromBytes(raw []byte) (UUID, error)

func FromString

func FromString(raw string) (UUID, error)

func FromStringSlice

func FromStringSlice(raws []string) ([]UUID, error)

func NewV1

func NewV1() UUID

NewV1 returns UUID based on current timestamp and MAC address.

func NewV2

func NewV2(domain byte) UUID

NewV2 returns DCE Security UUID based on POSIX UID/GID.

func NewV3

func NewV3(ns UUID, name string) UUID

NewV3 returns UUID based on MD5 hash of namespace UUID and name.

func NewV4

func NewV4() UUID

NewV4 returns random generated UUID.

func NewV5

func NewV5(ns UUID, name string) UUID

NewV5 returns UUID based on SHA-1 hash of namespace UUID and name.

func (UUID) Bytes

func (uuid UUID) Bytes() []byte

func (UUID) GetBSON

func (uuid UUID) GetBSON() (interface{}, error)

func (UUID) IsNil

func (uuid UUID) IsNil() bool

func (UUID) MarshalText

func (uuid UUID) MarshalText() ([]byte, error)

func (*UUID) Scan

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

Scan implements the sql.Scanner interface.

func (*UUID) SetBSON

func (uuid *UUID) SetBSON(raw bson.Raw) error

func (UUID) String

func (uuid UUID) String() string

func (*UUID) UnmarshalText

func (uuid *UUID) UnmarshalText(data []byte) error

func (UUID) Value

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

Value implements the driver.Valuer interface.

Jump to

Keyboard shortcuts

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