controller

package
v0.0.0-...-097943f Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller external service interface

func New

func New(db *sql.DB, getID func(c *gin.Context) (uint32, error)) *Controller

New create an external service interface

func (*Controller) CheckPermission

func (c *Controller) CheckPermission() func(ctx *gin.Context)

CheckPermission middleware that checks the permission

func (*Controller) InitWithUserAPI

func (c *Controller) InitWithUserAPI()

todo: add configuration on userAuth-defined API

func (*Controller) RegisterRouter

func (c *Controller) RegisterRouter(r gin.IRouter)

RegisterRouter register router and from now on, every API would check if valid on current AdminID. Should init the permission to the API.

Jump to

Keyboard shortcuts

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