dictionary

package
v0.0.0-...-63692ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHandler

func MakeHandler(s Randomizer, l kitlog.Logger) http.Handler

MakeHandler to service route requests

Types

type Randomizer

type Randomizer interface {
	Word() string
}

Randomizer selects a random word for a collection of words

func NewLoggingService

func NewLoggingService(s Randomizer, l log.Logger) Randomizer

NewLoggingService returns a new instance to the logging service

func NewService

func NewService(path string) (Randomizer, error)

NewService creates a new dictionary service

type WordList

type WordList []string

WordList stores a collection of words

func NewWordList

func NewWordList(path string) (WordList, error)

NewWordList creates a new wordlist from the given file

func (WordList) Word

func (wl WordList) Word() string

Word returns a new word randomly from the list

type WordResponse

type WordResponse struct {
	Word string `json:"word"`
}

WordResponse returns a new word

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL