Documentation
¶
Overview ¶
Package app exposes the application's use-case handlers to input adapters.
Index ¶
- Variables
- type Application
- type Commands
- type CreateBookmarkCommand
- type CreateBookmarkHandler
- type CreateBookmarkResult
- type CreateHabitCommand
- type CreateHabitHandler
- type CreateHabitResult
- type CreateInboxCommand
- type CreateInboxHandler
- type CreateInboxResult
- type CreateJournalCommand
- type CreateJournalHandler
- type CreateJournalResult
- type CreatePageCommand
- type CreatePageHandler
- type CreatePageResult
- type CreatePersonCommand
- type CreatePersonHandler
- type CreatePersonResult
- type DeleteNoteCommand
- type DeleteNoteHandler
- type DeleteNoteResult
- type Dependencies
- type ListNotesHandler
- type ListNotesQuery
- type ListNotesResult
- type Queries
- type ReindexCommand
- type ReindexHandler
- type ReindexResult
Constants ¶
This section is empty.
Variables ¶
var ErrJournalAlreadyExists = ports.ErrJournalAlreadyExists
Functions ¶
This section is empty.
Types ¶
type Application ¶
Application groups the use-case handlers exposed by Overmind.
type Commands ¶
type Commands struct {
DeleteNote *DeleteNoteHandler
Reindex *ReindexHandler
CreateHabit *CreateHabitHandler
CreatePage *CreatePageHandler
CreatePerson *CreatePersonHandler
CreateJournal *CreateJournalHandler
CreateInbox *CreateInboxHandler
CreateBookmark *CreateBookmarkHandler
}
Commands contains the application's state-changing handlers.
type CreateBookmarkCommand ¶
type CreateBookmarkHandler ¶
type CreateBookmarkHandler struct {
// contains filtered or unexported fields
}
func (*CreateBookmarkHandler) Handle ¶
func (handler *CreateBookmarkHandler) Handle(ctx context.Context, command CreateBookmarkCommand) (CreateBookmarkResult, error)
type CreateBookmarkResult ¶
type CreateHabitCommand ¶ added in v0.3.0
type CreateHabitCommand struct {
Title string
Amount float64
Unit string
Period string
Tags []string
}
CreateHabitCommand defines an activity, its fixed goal and optional tags.
type CreateHabitHandler ¶ added in v0.3.0
type CreateHabitHandler struct {
// contains filtered or unexported fields
}
func (*CreateHabitHandler) Handle ¶ added in v0.3.0
func (handler *CreateHabitHandler) Handle(ctx context.Context, command CreateHabitCommand) (CreateHabitResult, error)
Handle creates and persists a habit, returning it only after a successful save.
type CreateHabitResult ¶ added in v0.3.0
type CreateInboxCommand ¶ added in v0.3.0
type CreateInboxHandler ¶ added in v0.3.0
type CreateInboxHandler struct {
// contains filtered or unexported fields
}
func (*CreateInboxHandler) Handle ¶ added in v0.3.0
func (handler *CreateInboxHandler) Handle(ctx context.Context, command CreateInboxCommand) (CreateInboxResult, error)
type CreateInboxResult ¶ added in v0.3.0
type CreateJournalCommand ¶
CreateJournalCommand accepts an optional YYYY-MM-DD date; empty means today.
type CreateJournalHandler ¶
type CreateJournalHandler struct {
// contains filtered or unexported fields
}
func (*CreateJournalHandler) Handle ¶
func (handler *CreateJournalHandler) Handle(ctx context.Context, command CreateJournalCommand) (CreateJournalResult, error)
type CreateJournalResult ¶
type CreatePageCommand ¶
CreatePageCommand requires a title; area and tags are optional raw inputs.
type CreatePageHandler ¶
type CreatePageHandler struct {
// contains filtered or unexported fields
}
func (*CreatePageHandler) Handle ¶
func (handler *CreatePageHandler) Handle(ctx context.Context, command CreatePageCommand) (CreatePageResult, error)
type CreatePageResult ¶
type CreatePersonCommand ¶
type CreatePersonHandler ¶
type CreatePersonHandler struct {
// contains filtered or unexported fields
}
func (*CreatePersonHandler) Handle ¶
func (handler *CreatePersonHandler) Handle(ctx context.Context, command CreatePersonCommand) (CreatePersonResult, error)
type CreatePersonResult ¶
type DeleteNoteCommand ¶ added in v0.3.0
type DeleteNoteCommand struct{ ID string }
DeleteNoteCommand identifies any kind of note using raw input.
type DeleteNoteHandler ¶
type DeleteNoteHandler struct {
// contains filtered or unexported fields
}
func (*DeleteNoteHandler) Handle ¶
func (handler *DeleteNoteHandler) Handle(ctx context.Context, command DeleteNoteCommand) (DeleteNoteResult, error)
Handle removes the source document before its derived index entry. Both removals are idempotent, so retrying also repairs a previous partial failure.
type DeleteNoteResult ¶ added in v0.3.0
type Dependencies ¶
type Dependencies struct {
NoteStore ports.NoteStore
IndexDeleter ports.NoteIndexDeleter
NoteScanner ports.NoteScanner
NoteProjector ports.NoteProjector
IndexRebuilder ports.IndexRebuilder
Pages ports.PageRepository
Journals ports.JournalRepository
Habits ports.HabitRepository
Persons ports.PersonRepository
Bookmarks ports.BookmarkRepository
Inbox ports.InboxRepository
IDGenerator ports.IDGenerator
NoteFinder ports.NoteFinder
}
Dependencies contains the ports required by the application.
type ListNotesHandler ¶
type ListNotesHandler struct {
// contains filtered or unexported fields
}
func (*ListNotesHandler) Handle ¶
func (handler *ListNotesHandler) Handle(ctx context.Context, query ListNotesQuery) (ListNotesResult, error)
type ListNotesQuery ¶ added in v0.3.0
ListNotesQuery filters the index; zero Limit defaults to 100 notes.
type ListNotesResult ¶
type ListNotesResult struct{ Notes []ports.NoteSummary }
type Queries ¶
type Queries struct{ ListNotes *ListNotesHandler }
Queries contains read-only application operations.
type ReindexCommand ¶ added in v0.3.0
type ReindexCommand struct{}
type ReindexHandler ¶ added in v0.3.0
type ReindexHandler struct {
// contains filtered or unexported fields
}
func (*ReindexHandler) Handle ¶ added in v0.3.0
func (handler *ReindexHandler) Handle(ctx context.Context, _ ReindexCommand) (ReindexResult, error)
Handle reconstructs the complete index from documents. A failed scan or projection rolls back the replacement, including removals of stale entries.
type ReindexResult ¶ added in v0.3.0
type ReindexResult struct{ Indexed int }