app

package
v0.0.0-...-f2353e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

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

func AccessLogHandleFunc(logger *zap.Logger, timeFormat string, utc bool) gin.HandlerFunc

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 CheckAccess(ctx context.Context, permission string, params map[string]interface{}) (bool, error)

func GetOrgId

func GetOrgId(ctx context.Context) string

func GetUserId

func GetUserId(ctx context.Context) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL