Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandFinder ¶
ExpandFinder combines tf and l to provide a note.Finder implementation.
func ExpandLoader ¶
func ExpandLoader(tl TruncatedLoader) note.Loader
ExpandLoader expands tl into a Loader implementation with a simple built-in cache that is suitable for short-lived loaders.
Types ¶
type IDFinder ¶
type IDFinder interface {
// FindNoteIDs returns ids: the ID of every note that matches q. If q
// specifies an ordering, FindNoteIDs should return ids in that order.
FindNoteIDs(q *note.Query) (ids []note.ID, err error)
}
IDFinder can be implemented in order to provide a note.Finder through ExpandFinder.
type TruncatedLoader ¶
type TruncatedLoader interface {
// LoadTruncatedNotes should return tns where len(tns)==len(ids) and, for
// each offset into ids, tns[offset].ID==ids[offset].
//
// Implementations should return note.InvalidID if any ID in ids is empty.
//
// Since all notes implicitly exist, there is no "not found" error: for any
// ID x where nothing is known about x, implementations should return
// TruncatedNote{ID:x}.
LoadTruncatedNotes(ids []note.ID) (tns []note.TruncatedNote, err error)
}
TruncatedLoader can be implemented in order to provide a Loader through ExpandLoader.
Click to show internal directories.
Click to hide internal directories.