Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteHandler[Req webFramework.RecordData](title, delete, checkQuery string, core RequestCoreInterface, ...) any
- func GetAll[Model GetHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, ...) any
- func GetAllMapHandler[Model MapHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, ...) any
- func GetMapBySubHandler[Req any, Resp webFramework.RecordData](title, sql string, core RequestCoreInterface, hasParam bool) any
- func GetMapHandler[Req any, Resp webFramework.RecordData](title, sql string, core RequestCoreInterface, hasParam bool) any
- func GetPage[Model GetPageHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, ...) any
- func GetParams(w webFramework.WebFramework, args ...any) map[string]string
- func GetQuery[Req any](title, sql string, core RequestCoreInterface, hasParam bool) any
- func GetQueryFillable[Resp libQuery.QueryWithDeps](title, query string, core RequestCoreInterface, args ...string) any
- func GetQueryHandler[Req, Resp any](title, sql string, core RequestCoreInterface, args ...any) any
- func GetQueryMap[Req any](title, sql string, core RequestCoreInterface, hasParam bool) any
- func GetSingleRecord[Model GetHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, ...) any
- func GetSingleRecordHandler[Req, Resp any](title, sql string, core RequestCoreInterface) any
- func Init() (ut.Translator, *validator.Validate, error)
- func InitReqLog(w webFramework.WebFramework, reqLog libRequest.RequestPtr, ...) response.ErrorState
- func PaddedIpValidator(fl validator.FieldLevel) bool
- func PostHandler[Req libQuery.RecordDataDml](title string, core RequestCoreInterface, hasInitializer bool, ...) any
- func PutHandler[Req libQuery.RecordDataDml](title string, core RequestCoreInterface, hasInitializer bool, ...) any
- func QueryHandler[Req libQuery.QueryRequest, Resp libQuery.QueryResult](title, key string, queryMap map[string]libQuery.QueryCommand, ...) any
- func Respond(code, status int, message string, data any, abort bool, ...)
- func UpdateHandler[Req libQuery.Updatable](title string, hasReqLog bool, core RequestCoreInterface, hasInitializer bool, ...) any
- type Empty
- type GetHandler
- type GetPageHandler
- type MapHandler
- type RequestCoreInterface
- type RequestCoreModel
- func (m RequestCoreModel) Consumer() libCallApi.CallApiInterface
- func (m RequestCoreModel) Dictionary() libDictionary.DictionaryInterface
- func (m RequestCoreModel) GetDB() libQuery.QueryRunnerInterface
- func (m RequestCoreModel) Params() libParams.ParamsInterface
- func (m RequestCoreModel) RequestTools() libRequest.RequestInterface
- func (m RequestCoreModel) Responder() response.ResponseHandler
- func (m RequestCoreModel) Sm() libCrypto.Sm
- type WebHanlder
- func (m WebHanlder) Error(w webFramework.WebFramework, err response.ErrorState)
- func (m WebHanlder) ErrorState(w webFramework.WebFramework, err response.ErrorState)
- func (m WebHanlder) GetErrorsArray(message string, data any) []response.ErrorResponse
- func (m WebHanlder) HandleErrorState(err error, status int, message string, data any, w webFramework.WebFramework)
- func (m WebHanlder) OK(w webFramework.WebFramework, resp any)
- func (m WebHanlder) OKWithAttachment(w webFramework.WebFramework, attachment *response.FileResponse)
- func (m WebHanlder) OKWithReceipt(w webFramework.WebFramework, resp any, receipt *response.Receipt)
- func (m WebHanlder) Respond(code, status int, message string, data any, abort bool, ...)
- func (m WebHanlder) RespondWithAttachment(code, status int, message string, file *response.FileResponse, abort bool, ...)
- func (m WebHanlder) RespondWithReceipt(code, status int, message string, data any, printData *response.Receipt, ...)
Constants ¶
View Source
const RegexPaddedIp string = `^((25[0-5]|2[0-4]\d|1\d\d|0\d\d)\.?\b){4}$` //^((25[0-5]|2[0-4]\d|1\d\d|0\d\d)\.?\b){4}$
Variables ¶
View Source
var Validate *validator.Validate
Functions ¶
func DeleteHandler ¶
func DeleteHandler[Req webFramework.RecordData](title, delete, checkQuery string, core RequestCoreInterface, hasInitializer bool, parser webFramework.FieldParser, ) any
func GetAll ¶
func GetAll[Model GetHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, args ...any) any
func GetAllMapHandler ¶
func GetAllMapHandler[Model MapHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, args ...any) any
func GetMapBySubHandler ¶
func GetMapBySubHandler[Req any, Resp webFramework.RecordData](title, sql string, core RequestCoreInterface, hasParam bool) any
func GetMapHandler ¶
func GetMapHandler[Req any, Resp webFramework.RecordData](title, sql string, core RequestCoreInterface, hasParam bool) any
func GetPage ¶
func GetPage[Model GetPageHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, args ...any) any
func GetParams ¶ added in v0.4.18
func GetParams(w webFramework.WebFramework, args ...any) map[string]string
func GetQuery ¶
func GetQuery[Req any](title, sql string, core RequestCoreInterface, hasParam bool) any
func GetQueryFillable ¶
func GetQueryFillable[Resp libQuery.QueryWithDeps]( title, query string, core RequestCoreInterface, args ...string, ) any
func GetQueryHandler ¶
func GetQueryHandler[Req, Resp any](title, sql string, core RequestCoreInterface, args ...any) any
func GetQueryMap ¶
func GetQueryMap[Req any](title, sql string, core RequestCoreInterface, hasParam bool) any
func GetSingleRecord ¶
func GetSingleRecord[Model GetHandler](title string, core RequestCoreInterface, respHandler response.ResponseHandler, args ...any) any
func GetSingleRecordHandler ¶
func GetSingleRecordHandler[Req, Resp any](title, sql string, core RequestCoreInterface, ) any
func Init ¶
func Init() (ut.Translator, *validator.Validate, error)
func InitReqLog ¶ added in v0.3.18
func InitReqLog(w webFramework.WebFramework, reqLog libRequest.RequestPtr, core RequestCoreInterface, method, path string) response.ErrorState
func PaddedIpValidator ¶
func PaddedIpValidator(fl validator.FieldLevel) bool
func PostHandler ¶
func PostHandler[Req libQuery.RecordDataDml](title string, core RequestCoreInterface, hasInitializer bool, finalizer func(request Req, c any), args ...any, ) any
func PutHandler ¶
func PutHandler[Req libQuery.RecordDataDml](title string, core RequestCoreInterface, hasInitializer bool, finalizer func(request Req, c any), args ...any, ) any
func QueryHandler ¶ added in v0.5.0
func QueryHandler[Req libQuery.QueryRequest, Resp libQuery.QueryResult]( title, key string, queryMap map[string]libQuery.QueryCommand, core RequestCoreInterface, mode libRequest.Type, validateHeader bool, ) any
func Respond ¶ added in v0.7.0
func Respond(code, status int, message string, data any, abort bool, w webFramework.WebFramework)
Types ¶
type GetHandler ¶
type GetPageHandler ¶
type MapHandler ¶
type RequestCoreInterface ¶
type RequestCoreInterface interface { GetDB() libQuery.QueryRunnerInterface RequestTools() libRequest.RequestInterface Consumer() libCallApi.CallApiInterface Responder() response.ResponseHandler Dictionary() libDictionary.DictionaryInterface Params() libParams.ParamsInterface Sm() libCrypto.Sm }
type RequestCoreModel ¶
type RequestCoreModel struct { RequestInterface libRequest.RequestInterface QueryInterface libQuery.QueryRunnerInterface RemoteApiInterface libCallApi.CallApiInterface RespHandler response.ResponseHandler Dict libDictionary.DictionaryInterface ParamMap libParams.ParamsInterface CryptoSm libCrypto.Sm }
func (RequestCoreModel) Consumer ¶
func (m RequestCoreModel) Consumer() libCallApi.CallApiInterface
func (RequestCoreModel) Dictionary ¶
func (m RequestCoreModel) Dictionary() libDictionary.DictionaryInterface
func (RequestCoreModel) GetDB ¶
func (m RequestCoreModel) GetDB() libQuery.QueryRunnerInterface
func (RequestCoreModel) Params ¶ added in v0.4.15
func (m RequestCoreModel) Params() libParams.ParamsInterface
func (RequestCoreModel) RequestTools ¶
func (m RequestCoreModel) RequestTools() libRequest.RequestInterface
func (RequestCoreModel) Responder ¶
func (m RequestCoreModel) Responder() response.ResponseHandler
func (RequestCoreModel) Sm ¶ added in v0.4.28
func (m RequestCoreModel) Sm() libCrypto.Sm
type WebHanlder ¶ added in v0.7.0
type WebHanlder struct { MessageDesc map[string]string ErrorDesc map[string]string RequestInterface libRequest.RequestInterface }
func (WebHanlder) Error ¶ added in v0.9.0
func (m WebHanlder) Error(w webFramework.WebFramework, err response.ErrorState)
func (WebHanlder) ErrorState ¶ added in v0.7.0
func (m WebHanlder) ErrorState(w webFramework.WebFramework, err response.ErrorState)
func (WebHanlder) GetErrorsArray ¶ added in v0.7.0
func (m WebHanlder) GetErrorsArray(message string, data any) []response.ErrorResponse
func (WebHanlder) HandleErrorState ¶ added in v0.7.0
func (m WebHanlder) HandleErrorState(err error, status int, message string, data any, w webFramework.WebFramework)
func (WebHanlder) OK ¶ added in v0.9.0
func (m WebHanlder) OK(w webFramework.WebFramework, resp any)
func (WebHanlder) OKWithAttachment ¶ added in v0.10.4
func (m WebHanlder) OKWithAttachment(w webFramework.WebFramework, attachment *response.FileResponse)
func (WebHanlder) OKWithReceipt ¶ added in v0.9.0
func (m WebHanlder) OKWithReceipt(w webFramework.WebFramework, resp any, receipt *response.Receipt)
func (WebHanlder) Respond ¶ added in v0.7.0
func (m WebHanlder) Respond(code, status int, message string, data any, abort bool, w webFramework.WebFramework)
func (WebHanlder) RespondWithAttachment ¶ added in v0.10.4
func (m WebHanlder) RespondWithAttachment(code, status int, message string, file *response.FileResponse, abort bool, w webFramework.WebFramework)
func (WebHanlder) RespondWithReceipt ¶ added in v0.7.0
func (m WebHanlder) RespondWithReceipt(code, status int, message string, data any, printData *response.Receipt, abort bool, w webFramework.WebFramework)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.