Documentation ¶
Index ¶
- Variables
- type CommandHandler
- func (c *CommandHandler) CreateTodoHandler(ctx context.Context, command CreateTodo) error
- func (c *CommandHandler) DeleteHandler(ctx context.Context, command DeleteTodo) error
- func (c *CommandHandler) DoTodoHandler(ctx context.Context, command DoTodo) error
- func (c *CommandHandler) UndoTodoHandler(ctx context.Context, command UndoTodo) error
- func (c *CommandHandler) UpdateTodoHandler(ctx context.Context, command UpdateTodo) error
- type CreateTodo
- type DeleteTodo
- type DoTodo
- type FindAllTodos
- type FindTodoByID
- type QueryHandler
- type Todo
- func (t *Todo) Delete()
- func (t *Todo) Do() error
- func (t *Todo) TodoID() uuid.UUID
- func (t *Todo) Undo() error
- func (t *Todo) Update(title, description string, deadline time.Time)
- func (t *Todo) WhenTodoWasCreated(e TodoWasCreated, _ map[string]interface{})
- func (t *Todo) WhenTodoWasDeleted(_ TodoWasDeleted, _ map[string]interface{})
- func (t *Todo) WhenTodoWasDone(_ TodoWasDone, _ map[string]interface{})
- func (t *Todo) WhenTodoWasUndone(_ TodoWasUndone, _ map[string]interface{})
- func (t *Todo) WhenTodoWasUpdated(e TodoWasUpdated, _ map[string]interface{})
- type TodoCollection
- type TodoFinder
- type TodoView
- type TodoWasCreated
- type TodoWasDeleted
- type TodoWasDone
- type TodoWasUndone
- type TodoWasUpdated
- type UndoTodo
- type UpdateTodo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTodoAlreadyDone = errors.New("Todo is already done")
View Source
var ErrTodoNotDone = errors.New("Todo is not done")
View Source
var ErrTodoNotFound = errors.New("Todo was not found")
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
func NewCommandHandler ¶
func NewCommandHandler(repo TodoCollection) *CommandHandler
func (*CommandHandler) CreateTodoHandler ¶
func (c *CommandHandler) CreateTodoHandler(ctx context.Context, command CreateTodo) error
func (*CommandHandler) DeleteHandler ¶
func (c *CommandHandler) DeleteHandler(ctx context.Context, command DeleteTodo) error
func (*CommandHandler) DoTodoHandler ¶
func (c *CommandHandler) DoTodoHandler(ctx context.Context, command DoTodo) error
func (*CommandHandler) UndoTodoHandler ¶
func (c *CommandHandler) UndoTodoHandler(ctx context.Context, command UndoTodo) error
func (*CommandHandler) UpdateTodoHandler ¶
func (c *CommandHandler) UpdateTodoHandler(ctx context.Context, command UpdateTodo) error
type CreateTodo ¶
type DeleteTodo ¶
type DeleteTodo struct {
TodoID string `json:"todo_id" binding:"required,uuid4"`
}
type FindAllTodos ¶
type FindAllTodos struct{}
type FindTodoByID ¶
type FindTodoByID struct {
TodoID string
}
type QueryHandler ¶
type QueryHandler struct {
// contains filtered or unexported fields
}
func NewQueryHandler ¶
func NewQueryHandler(finder TodoFinder) *QueryHandler
func (*QueryHandler) FindAllTodosHandler ¶
func (qh *QueryHandler) FindAllTodosHandler(ctx context.Context, _ FindAllTodos) ([]TodoView, error)
func (*QueryHandler) FindTodoByIDHandler ¶
func (qh *QueryHandler) FindTodoByIDHandler(ctx context.Context, query FindTodoByID) (TodoView, error)
type Todo ¶
type Todo struct { eventstore.BaseAggregate Title string Description string Done bool Deleted bool Deadline time.Time }
func TodoFromHistory ¶
func TodoFromHistory(events eventstore.DomainEventIterator) *Todo
func (*Todo) WhenTodoWasCreated ¶
func (t *Todo) WhenTodoWasCreated(e TodoWasCreated, _ map[string]interface{})
func (*Todo) WhenTodoWasDeleted ¶
func (t *Todo) WhenTodoWasDeleted(_ TodoWasDeleted, _ map[string]interface{})
func (*Todo) WhenTodoWasDone ¶
func (t *Todo) WhenTodoWasDone(_ TodoWasDone, _ map[string]interface{})
func (*Todo) WhenTodoWasUndone ¶
func (t *Todo) WhenTodoWasUndone(_ TodoWasUndone, _ map[string]interface{})
func (*Todo) WhenTodoWasUpdated ¶
func (t *Todo) WhenTodoWasUpdated(e TodoWasUpdated, _ map[string]interface{})
type TodoCollection ¶
type TodoFinder ¶
type TodoWasCreated ¶
type TodoWasDeleted ¶
type TodoWasDeleted struct{}
type TodoWasDone ¶
type TodoWasDone struct{}
type TodoWasUndone ¶
type TodoWasUndone struct{}
type TodoWasUpdated ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.