Documentation ¶
Index ¶
- func CreateRouter(server *HTTPServer) (*mux.Router, error)
- type DB
- func (db *DB) DownVoteWord(word string, ip string) error
- func (db *DB) GetBottom10() ([]*Word, error)
- func (db *DB) GetHistory() ([]*Word, error)
- func (db *DB) GetRandom10() ([]*Word, error)
- func (db *DB) GetRandomWord() (*Word, error)
- func (db *DB) GetTop10() ([]*Word, error)
- func (db *DB) Open() error
- func (db *DB) UpVoteWord(word string, ip string) error
- type HTTPServer
- func (s *HTTPServer) DownVoteWord(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- func (s *HTTPServer) GetBottom10(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- func (s *HTTPServer) GetHistory(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- func (s *HTTPServer) GetRandom10(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- func (s *HTTPServer) GetRandomWord(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- func (s *HTTPServer) GetTop10(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- func (s *HTTPServer) UpVoteWord(w http.ResponseWriter, r *http.Request, vars map[string]string) error
- type HttpApiFunc
- type Vote
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRouter ¶
func CreateRouter(server *HTTPServer) (*mux.Router, error)
Types ¶
type DB ¶
func (*DB) GetBottom10 ¶
func (*DB) GetHistory ¶
func (*DB) GetRandom10 ¶
func (*DB) GetRandomWord ¶
type HTTPServer ¶
type HTTPServer struct {
DB *DB
}
func NewHTTPServer ¶
func NewHTTPServer(db *DB) *HTTPServer
func (*HTTPServer) DownVoteWord ¶
func (s *HTTPServer) DownVoteWord(w http.ResponseWriter, r *http.Request, vars map[string]string) error
func (*HTTPServer) GetBottom10 ¶
func (s *HTTPServer) GetBottom10(w http.ResponseWriter, r *http.Request, vars map[string]string) error
func (*HTTPServer) GetHistory ¶
func (s *HTTPServer) GetHistory(w http.ResponseWriter, r *http.Request, vars map[string]string) error
func (*HTTPServer) GetRandom10 ¶
func (s *HTTPServer) GetRandom10(w http.ResponseWriter, r *http.Request, vars map[string]string) error
func (*HTTPServer) GetRandomWord ¶
func (s *HTTPServer) GetRandomWord(w http.ResponseWriter, r *http.Request, vars map[string]string) error
func (*HTTPServer) GetTop10 ¶
func (s *HTTPServer) GetTop10(w http.ResponseWriter, r *http.Request, vars map[string]string) error
func (*HTTPServer) UpVoteWord ¶
func (s *HTTPServer) UpVoteWord(w http.ResponseWriter, r *http.Request, vars map[string]string) error
type HttpApiFunc ¶
Click to show internal directories.
Click to hide internal directories.