Documentation ¶
Overview ¶
Package uuidpb provides the "well-known" UUID type for representing RFC 9562 (and formerly RFC 4122) UUIDs as Protocol Buffers messages.
Index ¶
- Variables
- func AsByteArray[T ~[16]B, B ~byte](x *UUID) T
- type UUID
- func (x *UUID) AsBytes() []byte
- func (x *UUID) AsString() string
- func (x *UUID) Compare(id *UUID) int
- func (x *UUID) DapperString() string
- func (*UUID) Descriptor() ([]byte, []int)deprecated
- func (x *UUID) Equal(id *UUID) bool
- func (x *UUID) Format(f fmt.State, verb rune)
- func (x *UUID) GetLower() uint64
- func (x *UUID) GetUpper() uint64
- func (x *UUID) Less(id *UUID) bool
- func (*UUID) ProtoMessage()
- func (x *UUID) ProtoReflect() protoreflect.Message
- func (x *UUID) Reset()
- func (x *UUID) SetLower(v uint64)
- func (x *UUID) SetUpper(v uint64)
- func (x *UUID) String() string
- func (x *UUID) Validate() error
- type UUIDBuilder
Constants ¶
This section is empty.
Variables ¶
var File_github_com_dogmatiq_enginekit_protobuf_uuidpb_uuid_proto protoreflect.FileDescriptor
Functions ¶
func AsByteArray ¶
AsByteArray returns the UUID as a byte array.
Types ¶
type UUID ¶
type UUID struct { Upper uint64 `protobuf:"varint,1,opt,name=upper,proto3" json:"upper,omitempty"` Lower uint64 `protobuf:"varint,2,opt,name=lower,proto3" json:"lower,omitempty"` // contains filtered or unexported fields }
UUID is a size-optimized representation of an RFC 9562 UUID.
func FromByteArray ¶
FromByteArray returns a UUID from a byte array.
func MustParse ¶ added in v0.12.0
MustParse parses an RFC 9562 "hex-and-dash" UUID string, or panics if unable to do so.
func (*UUID) DapperString ¶
DapperString implements github.com/dogmatiq/dapper.Stringer.
func (*UUID) Descriptor
deprecated
func (*UUID) Format ¶
Format implements the fmt.Formatter interface, allowing UUIDs to be formatted with functions from the fmt package.
This method takes precedence over the UUID.String method, which is generated by the Protocol Buffers compiler.
func (*UUID) ProtoMessage ¶
func (*UUID) ProtoMessage()
func (*UUID) ProtoReflect ¶
func (x *UUID) ProtoReflect() protoreflect.Message
type UUIDBuilder ¶
type UUIDBuilder struct {
// contains filtered or unexported fields
}
func NewUUIDBuilder ¶
func NewUUIDBuilder() *UUIDBuilder
NewUUIDBuilder returns a builder that constructs UUID messages.
func (*UUIDBuilder) Build ¶
func (b *UUIDBuilder) Build() *UUID
Build returns a new UUID containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*UUIDBuilder) From ¶
func (b *UUIDBuilder) From(x *UUID) *UUIDBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*UUIDBuilder) WithLower ¶
func (b *UUIDBuilder) WithLower(v uint64) *UUIDBuilder
WithLower configures the builder to set the Lower field to v, then returns b.
func (*UUIDBuilder) WithUpper ¶
func (b *UUIDBuilder) WithUpper(v uint64) *UUIDBuilder
WithUpper configures the builder to set the Upper field to v, then returns b.