Documentation
¶
Overview ¶
Package identitypb provides the "well-known" Identity type for representing application and handler (etc) identifies as Protocol Buffers messages.
Index ¶
- Variables
- type Identity
- func (*Identity) Descriptor() ([]byte, []int)deprecated
- func (x *Identity) Equal(id *Identity) bool
- func (x *Identity) Format(f fmt.State, verb rune)
- func (x *Identity) GetKey() *uuidpb.UUID
- func (x *Identity) GetName() string
- func (x *Identity) MarshalBinary() ([]byte, error)
- func (*Identity) ProtoMessage()
- func (x *Identity) ProtoReflect() protoreflect.Message
- func (x *Identity) Reset()
- func (x *Identity) SetKey(v *uuidpb.UUID)
- func (x *Identity) SetName(v string)
- func (x *Identity) String() string
- func (x *Identity) UnmarshalBinary(data []byte) error
- func (x *Identity) Validate() error
- type IdentityBuilder
Constants ¶
This section is empty.
Variables ¶
var File_github_com_dogmatiq_enginekit_protobuf_identitypb_identity_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Identity ¶
type Identity struct {
// Name is the entity's human-readable name.
//
// The name should be unique enough to allow a human to identify the entity
// without ambiguity. There is no hard requirement for uniqueness.
//
// Entity names may be changed at any time.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Key is the entity's immutable, unique key.
//
// The key is used to uniquely identify the entity globally, and across all
// time. Every entity must have its own UUID, which must not be changed.
Key *uuidpb.UUID `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
Identity represents the identity of an entity.
It is used to identify Dogma applications, handlers, sites, streams, etc.
func MustParse ¶ added in v0.19.4
MustParse returns a new identity with the given name and key by parsing the key as a UUID, or panics if unable to do so.
func Parse ¶ added in v0.19.4
Parse returns a new identity with the given name and key by parsing the key as a UUID.
func (*Identity) Descriptor
deprecated
func (*Identity) Format ¶
Format implements the fmt.Formatter interface, allowing UUIDs to be formatted with functions from the fmt package.
func (*Identity) MarshalBinary ¶ added in v0.18.0
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *Identity to implement encoding.BinaryMarshaler.
func (*Identity) ProtoMessage ¶
func (*Identity) ProtoMessage()
func (*Identity) ProtoReflect ¶
func (x *Identity) ProtoReflect() protoreflect.Message
func (*Identity) UnmarshalBinary ¶ added in v0.18.0
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *Identity to implement encoding.BinaryUnmarshaler.
type IdentityBuilder ¶
type IdentityBuilder struct {
// contains filtered or unexported fields
}
func NewIdentityBuilder ¶
func NewIdentityBuilder() *IdentityBuilder
NewIdentityBuilder returns a builder that constructs Identity messages.
func (*IdentityBuilder) Build ¶
func (b *IdentityBuilder) Build() *Identity
Build returns a new Identity 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 (*IdentityBuilder) From ¶
func (b *IdentityBuilder) From(x *Identity) *IdentityBuilder
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 (*IdentityBuilder) WithKey ¶
func (b *IdentityBuilder) WithKey(v *uuidpb.UUID) *IdentityBuilder
WithKey configures the builder to set the Key field to v, then returns b.
func (*IdentityBuilder) WithName ¶
func (b *IdentityBuilder) WithName(v string) *IdentityBuilder
WithName configures the builder to set the Name field to v, then returns b.