Documentation
¶
Overview ¶
Package notes provides types and functions for interacting with a note maps data storage system.
Package notes provides types and functions for interacting with a note maps data storage system.
Package notes provides types and functions for interacting with a note maps data storage system.
Package notes provides types and functions for interacting with a note maps data storage system.
Index ¶
- Constants
- func DebugDiff(a, b Note) (string, interface{}, interface{}, error)
- func Equal(a, b Note) (bool, error)
- type EmptyNote
- type Error
- type Finder
- type Loader
- type Note
- type NoteMap
- type Patcher
- type Query
- type Stage
- type StageNote
- func (x *StageNote) AddContent(id uint64) *StageNote
- func (x *StageNote) GetContents() ([]Note, error)
- func (x *StageNote) GetId() uint64
- func (x *StageNote) GetSupertypes() ([]Note, error)
- func (x *StageNote) GetTypes() ([]Note, error)
- func (x *StageNote) GetValue() (string, Note, error)
- func (x *StageNote) SetValue(lexical string, datatype uint64)
Constants ¶
const EmptyId uint64 = 0
EmptyId is the zero or nil value for note identifiers, and never identifies a valid note.
EmptyId exists only to make code that specifies the zero value for Note identifiers a bit more readable.
const ( // EmptyLoader implements the Loader interface for a note map that is // always empty. EmptyLoader emptyLoader = 0 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmptyNote ¶
type EmptyNote uint64
EmptyNote is simply an empty Note with nothing more than an Id.
func (EmptyNote) GetContents ¶
func (EmptyNote) GetSupertypes ¶
type Finder ¶
Finder can be implemented to support finding notes in a note map according to a query.
type Loader ¶
type Loader interface {
// Load returns a slice of all found notes.
//
// If the error is NotFound, the returned notes includes all found
// notes and NotFound.Ids holds the ids of notes that were not found.
Load(ids []uint64) ([]Note, error)
}
Loader can be implemented to support loading notes by id.
type Note ¶
type Note interface {
GetId() uint64
GetTypes() ([]Note, error)
GetSupertypes() ([]Note, error)
GetValue() (string, Note, error)
GetContents() ([]Note, error)
}
Note is a graph-like interface to a note in a note map.
Since traversing from note to note in a note map may require fragile operations like loading query results from a storage backend, most methods can return an error instead of the requested data.
type NoteMap ¶
NoteMap can be implemented to support finding and patching notes in a note map.
An instance of DB should be closed when it is no longer needed.
type Patcher ¶
Patcher can be implemented to support making changes to notes in a note map by applying a set of differences to them.
type Query ¶
type Query struct {
}
Query limits the notes that will be found when loading information from a graph.
The default query matches all notes.
type Stage ¶
Stage describes a set of changes that might be made to a note map.
The default stage describes an empty set of changes to be made to an empty note map.
A default Stage{} is an empty set of changes made to an empty note map.
type StageNote ¶
StageNote supports updating the content of a note within a batch, and also implements the Note interface to read the hypothetical state of a note with the batch applied.
func (*StageNote) AddContent ¶
AddContent expands the staged operations to add content to this note.
func (*StageNote) GetContents ¶
func (*StageNote) GetSupertypes ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package genji implements notes/pbdb interfaces to store Note Maps in a Genji database.
|
Package genji implements notes/pbdb interfaces to store Note Maps in a Genji database. |
|
Package pbdb provides types and functions for storing note maps using a small number of protocol buffer message types.
|
Package pbdb provides types and functions for storing note maps using a small number of protocol buffer message types. |
|
pb
Package notespb defines protocol buffer message types intended for use in note maps data storage APIs.
|
Package notespb defines protocol buffer message types intended for use in note maps data storage APIs. |