Documentation ¶
Index ¶
Constants ¶
View Source
const AggregateType = "todo"
View Source
const TypeCreated = AggregateType + ".created.v1"
View Source
const TypeTaskAdded = AggregateType + ".task-added.v1" // or "task.added.v1" this semantic is up to you
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddTaskParams ¶
type CreateParams ¶
type CreateParams struct {
Name string `json:"name"`
}
type Todo ¶
type Todo struct { Name string `json:"name"` Tasks []task `json:"tasks"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
func (*Todo) StorageName ¶
StorageName returns the name of the table or collection where the events are stored. If Todo do not implement this method, the default name used will be the AggregateType. By convention in some database server like Postgres, the table name should be in plural. This is why implementing this method is made possible here to override the table name.
func (*Todo) Zero ¶
func (t *Todo) Zero() eventsourcing.AggregateState
Click to show internal directories.
Click to hide internal directories.