todo

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package todo is the domain of the quickstart service. It imports only the aggregate package, the stdlib and uuid, which depguard enforces.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoTitle reports opening a Task without a title.
	ErrNoTitle = errors.New("todo: task needs a title")
	// ErrAlreadyOpened reports opening a Task twice.
	ErrAlreadyOpened = errors.New("todo: task already opened")
	// ErrAlreadyDone reports completing a Task twice.
	ErrAlreadyDone = errors.New("todo: task already done")
)

Functions

This section is empty.

Types

type AssigneeNotified

type AssigneeNotified struct{}

AssigneeNotified records that the assignee was told about the Task.

func (AssigneeNotified) EventType

func (AssigneeNotified) EventType() string

EventType returns the permanent Event type of AssigneeNotified.

type Task

type Task struct {
	aggregate.Base[TaskID]
	// contains filtered or unexported fields
}

Task is the Aggregate of one task. Its zero value is a task not opened yet.

func (*Task) Apply

func (t *Task) Apply(e aggregate.Event)

Apply changes the Task's state for one event.

func (*Task) Complete

func (t *Task) Complete() error

Complete marks the Task as done.

func (*Task) MarkNotified

func (t *Task) MarkNotified()

MarkNotified records that the assignee was notified. It is idempotent, because a Reactor may deliver the same event twice.

func (*Task) Open

func (t *Task) Open(title, assignee string) error

Open opens the Task.

func (*Task) StreamType

func (*Task) StreamType() string

StreamType names the Task Aggregate.

type TaskCompleted

type TaskCompleted struct{}

TaskCompleted records that a Task is done.

func (TaskCompleted) EventType

func (TaskCompleted) EventType() string

EventType returns the permanent Event type of TaskCompleted.

type TaskID

type TaskID uuid.UUID

TaskID identifies a Task.

type TaskOpened

type TaskOpened struct {
	Title    string `json:"title"`
	Assignee string `json:"assignee"`
}

TaskOpened records a new Task.

func (TaskOpened) EventType

func (TaskOpened) EventType() string

EventType returns the permanent Event type of TaskOpened.

Jump to

Keyboard shortcuts

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