Documentation
¶
Overview ¶
Package codecs maps domain entities to managed AsciiDoc documents. Typed codecs validate headers and domain values, keeping body bytes verbatim. RawNoteCodec additionally checks complete document syntax before raw saves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BookmarkCodec ¶
type BookmarkCodec struct{}
BookmarkCodec encodes managed headers and decodes validated bookmark entities.
type HabitCodec ¶
type HabitCodec struct{}
HabitCodec encodes managed headers and decodes validated habit entities.
type InboxCodec ¶
type InboxCodec struct{}
InboxCodec encodes managed headers and decodes validated inbox entities.
type JournalCodec ¶
type JournalCodec struct{}
JournalCodec encodes managed headers and decodes validated journal entities.
type PageCodec ¶
type PageCodec struct{}
PageCodec encodes managed headers and decodes validated page entities.
type PersonCodec ¶
type PersonCodec struct{}
PersonCodec encodes managed headers and decodes validated person entities.
type RawNoteCodec ¶ added in v0.4.0
type RawNoteCodec struct{}
RawNoteCodec uses the same domain codecs as the typed repositories.
func (RawNoteCodec) Decode ¶ added in v0.4.0
func (codec RawNoteCodec) Decode(kind ports.NoteKind, source []byte) (ports.RawNoteHeader, error)
Decode validates managed metadata, the supported AsciiDoc syntax and typed domain fields. An empty expected kind accepts any supported note type; diagnostics include line and column.
func (RawNoteCodec) Inspect ¶ added in v0.4.0
func (RawNoteCodec) Inspect(source []byte) (ports.RawNoteHeader, error)
Inspect deliberately parses only the header so invalid bodies can be repaired.