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

ports

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: 4 Imported by: 0

Documentation

Overview

Package ports defines the infrastructure required by the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDGenerator

type IDGenerator interface {
	Generate() uuid.UUID
}

IDGenerator generates note identifiers.

type IndexAttribute

type IndexAttribute struct {
	Name  string
	Value string
}

IndexAttribute is a searchable name-value pair associated with a note.

type IndexRecord

type IndexRecord struct {
	ID         uuid.UUID
	Kind       domain.NoteKind
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Attributes []IndexAttribute
	Tags       []string
}

IndexRecord contains metadata recovered from one note document.

type NoteDeleter

type NoteDeleter interface {
	Delete(context.Context, uuid.UUID) error
}

NoteDeleter removes a note document by its identifier.

type NoteIndex

type NoteIndex interface {
	Upsert(context.Context, domain.Note) error
	UpsertRecord(context.Context, IndexRecord) error
	Delete(context.Context, uuid.UUID) error
	JournalExists(context.Context, domain.Date) (bool, error)
	JournalID(context.Context, domain.Date) (uuid.UUID, bool, error)
	ReplaceAll(context.Context, []IndexRecord) error
}

NoteIndex indexes note metadata.

type NoteLister

type NoteLister interface {
	List(context.Context) ([]IndexRecord, error)
}

NoteLister reads indexed note metadata without depending on a presentation.

type NoteParser

type NoteParser interface {
	Parse([]byte) (IndexRecord, error)
}

NoteParser recovers indexable metadata from one document.

type NoteReader

type NoteReader interface {
	Read(context.Context, uuid.UUID) ([]byte, error)
}

NoteReader reads a note document by its identifier.

type NoteRenderer

type NoteRenderer interface {
	Render(context.Context, domain.Note) ([]byte, error)
}

NoteRenderer renders a note as a document.

type NoteWalker

type NoteWalker interface {
	Walk(context.Context, func(path string, content []byte) error) error
}

NoteWalker visits AsciiDoc note files and supplies their content.

type NoteWriter

type NoteWriter interface {
	Write(context.Context, uuid.UUID, []byte) (string, error)
}

NoteWriter persists a rendered note.

Jump to

Keyboard shortcuts

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