Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyDatabase = errors.New("Database is empty")
ErrEmptyDatabase is returned when an empty database is used.
View Source
var ErrMissingFortune = errors.New("Could not find fortune with provided ID")
ErrMissingFortune is returned when a fortune for the provided ID is not found.
Functions ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is an in-memory container for fortunes.
func NewDatabase ¶
NewDatabase creates a fortune.Database from an array of fortunes.
func Parse ¶
Parse initializes a fortune.Database with the fortune data parsed from the provided io.Reader.
Click to show internal directories.
Click to hide internal directories.