Documentation ¶
Index ¶
- Constants
- type APIError
- type AccountController
- type BookController
- func (controller *BookController) GetBook(c echo.Context) error
- func (controller *BookController) GetBookList(c echo.Context) error
- func (controller *BookController) GetBookSearch(c echo.Context) error
- func (controller *BookController) PostBookDelete(c echo.Context) error
- func (controller *BookController) PostBookEdit(c echo.Context) error
- func (controller *BookController) PostBookRegist(c echo.Context) error
- type ErrorController
- type HealthController
- type MasterController
Constants ¶
const ( // API represents the group of API. API = "/api" // APIBook represents the group of book management API. APIBook = API + "/book" // APIBookGet represents the API to get one book. APIBookGet = APIBook + "/get" // APIBookList represents the API to get book's list. APIBookList = APIBook + "/list" // APIBookSearch represents the API to search book's list. APIBookSearch = APIBook + "/search" // APIBookRegist represents the API to register a new book. APIBookRegist = APIBook + "/new" // APIBookEdit represents the API to edit the existing book. APIBookEdit = APIBook + "/edit" // APIBookDelete represents the API to delete the existing book. APIBookDelete = APIBook + "/delete" )
const ( // APIMaster represents the group of master management API. APIMaster = API + "/master" // APIMasterCategory represents the API to get category's list. APIMasterCategory = APIMaster + "/category" // APIMasterFormat represents the API to get format's list. APIMasterFormat = APIMaster + "/format" )
const ( // APIAccount represents the group of account management API. APIAccount = API + "/account" // 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 ¶ added in v1.5.0
type AccountController struct {
// contains filtered or unexported fields
}
AccountController is a controller for managing user account.
func NewAccountController ¶ added in v1.5.0
func NewAccountController(context mycontext.Context) *AccountController
NewAccountController is constructor.
func (*AccountController) GetLoginAccount ¶ added in v1.5.0
func (controller *AccountController) GetLoginAccount(c echo.Context) error
GetLoginAccount returns the account data of logged in user.
func (*AccountController) GetLoginStatus ¶ added in v1.5.0
func (controller *AccountController) GetLoginStatus(c echo.Context) error
GetLoginStatus returns the status of login.
func (*AccountController) PostLogin ¶ added in v1.5.0
func (controller *AccountController) PostLogin(c echo.Context) error
PostLogin is the method to login using username and password by http post.
func (*AccountController) PostLogout ¶ added in v1.5.0
func (controller *AccountController) PostLogout(c echo.Context) error
PostLogout is the method to logout by http post.
type BookController ¶ added in v1.5.0
type BookController struct {
// contains filtered or unexported fields
}
BookController is a controller for managing books.
func NewBookController ¶ added in v1.5.0
func NewBookController(context mycontext.Context) *BookController
NewBookController is constructor.
func (*BookController) GetBook ¶ added in v1.5.0
func (controller *BookController) GetBook(c echo.Context) error
GetBook returns one record matched book's id.
func (*BookController) GetBookList ¶ added in v1.5.0
func (controller *BookController) GetBookList(c echo.Context) error
GetBookList returns the list of all books.
func (*BookController) GetBookSearch ¶ added in v1.5.0
func (controller *BookController) GetBookSearch(c echo.Context) error
GetBookSearch returns the list of matched books by searching.
func (*BookController) PostBookDelete ¶ added in v1.5.0
func (controller *BookController) PostBookDelete(c echo.Context) error
PostBookDelete deletes the existing book by http post.
func (*BookController) PostBookEdit ¶ added in v1.5.0
func (controller *BookController) PostBookEdit(c echo.Context) error
PostBookEdit edit the existing book by http post.
func (*BookController) PostBookRegist ¶ added in v1.5.0
func (controller *BookController) PostBookRegist(c echo.Context) error
PostBookRegist register a new book by http post.
type ErrorController ¶ added in v1.5.0
type ErrorController struct {
// contains filtered or unexported fields
}
ErrorController is a controller for handling errors.
func NewErrorController ¶ added in v1.5.0
func NewErrorController(context mycontext.Context) *ErrorController
NewErrorController is constructor.
func (*ErrorController) JSONError ¶ added in v1.5.0
func (controller *ErrorController) JSONError(err error, c echo.Context)
JSONError is cumstomize error handler
type HealthController ¶ added in v1.5.0
type HealthController struct {
// contains filtered or unexported fields
}
HealthController is a controller returns the current status of this application.
func NewHealthController ¶ added in v1.5.0
func NewHealthController(context mycontext.Context) *HealthController
NewHealthController is constructor.
func (*HealthController) GetHealthCheck ¶ added in v1.5.0
func (controller *HealthController) GetHealthCheck(c echo.Context) error
GetHealthCheck returns whether this application is alive or not.
type MasterController ¶ added in v1.5.0
type MasterController struct {
// contains filtered or unexported fields
}
MasterController is a controller for managing master data such as format and category.
func NewMasterController ¶ added in v1.5.0
func NewMasterController(context mycontext.Context) *MasterController
NewMasterController is constructor.
func (*MasterController) GetCategoryList ¶ added in v1.5.0
func (controller *MasterController) GetCategoryList(c echo.Context) error
GetCategoryList returns the list of all categories.
func (*MasterController) GetFormatList ¶ added in v1.5.0
func (controller *MasterController) GetFormatList(c echo.Context) error
GetFormatList returns the list of all formats.