uuid

package module
v0.0.0-...-4e88d6b Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

README

uuid

Build Status GoDoc

Subpackages: nulluuid GoDoc

UUID type implementation for Go language.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID [uuidLen]byte

UUID representation compliant with specification described in RFC 4122.

func FromBytes

func FromBytes(b []byte) (u UUID, err error)

FromBytes creates a UUID object from given bytes slice.

func FromCleanString

func FromCleanString(s string) (u UUID, err error)

FromCleanString creates a UUID object from given hex string in lower case without any additional chars.

uuid.FromCleanString("6ba7b8149dad11d180b400c04fd430c8")

func FromString

func FromString(s string) (u UUID, err error)

FromString creates a UUID object from given hex string representation. Function accepts UUID string in following formats:

uuid.FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")

func Null

func Null() UUID

Null returns NULL UUID (all bytes are zero).

func (UUID) Bytes

func (u UUID) Bytes() []byte

Bytes returns byte slice containing UUID (as-is).

func (UUID) CleanString

func (u UUID) CleanString() string

CleanString returns clean string representation of UUID (without any additional chars and in lower case).

func (UUID) Encode

func (u UUID) Encode(w *pgx.WriteBuf, oid pgx.Oid) error

Encode implements the pgx.Encoder interface.

func (UUID) FormatCode

func (u UUID) FormatCode() int16

FormatCode implements the pgx.Encoder interface.

func (UUID) IsNull

func (u UUID) IsNull() bool

IsNull return true if UUID is NULL (all bytes are zero).

func (*UUID) ParseBytes

func (u *UUID) ParseBytes(b []byte) (err error)

ParseBytes extract UUID from byte slice (as-is).

func (*UUID) ParseCleanString

func (u *UUID) ParseCleanString(s string) (err error)

ParseCleanString extract UUID from clean string UUID representation (like "6ba7b8149dad11d180b400c04fd430c8").

func (*UUID) ParseString

func (u *UUID) ParseString(s string) (err error)

ParseString extract UUID from its standard string representation (like "6ba7b814-9dad-11d1-80b4-00c04fd430c8").

func (*UUID) Scan

func (u *UUID) Scan(vr *pgx.ValueReader) error

Scan implements the pgx.Scanner interface.

func (UUID) String

func (u UUID) String() string

String returns string representation of UUID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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