Documentation ¶
Index ¶
- Constants
- func RandString(n int) string
- func ReturnInvalidResponse(httpcode int, details interface{}, message string) error
- func SetPaginationFilter(obj interface{}, c echo.Context)
- func ValidateRequestPayload(c echo.Context, rules govalidator.MapData, data interface{}) (i interface{})
- func ValidateRequestQuery(c echo.Context, rules govalidator.MapData) (i interface{})
- type JWTclaims
- type Pagination
- type ParseError
- type QueryFunc
- type QueryPaged
- func (mod *QueryPaged) Exec(db *gorm.DB, data interface{}, qFunc QueryFunc) error
- func (mod *QueryPaged) GenerateFilters(db *gorm.DB, filter interface{}, tableName string) (*gorm.DB, error)
- func (mod *QueryPaged) GetPage(data interface{}) basemodel.PagedFindResult
- func (mod *QueryPaged) Init(c echo.Context) error
Constants ¶
View Source
const ( //NLOGMSG for message body NLOGMSG = "message" //NLOGERR for error info NLOGERR = "error" //NLOGQUERY for detailed query tracing NLOGQUERY = "query" )
Variables ¶
This section is empty.
Functions ¶
func RandString ¶
RandString random string alphanumeric. parameter length
func ReturnInvalidResponse ¶
func SetPaginationFilter ¶
func ValidateRequestPayload ¶
func ValidateRequestPayload(c echo.Context, rules govalidator.MapData, data interface{}) (i interface{})
general function to validate all kind of api request payload / body
func ValidateRequestQuery ¶
func ValidateRequestQuery(c echo.Context, rules govalidator.MapData) (i interface{})
general function to validate all kind of api request url query
Types ¶
type JWTclaims ¶
type JWTclaims struct { Username string `json:"username"` Group string `json:"group"` Permissions []string `json:"permissions"` jwt.StandardClaims }
JWTclaims jwtclaims
type Pagination ¶
Pagination helper for short step init pagination filter
func (*Pagination) SetPaginationFilter ¶
func (pc *Pagination) SetPaginationFilter(c echo.Context)
type QueryPaged ¶
type QueryPaged struct { Result basemodel.PagedFindResult TotalRows int Offset int Rows int Page int LastPage int Order []string Sort []string // contains filtered or unexported fields }
QueryPaged custom query fields
func (*QueryPaged) Exec ¶
func (mod *QueryPaged) Exec(db *gorm.DB, data interface{}, qFunc QueryFunc) error
Exec custom query
func (*QueryPaged) GenerateFilters ¶
func (mod *QueryPaged) GenerateFilters(db *gorm.DB, filter interface{}, tableName string) (*gorm.DB, error)
GenerateFilters generate parameters filter
func (*QueryPaged) GetPage ¶
func (mod *QueryPaged) GetPage(data interface{}) basemodel.PagedFindResult
GetPage result
Click to show internal directories.
Click to hide internal directories.