Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHTTP ¶
func RegisterHTTP( srv *echo.Group, eventStore EventStore, taskStore TaskStore, projectStore ProjectStore, releaseStore ReleaseStore, userStore UserStore, ) error
Types ¶
type Event ¶
type Event struct { UUID uuid.UUID Type EventType EntityUUID uuid.UUID UserID string Payload []byte CreatedAt time.Time }
An Event is used to record every mutation requested by users.
type EventStore ¶
type EventStore interface { // Store e in the database/store. Store(ctx context.Context, e Event) error // List all the events from the store. List takes // a channel as input to make it more convenient // to scroll through all the events stored. List(ctx context.Context, ch chan<- Event) error }
An EventStore should store and retrieve Events.
type EventType ¶
type EventType string
const ( TaskCreate EventType = "TaskCreate" TaskUpdate EventType = "TaskUpdate" TaskDone EventType = "TaskDone" ReleaseCreate EventType = "ReleaseCreate" ProjectCreate EventType = "ProjectCreate" ProjectUpdate EventType = "ProjectUpdate" ProjectReorderTasks EventType = "ProjectReorderTasks" )
Event types
type Project ¶
type Project struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Slug string `json:"slug"` Description string `json:"description"` Releases []Release `json:"releases"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
A Project groups tasks.
type ProjectStore ¶
type ProjectStore interface { Upsert(ctx context.Context, p Project, u User) error List(ctx context.Context, u User) ([]Project, error) Get(ctx context.Context, uuid uuid.UUID, u User) (Project, error) Find(ctx context.Context, slug string, u User) (Project, error) }
A ProjectStore is responsible for storing projects, typically in a database.
type ReleaseStore ¶
type Task ¶
type Task struct { UUID uuid.UUID `json:"uuid"` Title string `json:"title"` Status TaskStatus `json:"status"` Release Release `json:"release"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
A Task is the basic object of Tonight.
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusTODO TaskStatus = "TODO" TaskStatusDONE TaskStatus = "DONE" )
Click to show internal directories.
Click to hide internal directories.