Documentation ¶
Index ¶
- Variables
- type ShortStringer
- type UUID
- func (UUID) Bytes()
- func (u UUID) Equal(t UUID) bool
- func (u UUID) GetBytes() []byte
- func (u UUID) MarshalJSON() ([]byte, error)
- func (u UUID) MarshalTo(data []byte) (int, error)
- func (u UUID) Short() string
- func (u UUID) Size() int
- func (u UUID) ToUint128() uint128.Uint128
- func (u *UUID) Unmarshal(data []byte) error
- func (u *UUID) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
var Nil = UUID{uuid.Nil}
Nil is the empty UUID with all 128 bits set to zero.
Functions ¶
This section is empty.
Types ¶
type ShortStringer ¶
type ShortStringer UUID
ShortStringer implements fmt.Stringer to output Short() on String().
func (ShortStringer) String ¶
func (s ShortStringer) String() string
String is part of fmt.Stringer.
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 ¶
FromBytes delegates to "github.com/satori/go.uuid".FromBytes and wraps the result in a UUID.
func FromString ¶
FromString delegates to "github.com/satori/go.uuid".FromString and wraps the result in a UUID.
func FromUint128 ¶
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 ¶
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 ¶
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) MarshalJSON ¶
MarshalJSON returns the JSON encoding of u.
func (*UUID) UnmarshalJSON ¶
UnmarshalJSON unmarshals the JSON encoded data into u.