uuid

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: Apache-2.0 Imports: 4 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 struct {
	uuid.UUID
}

UUID is a thin wrapper around "github.com/satori/go.uuid".UUID that can be used as a gogo/protobuf customtype.

func FromBytes

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

FromBytes delegates to "github.com/satori/go.uuid".FromBytes and wraps the result in a UUID.

func FromString

func FromString(input string) (UUID, error)

FromString delegates to "github.com/satori/go.uuid".FromString and wraps the result in a UUID.

func FromUint128 added in v1.1.0

func FromUint128(input uint128.Uint128) UUID

FromUint128 delegates to "github.com/satori/go.uuid".FromBytes and wraps the result in a UUID.

func MakeV4

func MakeV4() UUID

MakeV4 delegates to "github.com/satori/go.uuid".NewV4 and wraps the result in a UUID.

func NewPopulatedUUID

func NewPopulatedUUID(r interface {
	Int63() int64
}) *UUID

NewPopulatedUUID returns a populated UUID.

func (UUID) Bytes

func (UUID) Bytes()

Bytes shadows (*github.com/satori/go.uuid.UUID).Bytes() to prevent UUID from implementing github.com/golang/protobuf/proto.raw, the semantics of which do not match the semantics of the shadowed method. See https://github.com/golang/protobuf/blob/5386fff/proto/text.go#L173:L176.

TODO(tamird): remove when fixed upstream. See https://github.com/gogo/protobuf/pull/227 and https://github.com/golang/protobuf/issues/311.

func (UUID) Equal added in v1.1.0

func (u UUID) Equal(t UUID) bool

Equal returns true iff the receiver equals the argument.

This method exists only to conform to the API expected by gogoproto's generated Equal implementations.

func (UUID) GetBytes

func (u UUID) GetBytes() []byte

GetBytes returns the UUID as a byte slice.

func (UUID) MarshalTo

func (u UUID) MarshalTo(data []byte) (int, error)

MarshalTo marshals u to data.

func (UUID) Short

func (u UUID) Short() string

Short returns the first eight characters of the output of String().

func (UUID) Size

func (u UUID) Size() int

Size returns the marshalled size of u, in bytes.

func (UUID) ToUint128 added in v1.1.0

func (u UUID) ToUint128() uint128.Uint128

ToUint128 returns the UUID as a Uint128.

func (*UUID) Unmarshal

func (u *UUID) Unmarshal(data []byte) error

Unmarshal unmarshals data to u.

Jump to

Keyboard shortcuts

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