Documentation
¶
Index ¶
- type Quote
- type QuoteDB
- func (q *QuoteDB) AddQuote(author, quote string) (id int64, err error)
- func (q *QuoteDB) Close() error
- func (q *QuoteDB) DelQuote(id int) (bool, error)
- func (q *QuoteDB) Downvote(id int, voter string) (bool, error)
- func (q *QuoteDB) EditQuote(id int, quote string) (bool, error)
- func (q *QuoteDB) GetAll(filterLow bool) ([]Quote, error)
- func (q *QuoteDB) GetQuote(id int) (quote Quote, err error)
- func (q *QuoteDB) NQuotes() int
- func (q *QuoteDB) RandomQuote() (quote Quote, err error)
- func (q *QuoteDB) StartServer(address string)
- func (q *QuoteDB) Unvote(id int, voter string) (bool, error)
- func (q *QuoteDB) Upvote(id int, voter string) (bool, error)
- func (q *QuoteDB) Votes(id int) (up, down int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QuoteDB ¶
QuoteDB provides file storage of quotes via an sqlite database.
func (*QuoteDB) Downvote ¶
Downvote returns true iff the upvote was applied, if it was not applied it's because the user already has a vote for that quote
func (*QuoteDB) RandomQuote ¶
RandomQuote gets a random existing quote.
func (*QuoteDB) StartServer ¶
StartServer starts a webserver to listen on.
func (*QuoteDB) Unvote ¶
Unvote returns true iff there was a vote that was removed, otherwise it return false.
Click to show internal directories.
Click to hide internal directories.