Help us shape the future of Go! Take the 2026 Go Developer Survey

app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package app exposes the application's use-case handlers to input adapters.

Index

Constants

This section is empty.

Variables

View Source
var ErrJournalAlreadyExists = errors.New("journal already exists")

ErrJournalAlreadyExists indicates that a journal exists for a date.

View Source
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

type Application struct {
	Commands Commands
	Queries  Queries
}

Application groups the use-case handlers exposed by Overmind.

func New

func New(dependencies Dependencies) *Application

New creates the application handlers.

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

type CaptureResult struct {
	Inbox domain.Inbox
	Path  string
}

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

type CreateBookmarkCommand struct {
	URL  domain.URL
	Tags domain.Tags
}

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

Handle creates, persists and indexes a bookmark.

type CreateBookmarkResult

type CreateBookmarkResult struct {
	Bookmark domain.Bookmark
	Path     string
}

CreateBookmarkResult contains the created bookmark and its path.

type CreateJournalCommand

type CreateJournalCommand struct {
	Tags domain.Tags
}

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

Handle creates, persists and indexes today's journal note.

type CreateJournalResult

type CreateJournalResult struct {
	Journal domain.Journal
	Path    string
}

CreateJournalResult contains the created journal and its path.

type CreatePageCommand

type CreatePageCommand struct {
	Title domain.Title
	Area  domain.Area
	Tags  domain.Tags
}

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

type CreatePageResult struct {
	Page domain.Page
	Path string
}

CreatePageResult contains the created page and its path.

type CreatePersonCommand

type CreatePersonCommand struct {
	Name   domain.Title
	Groups domain.Groups
	Tags   domain.Tags
}

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

Handle creates, persists and indexes a person.

type CreatePersonResult

type CreatePersonResult struct {
	Person domain.Person
	Path   string
}

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.

func (*DeleteNoteHandler) Handle

func (handler *DeleteNoteHandler) Handle(ctx context.Context, id uuid.UUID) error

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.

func (*FindJournalHandler) Handle

func (handler *FindJournalHandler) Handle(ctx context.Context, date domain.Date) (uuid.UUID, bool, error)

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.

func (*OpenNoteHandler) Handle

func (handler *OpenNoteHandler) Handle(ctx context.Context, id uuid.UUID) ([]byte, error)

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

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

type UpdateNoteCommand struct {
	ID       uuid.UUID
	Original []byte
	Source   []byte
}

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

type UpdateNoteResult struct {
	Path   string
	Source []byte
}

UpdateNoteResult returns the exact persisted source, including its new timestamp.

Jump to

Keyboard shortcuts

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