controller

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 8 Imported by: 0

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"
	// 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"
)
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

This section is empty.

Types

type APIError

type APIError struct {
	Code    int
	Message string
}

APIError has a error code and a message.

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.

func (*AccountController) PostLogin

func (controller *AccountController) PostLogin(c echo.Context) error

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

func (*AccountController) PostLogout

func (controller *AccountController) PostLogout(c echo.Context) error

PostLogout is the method to logout by http post.

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) 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 all books.

func (*BookController) GetBookSearch

func (controller *BookController) GetBookSearch(c echo.Context) error

GetBookSearch returns the list of matched books by searching.

func (*BookController) PostBookDelete

func (controller *BookController) PostBookDelete(c echo.Context) error

PostBookDelete deletes the existing book by http post.

func (*BookController) PostBookEdit

func (controller *BookController) PostBookEdit(c echo.Context) error

PostBookEdit edit the existing book by http post.

func (*BookController) PostBookRegist

func (controller *BookController) PostBookRegist(c echo.Context) error

PostBookRegist register a new book by http post.

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.

func (*ErrorController) JSONError

func (controller *ErrorController) JSONError(err error, c echo.Context)

JSONError is cumstomize error handler

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.

type MasterController

type MasterController struct {
	// contains filtered or unexported fields
}

MasterController is a controller for managing master data such as format and category.

func NewMasterController

func NewMasterController(context mycontext.Context) *MasterController

NewMasterController is constructor.

func (*MasterController) GetCategoryList

func (controller *MasterController) GetCategoryList(c echo.Context) error

GetCategoryList returns the list of all categories.

func (*MasterController) GetFormatList

func (controller *MasterController) GetFormatList(c echo.Context) error

GetFormatList returns the list of all formats.

Jump to

Keyboard shortcuts

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