Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a quote database.
func (*DB) Create ¶
Create takes a quote and saves it to the database, using the author name as the key. If the author already exists, Create returns an error.
type Quote ¶
type Quote struct {
Author string `json:"author"`
Text string `json:"text"`
Source string `json:"source,omitempty"`
}
Quote represents a quote, inlcuding its author and an optional source. The ID is a unique key.
func (*Quote) Deserialize ¶
Deserialize takes a byte slice that contains a gob-encoded quote and turns it back into a Quote.
Click to show internal directories.
Click to hide internal directories.