auth

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2017 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DEFAULT_PERMISSION int64 = 750

Variables

This section is empty.

Functions

func InitJwtMiddleware

func InitJwtMiddleware(secret []byte)

func StartsWith

func StartsWith(bigStr string, smallString string) bool

Types

type AuthMiddleWare

type AuthMiddleWare struct {
	// contains filtered or unexported fields
}

func NewAuthMiddleware

func NewAuthMiddleware(db *sqlx.DB, userCrud api2go.CRUD, userGroupCrud api2go.CRUD, userUserGroupCrud api2go.CRUD) *AuthMiddleWare

func NewAuthMiddlewareBuilder

func NewAuthMiddlewareBuilder(db *sqlx.DB) *AuthMiddleWare

func (*AuthMiddleWare) AuthCheckMiddleware

func (a *AuthMiddleWare) AuthCheckMiddleware(c *gin.Context)

func (*AuthMiddleWare) SetUserCrud

func (a *AuthMiddleWare) SetUserCrud(curd api2go.CRUD)

func (*AuthMiddleWare) SetUserGroupCrud

func (a *AuthMiddleWare) SetUserGroupCrud(curd api2go.CRUD)

func (*AuthMiddleWare) SetUserUserGroupCrud

func (a *AuthMiddleWare) SetUserUserGroupCrud(curd api2go.CRUD)

type CmsUser

type CmsUser interface {
	GetName() string
	GetEmail() string
	IsGuest() bool
	IsLoggedIn() bool
}

func GetUser

func GetUser(req *http.Request) *CmsUser

type GroupPermission

type GroupPermission struct {
	ReferenceId string `json:"reference_id"`
	Permission  int64  `json:"permission"`
}

Jump to

Keyboard shortcuts

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