Documentation
¶
Overview ¶
Package app exposes the application's use-case handlers to input adapters.
Index ¶
- Variables
- type Application
- type CaptureCommand
- type CaptureHandler
- type CaptureResult
- type Commands
- type CreateBookmarkCommand
- type CreateBookmarkHandler
- type CreateBookmarkResult
- type CreateJournalCommand
- type CreateJournalHandler
- type CreateJournalResult
- type CreatePageCommand
- type CreatePageHandler
- type CreatePageResult
- type CreatePersonCommand
- type CreatePersonHandler
- type CreatePersonResult
- type DeleteNoteHandler
- type Dependencies
- type FindJournalHandler
- type ListNotesHandler
- type ListNotesResult
- type ListedNote
- type OpenNoteHandler
- type Queries
- type RebuildIndexHandler
- type RebuildIndexResult
- type UpdateNoteCommand
- type UpdateNoteHandler
- type UpdateNoteResult
Constants ¶
This section is empty.
Variables ¶
var ErrJournalAlreadyExists = errors.New("journal already exists")
ErrJournalAlreadyExists indicates that a journal exists for a date.
var ErrNoteChanged = errors.New("note changed since it was opened")
ErrNoteChanged reports that the stored document differs from the opened version.
Functions ¶
This section is empty.
Types ¶
type Application ¶
Application groups the use-case handlers exposed by Overmind.
type CaptureCommand ¶
type CaptureCommand struct {
Content string
}
CaptureCommand contains the input for capturing an inbox note.
type CaptureHandler ¶
type CaptureHandler struct {
// contains filtered or unexported fields
}
CaptureHandler captures inbox notes.
func (*CaptureHandler) Handle ¶
func (handler *CaptureHandler) Handle(ctx context.Context, command CaptureCommand) (CaptureResult, error)
Handle creates, persists and indexes an inbox note.
type CaptureResult ¶
CaptureResult contains the captured inbox note and its path.
type Commands ¶
type Commands struct {
CreatePage *CreatePageHandler
CreatePerson *CreatePersonHandler
CreateJournal *CreateJournalHandler
Capture *CaptureHandler
CreateBookmark *CreateBookmarkHandler
RebuildIndex *RebuildIndexHandler
UpdateNote *UpdateNoteHandler
DeleteNote *DeleteNoteHandler
}
Commands contains the application's state-changing handlers.
type CreateBookmarkCommand ¶
CreateBookmarkCommand contains the input for creating a bookmark.
type CreateBookmarkHandler ¶
type CreateBookmarkHandler struct {
// contains filtered or unexported fields
}
CreateBookmarkHandler creates bookmark notes.
func (*CreateBookmarkHandler) Handle ¶
func (handler *CreateBookmarkHandler) Handle(ctx context.Context, command CreateBookmarkCommand) (CreateBookmarkResult, error)
Handle creates, persists and indexes a bookmark.
type CreateBookmarkResult ¶
CreateBookmarkResult contains the created bookmark and its path.
type CreateJournalCommand ¶
CreateJournalCommand contains the input for creating a journal.
type CreateJournalHandler ¶
type CreateJournalHandler struct {
// contains filtered or unexported fields
}
CreateJournalHandler creates journal notes.
func (*CreateJournalHandler) Handle ¶
func (handler *CreateJournalHandler) Handle(ctx context.Context, command CreateJournalCommand) (CreateJournalResult, error)
Handle creates, persists and indexes today's journal note.
type CreateJournalResult ¶
CreateJournalResult contains the created journal and its path.
type CreatePageCommand ¶
CreatePageCommand contains the input for creating a page.
type CreatePageHandler ¶
type CreatePageHandler struct {
// contains filtered or unexported fields
}
CreatePageHandler creates page notes.
func (*CreatePageHandler) Handle ¶
func (handler *CreatePageHandler) Handle(ctx context.Context, command CreatePageCommand) (CreatePageResult, error)
Handle creates, persists and indexes a page.
type CreatePageResult ¶
CreatePageResult contains the created page and its path.
type CreatePersonCommand ¶
CreatePersonCommand contains the input for creating a person.
type CreatePersonHandler ¶
type CreatePersonHandler struct {
// contains filtered or unexported fields
}
CreatePersonHandler creates person notes.
func (*CreatePersonHandler) Handle ¶
func (handler *CreatePersonHandler) Handle(ctx context.Context, command CreatePersonCommand) (CreatePersonResult, error)
Handle creates, persists and indexes a person.
type CreatePersonResult ¶
CreatePersonResult contains the created person and its path.
type DeleteNoteHandler ¶
type DeleteNoteHandler struct {
// contains filtered or unexported fields
}
DeleteNoteHandler removes a note document and its indexed metadata.
type Dependencies ¶
type Dependencies struct {
IDGenerator ports.IDGenerator
Renderer ports.NoteRenderer
Writer ports.NoteWriter
Reader ports.NoteReader
Deleter ports.NoteDeleter
Index ports.NoteIndex
Lister ports.NoteLister
Walker ports.NoteWalker
Parser ports.NoteParser
}
Dependencies contains the ports required by the application.
type FindJournalHandler ¶
type FindJournalHandler struct {
// contains filtered or unexported fields
}
FindJournalHandler finds the journal for a date without creating it.
type ListNotesHandler ¶
type ListNotesHandler struct {
// contains filtered or unexported fields
}
ListNotesHandler retrieves note metadata from the index.
func (*ListNotesHandler) Handle ¶
func (handler *ListNotesHandler) Handle(ctx context.Context) (ListNotesResult, error)
type ListNotesResult ¶
type ListNotesResult struct {
Notes []ListedNote
}
ListNotesResult contains notes ordered by most recent update first.
type ListedNote ¶
type ListedNote struct {
ID uuid.UUID
Kind domain.NoteKind
Attributes map[string]string
Tags []string
CreatedAt time.Time
UpdatedAt time.Time
}
ListedNote is the metadata of a note, independent of how clients display it.
type OpenNoteHandler ¶
type OpenNoteHandler struct {
// contains filtered or unexported fields
}
OpenNoteHandler reads an existing note without changing it.
type Queries ¶
type Queries struct {
ListNotes *ListNotesHandler
OpenNote *OpenNoteHandler
FindJournal *FindJournalHandler
}
Queries contains the application's read-only handlers.
type RebuildIndexHandler ¶
type RebuildIndexHandler struct {
// contains filtered or unexported fields
}
RebuildIndexHandler reconstructs the index from note documents.
func (*RebuildIndexHandler) Handle ¶
func (handler *RebuildIndexHandler) Handle(ctx context.Context) (RebuildIndexResult, error)
Handle parses every note before atomically replacing the index.
type RebuildIndexResult ¶
type RebuildIndexResult struct {
Count int
}
RebuildIndexResult reports how many notes were indexed.
type UpdateNoteCommand ¶
UpdateNoteCommand contains the new document and the source originally opened.
type UpdateNoteHandler ¶
type UpdateNoteHandler struct {
// contains filtered or unexported fields
}
UpdateNoteHandler validates and saves a complete edited AsciiDoc document.
func (*UpdateNoteHandler) Handle ¶
func (handler *UpdateNoteHandler) Handle(ctx context.Context, command UpdateNoteCommand) (UpdateNoteResult, error)
type UpdateNoteResult ¶
UpdateNoteResult returns the exact persisted source, including its new timestamp.