Documentation
¶
Index ¶
- type Content
- type Coordinate
- type Document
- type Documents
- func (d *Documents) DocumentDelete(id string) error
- func (d *Documents) DocumentForIdentifier(id string) (*Document, error)
- func (d *Documents) DocumentSave(id string, content Content) error
- func (d *Documents) Documents() ([]Document, error)
- func (d *Documents) DocumentsForContentType(contentType string) ([]Document, error)
- func (d *Documents) DocumentsForTag(tag string) ([]Document, error)
- type Location
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct {
Text string `json:"text"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Meta Meta `json:"meta"`
}
Content represents the content portion of the Document.
type Coordinate ¶
type Coordinate struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Altitude float64 `json:"altitude"`
}
Coordinate represents a geographic coordinate on Earth.
type Document ¶
type Document struct {
Identifier string `json:"identifier"`
Content Content `json:"content"`
History []Content `json:"history"`
}
Document represents a complete database record.
func DecodeDocument ¶
DecodeDocument returns a new document for a given JSON string.
func DecodeDocuments ¶
DecodeDocuments returns a list of documents.
type Documents ¶
type Documents struct {
// contains filtered or unexported fields
}
Documents represents the interface for interacting with Documents.
func (*Documents) DocumentDelete ¶
DocumentDelete removes a document from storage.
func (*Documents) DocumentForIdentifier ¶
DocumentForIdentifier returns a document for a given identifier.
func (*Documents) DocumentSave ¶
DocumentSave returns a created or updated document, maintaining a history of edits.
func (*Documents) DocumentsForContentType ¶
DocumentsForContentType returns all documents for a given content-type.
type Location ¶
type Location struct {
Name string `json:"name,omitempty"`
Coordinate Coordinate `json:"coordinate"`
}
Location represents a location(s).