aggregate

package
v0.0.0-...-2af345c Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: AGPL-3.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 AggregateRoot

type AggregateRoot interface {
	// Get all the aggregate root's immutable events
	PullDomainEvents() []event.Domain
	// Register a new event
	Record(e event.Domain)
	// Parse binary data to struct
	UnmarshalBinary(data []byte) error
	// Parse current in-memory data to binary
	MarshalBinary() ([]byte, error)
	// Get an aggregate root primitive-only version
	ToPrimitive() interface{}
}

type UserRoot

type UserRoot struct {
	User *entity.User `json:"user"`
	// contains filtered or unexported fields
}

func NewUserRoot

func NewUserRoot(username value.Username, email value.Email) *UserRoot

func (UserRoot) MarshalBinary

func (r UserRoot) MarshalBinary() ([]byte, error)

MarshalBinary Parse current in-memory data to binary

func (UserRoot) PullDomainEvents

func (r UserRoot) PullDomainEvents() []event.Domain

PullDomainEvents Get all the aggregate root's immutable events

func (*UserRoot) Record

func (r *UserRoot) Record(e event.Domain)

Record Register a new event

func (UserRoot) ToPrimitive

func (r UserRoot) ToPrimitive() *UserRootPrimitive

ToPrimitive Get an aggregate root primitive-only version

func (*UserRoot) UnmarshalBinary

func (r *UserRoot) UnmarshalBinary(data []byte) error

UnmarshalBinary Parse binary data to struct

type UserRootPrimitive

type UserRootPrimitive struct {
	User *entity.UserPrimitive `json:"user"`
}

Jump to

Keyboard shortcuts

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