Documentation ¶
Index ¶
- Variables
- func AccessLogHandleFunc(logger *zap.Logger, timeFormat string, utc bool) gin.HandlerFunc
- func CheckAccess(ctx context.Context, permission string, params map[string]interface{}) (bool, error)
- func GetOrgId(ctx context.Context) string
- func GetUserId(ctx context.Context) string
- func NewAuthMiddleware(config map[string]interface{}) *auth.GinJWTMiddleware
- func NewCheckAccessMiddleware(config map[string]interface{}) *auth.CheckAccess
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Config *viper.Viper IsDebug bool Cache cache.Cache Caches map[string]cache.Cache Logger *logger.Logger Db *gorm.DB GreeterClient greeter.GreeterClient )
View Source
var ( AuthHanlerFunc gin.HandlerFunc CheckAccessMiddleware *auth.CheckAccess TracerFunc gin.HandlerFunc )
Functions ¶
func AccessLogHandleFunc ¶
Ginzap returns a gin.HandlerFunc (middleware) that logs requests using uber-go/zap.
Requests with errors are logged using zap.Error(). Requests without errors are logged using zap.Info().
func CheckAccess ¶
func NewAuthMiddleware ¶
func NewAuthMiddleware(config map[string]interface{}) *auth.GinJWTMiddleware
auth will check the jwt token basically
func NewCheckAccessMiddleware ¶
func NewCheckAccessMiddleware(config map[string]interface{}) *auth.CheckAccess
userId will be exist after bearer auth middleware execute
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.