truncated

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandFinder

func ExpandFinder(tf IDFinder, l note.Loader) note.Finder

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.

Jump to

Keyboard shortcuts

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