 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func GetI18nData(c *gin.Context) gogo_i18n.GoGoi18nInterface
- func LoadI18nDataFromDatabase(db *gorm.DB, storeType string, storePath string)
- type HttpTester
- func (h *HttpTester) DELETE(uri string, param interface{}) (int, *e.Response)
- func (h *HttpTester) GET(uri string) (int, *e.Response)
- func (h *HttpTester) PATCH(uri string, param interface{}) (int, *e.Response)
- func (h *HttpTester) POST(uri string, param interface{}) (int, *e.Response)
- func (h *HttpTester) POST_FORM(uri string, param interface{}) (int, *e.Response)
- func (h *HttpTester) PUT(uri string, param interface{}) (int, *e.Response)
 
- type HttpTesterInterface
- type I18nMsg
- func (i *I18nMsg) Append(isSuccess bool, module string, data map[string]interface{}) string
- func (i *I18nMsg) Create(isSuccess bool, data map[string]interface{}) string
- func (i *I18nMsg) Delete(isSuccess bool, data map[string]interface{}) string
- func (i *I18nMsg) Get(isSuccess bool, data map[string]interface{}) string
- func (i *I18nMsg) GetModule(name string) string
- func (i *I18nMsg) Modify(isSuccess bool, data map[string]interface{}) string
- func (i *I18nMsg) ParamFormatError(data map[string]interface{}) string
- func (i *I18nMsg) ParamIntError(data map[string]interface{}) string
- func (i *I18nMsg) ParamRequiredError(data map[string]interface{}) string
- func (i *I18nMsg) Remove(isSuccess bool, module string, data map[string]interface{}) string
- func (i *I18nMsg) SetCore(data gogo_i18n.GoGoi18nInterface)
- func (i *I18nMsg) SetModule(module string) *I18nMsg
- func (i *I18nMsg) Update(isSuccess bool, data map[string]interface{}) string
 
- type I18nMsgContent
- type I18nMsgInterface
- type RequestHandler
- type RequestHandlerInterface
- type Requester
- func (r *Requester) DELETE(uri string, param interface{}) (*e.Response, error)
- func (r *Requester) GET(uri string) (*e.Response, error)
- func (r *Requester) PATCH(uri string, param interface{}) (*e.Response, error)
- func (r *Requester) POST(uri string, param interface{}) (*e.Response, error)
- func (r *Requester) PUT(uri string, param interface{}) (*e.Response, error)
- func (r *Requester) ReadJSONResponse(in *http.Response) (*e.Response, error)
 
- type RequesterInterface
Constants ¶
      View Source
      
  const ( ERRMSG = "errMsg" //參數錯誤 PARAM = "parameter" FORMAT = "format" INT = "int" )
-------------------------------// error type
      View Source
      
  const ( REASON = "reason" SUCCESS = "success" FAILED = "failed" )
成功與否
      View Source
      
  const ( COMMA = "comma" PERIOD = "period" SPACE = " " )
標點符號
      View Source
      
  const ( CREATE = "create" UPDATE = "update" MODIFY = "modify" GET = "get" DELETE = "delete" APPEND = "append" REMOVE = "remove" )
CRUD 方法
      View Source
      
  const (
	MODULE = "module"
)
    模組
Variables ¶
This section is empty.
Functions ¶
func GetI18nData ¶ added in v1.0.2
Types ¶
type HttpTester ¶ added in v1.0.5
type HttpTester struct {
	// contains filtered or unexported fields
}
    func (*HttpTester) DELETE ¶ added in v1.0.5
func (h *HttpTester) DELETE(uri string, param interface{}) (int, *e.Response)
DELETE 模擬 Delete Request的動作
func (*HttpTester) GET ¶ added in v1.0.5
func (h *HttpTester) GET(uri string) (int, *e.Response)
Get 模擬Get Request的動作
func (*HttpTester) PATCH ¶ added in v1.0.5
func (h *HttpTester) PATCH(uri string, param interface{}) (int, *e.Response)
PATCH 模擬 Patch Request的動作
func (*HttpTester) POST ¶ added in v1.0.5
func (h *HttpTester) POST(uri string, param interface{}) (int, *e.Response)
POST 模擬Post Request的動作
type HttpTesterInterface ¶ added in v1.0.5
type HttpTesterInterface interface {
	GET(uri string) (int, *e.Response)
	POST(uri string, param interface{}) (int, *e.Response)
	POST_FORM(uri string, param interface{}) (int, *e.Response)
	PUT(uri string, param interface{}) (int, *e.Response)
	PATCH(uri string, param interface{}) (int, *e.Response)
	DELETE(uri string, param interface{}) (int, *e.Response)
}
    func NewHttpTester ¶ added in v1.0.5
func NewHttpTester(router *gin.Engine) HttpTesterInterface
type I18nMsg ¶ added in v1.0.7
type I18nMsg struct {
	Module string
	Core   gogo_i18n.GoGoi18nInterface
}
    func (*I18nMsg) ParamFormatError ¶ added in v1.0.7
func (*I18nMsg) ParamIntError ¶ added in v1.0.7
func (*I18nMsg) ParamRequiredError ¶ added in v1.0.7
type I18nMsgContent ¶ added in v1.0.7
type I18nMsgInterface ¶ added in v1.0.7
type I18nMsgInterface interface {
	//基本方法
	SetCore(data gogo_i18n.GoGoi18nInterface)
	SetModule(module string) *I18nMsg
	//error handler
	ParamFormatError(data map[string]interface{}) string
	ParamIntError(data map[string]interface{}) string
	ParamRequiredError(data map[string]interface{}) string
	//取得模組
	GetModule(name string) string
	//http方法
	Get(isSuccess bool, data map[string]interface{}) string
	Create(isSuccess bool, data map[string]interface{}) string
	Update(isSuccess bool, data map[string]interface{}) string
	Modify(isSuccess bool, data map[string]interface{}) string
	Delete(isSuccess bool, data map[string]interface{}) string
	Append(isSuccess bool, module string, data map[string]interface{}) string
	Remove(isSuccess bool, module string, data map[string]interface{}) string
}
    func NewI18nMsg ¶ added in v1.0.7
func NewI18nMsg(module string) I18nMsgInterface
type RequestHandler ¶
type RequestHandler struct {
	// contains filtered or unexported fields
}
    func (*RequestHandler) BindBody ¶
func (r *RequestHandler) BindBody(c *gin.Context, body interface{}) error
BindBody : 綁定 body
func (*RequestHandler) ValidValidation ¶
func (r *RequestHandler) ValidValidation(v *validation.Validation) error
ValidValidation : 驗證表單資訊
type RequestHandlerInterface ¶
type RequestHandlerInterface interface {
	//BindBody : 綁定 body
	BindBody(c *gin.Context, body interface{}) error
	//ValidValidation : 驗證表單資訊
	ValidValidation(v *validation.Validation) error
}
    func NewRequestHandler ¶
func NewRequestHandler() RequestHandlerInterface
type Requester ¶ added in v1.0.9
type Requester struct {
	// contains filtered or unexported fields
}
    type RequesterInterface ¶ added in v1.0.9
type RequesterInterface interface {
	GET(uri string) (*e.Response, error)
	POST(uri string, param interface{}) (*e.Response, error)
	PUT(uri string, param interface{}) (*e.Response, error)
	PATCH(uri string, param interface{}) (*e.Response, error)
	DELETE(uri string, param interface{}) (*e.Response, error)
}
    func NewRequester ¶ added in v1.0.9
func NewRequester(client *http.Client) RequesterInterface
 Click to show internal directories. 
   Click to hide internal directories.