Documentation ¶
Index ¶
- func GetAllPhrasesRoute(w http.ResponseWriter, r *http.Request)
- func GetRandomPhraseRoute(w http.ResponseWriter, r *http.Request)
- func SetupRouter() *chi.Mux
- func TestEndpoint(method string, endpoint string, data io.Reader, handler http.HandlerFunc, ...) (code int, body *bytes.Buffer, err error)
- type Config
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllPhrasesRoute ¶
func GetAllPhrasesRoute(w http.ResponseWriter, r *http.Request)
GetAllPhrasesRoute gets all the phrases for the system
func GetRandomPhraseRoute ¶
func GetRandomPhraseRoute(w http.ResponseWriter, r *http.Request)
GetRandomPhraseRoute gets a random phrase
Types ¶
type Config ¶
The Config struct holds general configuration options for the application
func LoadConfig ¶
func LoadConfig() *Config
LoadConfig will load up a new configuration struct with sane defaults if none provided
type Pair ¶
The Pair struct provides a simple Key/Value structure of an Esperanto phrase and an English translation
func LoadPhrasebook ¶
func LoadPhrasebook() []Pair
LoadPhrasebook will load up the phrasebook.txt file, which is a | separated file with an Esperanto phrase and English translation on each line
Click to show internal directories.
Click to hide internal directories.