Documentation ¶
Index ¶
- func BasicAuth(next http.HandlerFunc) http.HandlerFunc
- func CreateLogger(level string) *zap.Logger
- func RespondWithError(w http.ResponseWriter, code int, err error)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func ToBSON_D(fields string, values string) bson.D
- func ToBSON_M(fields string, values string) bson.M
- func Validations(fl validator.FieldLevel) bool
- type Count
- type Keycloak
- type Links
- type MongoPaginate
- type ReturnObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth(next http.HandlerFunc) http.HandlerFunc
basicAuth - adding basic authentication to route
func CreateLogger ¶ added in v0.0.10
Create tailored logger
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, err error)
RespondWithError - creating JSON response with error
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON - creating JSON response
func Validations ¶
func Validations(fl validator.FieldLevel) bool
Validations implements validator.Func
Types ¶
type Count ¶
type Count struct { Total int `json:"total"` Page int `json:"page"` Limit int `json:"limit"` SelfPagingToken string `json:"selfpagingtoken"` PrevPagingToken string `json:"prevpagingtoken"` NextPagingToken string `json:"nextpagingtoken"` }
Count - Model for Count
type Keycloak ¶ added in v0.0.12
type Keycloak struct { Logger *zap.SugaredLogger Gocloak *gocloak.GoCloak ClientId string ClientSecret string Realm string Permissions *[]gocloak.RequestingPartyPermission // contains filtered or unexported fields }
Keycloak settings
func (*Keycloak) VerifyToken ¶ added in v0.0.12
func (auth *Keycloak) VerifyToken(next http.HandlerFunc) http.HandlerFunc
Validate access token. No detailed permissions
func (*Keycloak) VerifyTokenPermissions ¶ added in v0.0.12
func (auth *Keycloak) VerifyTokenPermissions(permissions string, next http.HandlerFunc) http.HandlerFunc
Validate access token. With detail permissions
type Links ¶
type Links struct { Self string `json:"self"` First string `json:"first"` Prev string `json:"prev"` Next string `json:"next"` Last string `json:"last"` }
Links - Model for Links
type MongoPaginate ¶
type MongoPaginate struct {
// contains filtered or unexported fields
}
func NewMongoPaginate ¶
func NewMongoPaginate(page int, limit int) *MongoPaginate
func (*MongoPaginate) GetPaginatedOpts ¶
func (mp *MongoPaginate) GetPaginatedOpts() *options.FindOptions
type ReturnObject ¶
ReturnObject - Model for ReturnObject
Click to show internal directories.
Click to hide internal directories.