Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandFinder ¶
ExpandFinder combines tf and l to provide a notes.Finder implementation.
func ExpandLoader ¶
func ExpandLoader(tl TruncatedLoader) notes.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 *notes.Query) (ids []notes.ID, err error)
}
IDFinder can be implemented in order to provide a notes.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 notes.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 []notes.ID) (tns []notes.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.