{"modulePath":"github.com/get-eventually/go-eventually/integrationtest","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package user\n\nPackage user serves as a small domain example of how to model an Aggregate using go-eventually.\n\nThis package is used for integration tests in the parent module.\n\n## Variables\n\n```go\nvar EventProtoSerde = serde.Fused[message.Message, *proto.Event]{\n\tSerializer:   serde.SerializerFunc[message.Message, *proto.Event](protoEventSerializer),\n\tDeserializer: serde.DeserializerFunc[message.Message, *proto.Event](protoEventDeserializer),\n}\n```\nEventProtoSerde is the serde.Serde implementation for User domain events to map to their Protobuf type, defined in the proto/ folder.\n\n```go\nvar ProtoSerde = serde.Fused[*User, *proto.User]{\n\tSerializer:   serde.SerializerFunc[*User, *proto.User](protoSerializer),\n\tDeserializer: serde.DeserializerFunc[*User, *proto.User](protoDeserializer),\n}\n```\nProtoSerde is the serde.Serde implementation for a User to map to its Protobuf type, defined in the proto/ folder.\n\n```go\nvar Type = aggregate.Type[uuid.UUID, *User]{\n\tName:    \"User\",\n\tFactory: func() *User { return \u0026User{} },\n}\n```\nType is the User aggregate type.\n\n## Types\n\n```go\ntype EmailWasUpdated struct {\n\tEmail string\n}\n```\nEmailWasUpdated is the domain event fired after a User email is updated.\n\n```go\nfunc (EmailWasUpdated) Name() string\n```\nName implements message.Message.\n\n```go\ntype User struct {\n\taggregate.BaseRoot\n\t// contains filtered or unexported fields\n}\n```\nUser is a naive user implementation, modeled as an Aggregate using go-eventually's API.\n\n```go\nfunc Create(id uuid.UUID, firstName, lastName, email string, birthDate time.Time) (*User, error)\n```\nCreate creates a new User using the provided input.\n\n```go\nfunc (user *User) AggregateID() uuid.UUID\n```\nAggregateID implements aggregate.Root.\n\n```go\nfunc (user *User) Apply(evt event.Event) error\n```\nApply implements aggregate.Aggregate.\n\n```go\nfunc (user *User) UpdateEmail(email string, metadata message.Metadata) error\n```\nUpdateEmail updates the User email with the specified one.\n\n```go\ntype WasCreated struct {\n\tID        uuid.UUID\n\tFirstName string\n\tLastName  string\n\tBirthDate time.Time\n\tEmail     string\n}\n```\nWasCreated is the domain event fired after a User is created.\n\n```go\nfunc (WasCreated) Name() string\n```\nName implements message.Message.\n\n","path":"github.com/get-eventually/go-eventually/integrationtest/user","name":"user","synopsis":"Package user serves as a small domain example of how to model an Aggregate using go-eventually.","isRedistributable":true}
