Documentation
¶
Index ¶
- Constants
- type APIError
- type AccountController
- type BookController
- func (controller *BookController) CreateBook(c echo.Context) error
- func (controller *BookController) DeleteBook(c echo.Context) error
- func (controller *BookController) GetBook(c echo.Context) error
- func (controller *BookController) GetBookList(c echo.Context) error
- func (controller *BookController) UpdateBook(c echo.Context) error
- type CategoryController
- type ErrorController
- type FormatController
- type HealthController
Constants ¶
const ( // API represents the group of API. API = "/api" // APIBook represents the group of book management API. APIBooks = API + "/books" // APIBooksID represents the API to get book data using id. APIBooksID = APIBooks + "/:id" // APICategory represents the group of category management API. APICategories = API + "/categories" // APIFormat represents the group of format management API. APIFormats = API + "/formats" )
const ( // APIAccount represents the group of auth management API. APIAccount = API + "/auth" // APIAccountLoginStatus represents the API to get the status of logged in account. APIAccountLoginStatus = APIAccount + "/loginStatus" // APIAccountLoginAccount represents the API to get the logged in account. APIAccountLoginAccount = APIAccount + "/loginAccount" // APIAccountLogin represents the API to login by session authentication. APIAccountLogin = APIAccount + "/login" // APIAccountLogout represents the API to logout. APIAccountLogout = APIAccount + "/logout" )
const ( // APIHealth represents the API to get the status of this application. APIHealth = API + "/health" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountController ¶
type AccountController struct {
// contains filtered or unexported fields
}
AccountController is a controller for managing user account.
func NewAccountController ¶
func NewAccountController(context mycontext.Context) *AccountController
NewAccountController is constructor.
func (*AccountController) GetLoginAccount ¶
func (controller *AccountController) GetLoginAccount(c echo.Context) error
GetLoginAccount returns the account data of logged in user.
func (*AccountController) GetLoginStatus ¶
func (controller *AccountController) GetLoginStatus(c echo.Context) error
GetLoginStatus returns the status of login.
type BookController ¶
type BookController struct {
// contains filtered or unexported fields
}
BookController is a controller for managing books.
func NewBookController ¶
func NewBookController(context mycontext.Context) *BookController
NewBookController is constructor.
func (*BookController) CreateBook ¶
func (controller *BookController) CreateBook(c echo.Context) error
CreateBook create a new book by http post.
func (*BookController) DeleteBook ¶
func (controller *BookController) DeleteBook(c echo.Context) error
DeleteBook deletes the existing book by http post.
func (*BookController) GetBook ¶
func (controller *BookController) GetBook(c echo.Context) error
GetBook returns one record matched book's id.
func (*BookController) GetBookList ¶
func (controller *BookController) GetBookList(c echo.Context) error
GetBookList returns the list of matched books by searching.
func (*BookController) UpdateBook ¶
func (controller *BookController) UpdateBook(c echo.Context) error
UpdateBook update the existing book by http post.
type CategoryController ¶
type CategoryController struct {
// contains filtered or unexported fields
}
CategoryController is a controller for managing category data.
func NewCategoryController ¶
func NewCategoryController(context mycontext.Context) *CategoryController
NewCategoryController is constructor.
func (*CategoryController) GetCategoryList ¶
func (controller *CategoryController) GetCategoryList(c echo.Context) error
GetCategoryList returns the list of all categories.
type ErrorController ¶
type ErrorController struct {
// contains filtered or unexported fields
}
ErrorController is a controller for handling errors.
func NewErrorController ¶
func NewErrorController(context mycontext.Context) *ErrorController
NewErrorController is constructor.
type FormatController ¶
type FormatController struct {
// contains filtered or unexported fields
}
FormatController is a controller for managing format data.
func NewFormatController ¶
func NewFormatController(context mycontext.Context) *FormatController
NewFormatController is constructor.
func (*FormatController) GetFormatList ¶
func (controller *FormatController) GetFormatList(c echo.Context) error
GetFormatList returns the list of all formats.
type HealthController ¶
type HealthController struct {
// contains filtered or unexported fields
}
HealthController is a controller returns the current status of this application.
func NewHealthController ¶
func NewHealthController(context mycontext.Context) *HealthController
NewHealthController is constructor.
func (*HealthController) GetHealthCheck ¶
func (controller *HealthController) GetHealthCheck(c echo.Context) error
GetHealthCheck returns whether this application is alive or not.