Help us shape the future of Go! Take the 2026 Go Developer Survey

index

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provides = wire.NewSet(
	wire.Struct(new(Controller), "*"),
	wire.Struct(new(Service), "*"),
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	IndexService *Service
}

func (*Controller) GetNavs

func (x *Controller) GetNavs(ctx context.Context, c *app.RequestContext)

GetNavs 导航数据 @router /navs [GET]

func (*Controller) GetOptions

func (x *Controller) GetOptions(ctx context.Context, c *app.RequestContext)

GetOptions 返回通用配置 @router /options [GET]

func (*Controller) GetRefreshCode

func (x *Controller) GetRefreshCode(ctx context.Context, c *app.RequestContext)

GetRefreshCode 获取刷新令牌验证码 @router /code [GET]

func (*Controller) GetUser

func (x *Controller) GetUser(ctx context.Context, c *app.RequestContext)

GetUser 获取授权用户信息 @router /user [GET]

func (*Controller) Index

func (x *Controller) Index(ctx context.Context, c *app.RequestContext)

Index 入口 @router / [GET]

func (*Controller) SetUser

func (x *Controller) SetUser(ctx context.Context, c *app.RequestContext)

SetUser 设置授权用户信息 @router /user [PATCH]

func (*Controller) UnsetUser

func (x *Controller) UnsetUser(ctx context.Context, c *app.RequestContext)

UnsetUser 取消授权用户信息 @router /unset-user [POST]

func (*Controller) VerifyRefreshCode

func (x *Controller) VerifyRefreshCode(ctx context.Context, c *app.RequestContext)

VerifyRefreshCode 校验刷新令牌验证码 @router /refresh_token [POST]

type Service

type Service struct {
	Values *common.Values

	SessionService     *sessions.Service
	UsersService       *users.Service
	RolesService       *roles.Service
	DepartmentsService *departments.Service

	Captcha *captcha.Captcha
	Locker  *locker.Locker
}

func (*Service) AuthVerify

func (x *Service) AuthVerify(ctx context.Context, uid string, jti string) (err error)

AuthVerify 认证鉴权、权限验证、会话续约

func (*Service) GetOptions

func (x *Service) GetOptions(v string) utils.H

GetOptions 返回通用配置

func (*Service) GetRefreshCode

func (x *Service) GetRefreshCode(ctx context.Context, uid string) (code string, err error)

GetRefreshCode 获取刷新令牌验证码

func (*Service) GetUser

func (x *Service) GetUser(ctx context.Context, uid string) (data map[string]interface{}, err error)

GetUser 获取授权用户信息

func (*Service) Login

func (x *Service) Login(ctx context.Context, identity string, password string) (_ common.Active, err error)

Login 登录

func (*Service) LoginSession

func (x *Service) LoginSession(ctx context.Context, uid string, jti string) (err error)

LoginSession 建立登录会话,移除锁定

func (*Service) LogoutSession

func (x *Service) LogoutSession(ctx context.Context, uid string) (err error)

LogoutSession 注销登录会话

func (*Service) SetUser

func (x *Service) SetUser(ctx context.Context, id string, data interface{}) (interface{}, error)

SetUser 设置授权用户信息

func (*Service) UnsetUser

func (x *Service) UnsetUser(ctx context.Context, id string, mate string) (interface{}, error)

UnsetUser 取消授权用户信息

Jump to

Keyboard shortcuts

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