controller

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// API represents the group of API.
	API = "/api"
	// APIBook represents the group of book management API.
	APIBook = API + "/book"
	// 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"
)
View Source
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"
)
View Source
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"
)
View Source
const (
	// APIHealth represents the API to get the status of this application.
	APIHealth = API + "/health"
)

Variables

This section is empty.

Functions

func GetBookList

func GetBookList() echo.HandlerFunc

GetBookList returns the list of all books.

func GetBookSearch

func GetBookSearch() echo.HandlerFunc

GetBookSearch returns the list of matched books by searching.

func GetCategoryList

func GetCategoryList() echo.HandlerFunc

GetCategoryList returns the list of all categories.

func GetFormatList

func GetFormatList() echo.HandlerFunc

GetFormatList returns the list of all formats.

func GetHealthCheck

func GetHealthCheck() echo.HandlerFunc

GetHealthCheck returns whether this application is alive or not.

func GetLoginAccount

func GetLoginAccount() echo.HandlerFunc

GetLoginAccount returns the account data of logged in user.

func GetLoginStatus

func GetLoginStatus() echo.HandlerFunc

GetLoginStatus returns the status of login.

func JSONErrorHandler

func JSONErrorHandler(err error, c echo.Context)

JSONErrorHandler is cumstomize error handler

func PostBookDelete

func PostBookDelete() echo.HandlerFunc

PostBookDelete deletes the existing book by http post.

func PostBookEdit

func PostBookEdit() echo.HandlerFunc

PostBookEdit edit the existing book by http post.

func PostBookRegist

func PostBookRegist() echo.HandlerFunc

PostBookRegist register a new book by http post.

func PostLogin added in v1.3.0

func PostLogin() echo.HandlerFunc

PostLogin is the method to login using username and password by http post.

func PostLogout added in v1.3.0

func PostLogout() echo.HandlerFunc

PostLogout is the method to logout by http post.

Types

type APIError

type APIError struct {
	Code    int
	Message string
}

APIError represents

Jump to

Keyboard shortcuts

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