2021-02-13 08:52:59 -08:00
|
|
|
package hacker
|
2021-02-13 08:39:05 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zorchenhimer/hacker-quotes/models"
|
|
|
|
//"github.com/zorchenhimer/hacker-quotes/database"
|
|
|
|
)
|
|
|
|
|
|
|
|
type HackerQuotes interface {
|
2021-02-14 13:49:11 -08:00
|
|
|
// Hack returns a completely randomized quote.
|
|
|
|
Hack() (string, error)
|
2021-02-13 08:39:05 -08:00
|
|
|
|
|
|
|
// Format returns a quote in the given format.
|
2021-02-17 15:07:23 -08:00
|
|
|
HackThis(format string) (string, error)
|
2021-02-13 08:39:05 -08:00
|
|
|
|
|
|
|
// InitData populates the underlying database with data from the given json file.
|
|
|
|
InitData(filename string) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Admin interface {
|
|
|
|
AddNoun(word models.Noun) error
|
|
|
|
AddVerb(word models.Verb) error
|
|
|
|
|
|
|
|
RemoveNoun(word string) error
|
|
|
|
// Word is the indefinite form.
|
|
|
|
RemoveVerb(word string) error
|
|
|
|
|
|
|
|
GetNouns() ([]models.Noun, error)
|
|
|
|
GetVerbs() ([]models.Verb, error)
|
|
|
|
}
|