auth

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

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