Documentation ¶
Index ¶
- Constants
- func NewHasher() *hasher
- func NewJWTObj(jwtSecretKey string) *jwtAuth
- func NewMongoConnection(ctx context.Context, uri string) (client *mongo.Client, err error)
- func NotFound(err error) bool
- func ParseKindAndBody(c *gin.Context, kind string, body interface{}) error
- type MetaToken
- type TReqResp
Constants ¶
View Source
const DefaultSaltSize = 512
Variables ¶
This section is empty.
Functions ¶
func NewMongoConnection ¶
NewMongoConnection connect to mongodb server, returning a reusable mongo connection.
Types ¶
type MetaToken ¶
type TReqResp ¶
type TReqResp struct { Kind string `json:"kind"` Success bool `json:"success"` Values interface{} `json:"values,omitempty"` Error *tError `json:"error,omitempty"` // contains filtered or unexported fields }
TReqResp is a base data structure to pass request/response data
func NewReqRespStruct ¶
NewReqRespStruct creates TReqResp object
func (*TReqResp) BadReq ¶
BadReq will pass the error message and error reference then wraps gin json response
func (*TReqResp) InternalErr ¶
InternalErr will pass the error message and error reference then wraps gin json response
func (*TReqResp) Ok ¶
func (r *TReqResp) Ok(values interface{})
Ok will pass the value then wraps gin json response
func (*TReqResp) Unauthorized ¶
Unauthorized will pass the error message then wraps gin json response
Click to show internal directories.
Click to hide internal directories.