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

app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 14 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 = ports.ErrJournalAlreadyExists

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 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 CreateBookmarkCommand struct {
	URL  string
	Tags []string
}

type CreateBookmarkHandler

type CreateBookmarkHandler struct {
	// contains filtered or unexported fields
}

func (*CreateBookmarkHandler) Handle

type CreateBookmarkResult

type CreateBookmarkResult struct{ Bookmark *bookmarks.Bookmark }

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

Handle creates and persists a habit, returning it only after a successful save.

type CreateHabitResult added in v0.3.0

type CreateHabitResult struct {
	Habit *habits.Habit
}

type CreateInboxCommand added in v0.3.0

type CreateInboxCommand struct {
	Content string
	Tags    []string
}

type CreateInboxHandler added in v0.3.0

type CreateInboxHandler struct {
	// contains filtered or unexported fields
}

func (*CreateInboxHandler) Handle added in v0.3.0

type CreateInboxResult added in v0.3.0

type CreateInboxResult struct{ Inbox *inbox.Inbox }

type CreateJournalCommand

type CreateJournalCommand struct {
	Date string
	Tags []string
}

CreateJournalCommand accepts an optional YYYY-MM-DD date; empty means today.

type CreateJournalHandler

type CreateJournalHandler struct {
	// contains filtered or unexported fields
}

func (*CreateJournalHandler) Handle

type CreateJournalResult

type CreateJournalResult struct{ Journal *journals.Journal }

type CreatePageCommand

type CreatePageCommand struct {
	Title string
	Area  string
	Tags  []string
}

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 CreatePageResult struct{ Page *pages.Page }

type CreatePersonCommand

type CreatePersonCommand struct {
	Name   string
	Groups []string
	Tags   []string
}

type CreatePersonHandler

type CreatePersonHandler struct {
	// contains filtered or unexported fields
}

func (*CreatePersonHandler) Handle

type CreatePersonResult

type CreatePersonResult struct{ Person *persons.Person }

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 DeleteNoteResult struct{ ID uuid.UUID }

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

type ListNotesQuery struct {
	Type   string
	Tag    string
	Limit  int
	Offset int
}

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 }

Jump to

Keyboard shortcuts

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