Documentation ¶
Index ¶
- type HTTPHelper
- func (helper *HTTPHelper) EchoResponse(c *gin.Context, code int, status bool, message string, err string, ...)
- func (helper *HTTPHelper) EchoResponseBadRequest(c *gin.Context, message string, err string)
- func (helper *HTTPHelper) EchoResponseCreated(c *gin.Context, data interface{})
- func (helper *HTTPHelper) EchoResponseSuccess(c *gin.Context, data interface{})
- func (helper *HTTPHelper) EchoResponseWithPagination(c *gin.Context, data interface{}, page string, totalData string)
- func (helper *HTTPHelper) TestAPI(r http.Handler, method, path string, params []byte, header map[string]string) *httptest.ResponseRecorder
- func (helper *HTTPHelper) TestHTTPResponse(t *testing.T, r *gin.Engine, req *http.Request, ...) error
- type HTTPRepoHelper
- type ReadConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHelper ¶
type HTTPHelper struct{}
HTTPHelper struct of helper Gin
func NewServiceHTTPHelper ¶
func NewServiceHTTPHelper() *HTTPHelper
NewServiceHTTPHelper for wrapping the http helper
func (*HTTPHelper) EchoResponse ¶
func (helper *HTTPHelper) EchoResponse( c *gin.Context, code int, status bool, message string, err string, data interface{}, )
EchoResponse to echo the response http
func (*HTTPHelper) EchoResponseBadRequest ¶
func (helper *HTTPHelper) EchoResponseBadRequest(c *gin.Context, message string, err string)
EchoResponseBadRequest for Response Failed
func (*HTTPHelper) EchoResponseCreated ¶
func (helper *HTTPHelper) EchoResponseCreated(c *gin.Context, data interface{})
EchoResponseCreated for Response Success
func (*HTTPHelper) EchoResponseSuccess ¶
func (helper *HTTPHelper) EchoResponseSuccess(c *gin.Context, data interface{})
EchoResponseSuccess for Response Success
func (*HTTPHelper) EchoResponseWithPagination ¶
func (helper *HTTPHelper) EchoResponseWithPagination(c *gin.Context, data interface{}, page string, totalData string)
EchoResponseWithPagination for Response Success
func (*HTTPHelper) TestAPI ¶
func (helper *HTTPHelper) TestAPI( r http.Handler, method, path string, params []byte, header map[string]string, ) *httptest.ResponseRecorder
TestAPI for wrapping manual and return httptest.ResponseRecorder
func (*HTTPHelper) TestHTTPResponse ¶
func (helper *HTTPHelper) TestHTTPResponse( t *testing.T, r *gin.Engine, req *http.Request, f func(w *httptest.ResponseRecorder) (bool, error), ) error
TestHTTPResponse for wrapping a errro
type HTTPRepoHelper ¶
type HTTPRepoHelper interface { TestHttpResponse(t *testing.T, r *gin.Engine, req *http.Request, f func(w *httptest.ResponseRecorder) (bool, error)) error TestAPI(r http.Handler, method, path string) *httptest.ResponseRecorder }
HTTPRepoHelper repo for mock Helper
type ReadConfig ¶
type ReadConfig struct {
// contains filtered or unexported fields
}
ReadConfig for get config yaml file
func NewReadConfigService ¶
func NewReadConfigService() *ReadConfig
NewReadConfigService for new service config
func (*ReadConfig) GetByName ¶
func (cfg *ReadConfig) GetByName(params string) string
GetByName Find and read the config file
Click to show internal directories.
Click to hide internal directories.