Documentation ¶
Index ¶
- func Run(t *testing.T, s suite.TestingSuite)
- func SetupSuite(s *Suite)
- func TearDownSuite(s *Suite)
- func UserAuth(s *Suite)
- type API
- func (a *API) JSONBody(ctx *fasthttp.RequestCtx, model interface{})
- func (a *API) JSONResponse(ctx *fasthttp.RequestCtx, response model.ResponseInterface, status int)
- func (a *API) Paginate(ctx *fasthttp.RequestCtx, orderFields ...string) (model.Pagination, map[string]string, error)
- func (a *API) ParseQuery(ctx *fasthttp.RequestCtx) map[string]string
- type ContentType
- type Controller
- type FileController
- type FileLogController
- type HomeController
- type JWTAuth
- type JobController
- type JobDetailController
- type LoginController
- type Method
- type Router
- type Suite
- type TestResponse
- type TokenController
- type UploadController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
API rest api structure
func (*API) JSONBody ¶
func (a *API) JSONBody(ctx *fasthttp.RequestCtx, model interface{})
JSONBody parse given model request body
func (*API) JSONResponse ¶
func (a *API) JSONResponse(ctx *fasthttp.RequestCtx, response model.ResponseInterface, status int)
JSONResponse building json response
func (*API) Paginate ¶
func (a *API) Paginate(ctx *fasthttp.RequestCtx, orderFields ...string) (model.Pagination, map[string]string, error)
Paginate request paginate build
func (*API) ParseQuery ¶
func (a *API) ParseQuery(ctx *fasthttp.RequestCtx) map[string]string
ParseQuery parse url query string
type ContentType ¶
type ContentType string
ContentType request content type for test api request
const ( // JSON Content type for api request JSON ContentType = "application/json" // XML Content type for api request XML ContentType = "application/xml" // HTML Content type for api request HTML ContentType = "text/html" // FormData Multipart/form-data Content Type for api request FormData ContentType = "multipart/form-data" )
type Controller ¶
type Controller interface { Index(ctx *fasthttp.RequestCtx) Show(ctx *fasthttp.RequestCtx) Create(ctx *fasthttp.RequestCtx) Update(ctx *fasthttp.RequestCtx) Delete(ctx *fasthttp.RequestCtx) }
Controller rest api interface
type FileController ¶
type FileController struct { Controller *API }
FileController job files api controller
func (FileController) Create ¶
func (c FileController) Create(ctx *fasthttp.RequestCtx)
Create job file
func (FileController) Delete ¶
func (c FileController) Delete(ctx *fasthttp.RequestCtx)
Delete job file
func (FileController) Index ¶
func (c FileController) Index(ctx *fasthttp.RequestCtx)
Index list all job files
func (FileController) Update ¶
func (c FileController) Update(ctx *fasthttp.RequestCtx)
Update job file
type FileLogController ¶
type FileLogController struct { Controller *API }
FileLogController file log api controller
func (FileLogController) Index ¶
func (c FileLogController) Index(ctx *fasthttp.RequestCtx)
Index list all file logs
type HomeController ¶
type HomeController struct { Controller *API }
HomeController base controller
func (HomeController) Index ¶
func (c HomeController) Index(ctx *fasthttp.RequestCtx)
Index api base route
type JWTAuth ¶
JWTAuth authentication mechanism
func (JWTAuth) Verify ¶
func (a JWTAuth) Verify(next phi.HandlerFunc) phi.HandlerFunc
Verify verify bearer token in requests
type JobController ¶
type JobController struct { Controller *API }
JobController user defined background job api controller
func (JobController) Create ¶
func (c JobController) Create(ctx *fasthttp.RequestCtx)
Create user defined background job
func (JobController) Delete ¶
func (c JobController) Delete(ctx *fasthttp.RequestCtx)
Delete user defined background job
func (JobController) Index ¶
func (c JobController) Index(ctx *fasthttp.RequestCtx)
Index list all user defined background jobs
func (JobController) Show ¶
func (c JobController) Show(ctx *fasthttp.RequestCtx)
Show a user defined background job
type JobDetailController ¶
type JobDetailController struct { Controller *API }
JobDetailController user defined background job detail api controller
func (JobDetailController) Create ¶
func (c JobDetailController) Create(ctx *fasthttp.RequestCtx)
Create detail for user defined background job
type LoginController ¶
type LoginController struct { Controller *API }
LoginController user authentication controller
func (LoginController) Create ¶
func (c LoginController) Create(ctx *fasthttp.RequestCtx)
Create user sign in method
type Suite ¶
Suite application test structure
type TestResponse ¶
type TestResponse struct { RequestError error Success model.ResponseSuccess Error model.ResponseError Other interface{} Status int }
TestResponse response model for test api request
type TokenController ¶
type TokenController struct { Controller *API }
TokenController user authentication token controller
func (TokenController) Create ¶
func (c TokenController) Create(ctx *fasthttp.RequestCtx)
Create generate user jwt method
type UploadController ¶
type UploadController struct { Controller *API }
UploadController file upload api controller
func (UploadController) Create ¶
func (c UploadController) Create(ctx *fasthttp.RequestCtx)
Create file upload method
func (UploadController) DirIndex ¶
func (c UploadController) DirIndex(ctx *fasthttp.RequestCtx)
DirIndex directory list in lib path