Documentation ¶
Index ¶
- type API
- func (api *API) AddBook(w http.ResponseWriter, r *http.Request)
- func (api *API) GetBooks(w http.ResponseWriter, r *http.Request)
- func (api *API) RefreshBooks(w http.ResponseWriter, r *http.Request)
- func (api *API) RemoveBook(w http.ResponseWriter, r *http.Request)
- func (api *API) RemoveBooks(w http.ResponseWriter, r *http.Request)
- type BooksView
- func (booksView *BooksView) AddBook(w http.ResponseWriter, r *http.Request)
- func (booksView BooksView) Index(w http.ResponseWriter, r *http.Request)
- func (booksView *BooksView) ListBooks(w http.ResponseWriter, r *http.Request)
- func (booksView *BooksView) Refresh(w http.ResponseWriter, r *http.Request)
- func (booksView *BooksView) RemoveBook(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API json rest api views
func NewAPI ¶
func NewAPI(conf *configuration.Configuration, controller *controllers.BooksController) *API
NewAPI creates new API
func (*API) AddBook ¶
func (api *API) AddBook(w http.ResponseWriter, r *http.Request)
AddBook add book to DB
func (*API) GetBooks ¶
func (api *API) GetBooks(w http.ResponseWriter, r *http.Request)
GetBooks return all books
func (*API) RefreshBooks ¶
func (api *API) RefreshBooks(w http.ResponseWriter, r *http.Request)
RefreshBooks refresh status of books
func (*API) RemoveBook ¶
func (api *API) RemoveBook(w http.ResponseWriter, r *http.Request)
RemoveBook remove book from DB
func (*API) RemoveBooks ¶
func (api *API) RemoveBooks(w http.ResponseWriter, r *http.Request)
RemoveBooks remove books from DB
type BooksView ¶
type BooksView struct {
// contains filtered or unexported fields
}
BooksView renders books UI
func NewBooksView ¶
func NewBooksView(conf *configuration.Configuration, controller *controllers.BooksController) (*BooksView, error)
NewBooksView creates BooksView
func (*BooksView) AddBook ¶
func (booksView *BooksView) AddBook(w http.ResponseWriter, r *http.Request)
AddBook renders view to add book
func (BooksView) Index ¶
func (booksView BooksView) Index(w http.ResponseWriter, r *http.Request)
Index renders index view
func (*BooksView) ListBooks ¶
func (booksView *BooksView) ListBooks(w http.ResponseWriter, r *http.Request)
ListBooks renders view to list books
func (*BooksView) Refresh ¶
func (booksView *BooksView) Refresh(w http.ResponseWriter, r *http.Request)
Refresh refresh books in DB
func (*BooksView) RemoveBook ¶
func (booksView *BooksView) RemoveBook(w http.ResponseWriter, r *http.Request)
RemoveBook removes book
Click to show internal directories.
Click to hide internal directories.