auth

package
v1.0.0-beta-2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MultiReCvErr = drpc.NewStatus(
	drpc.CodeInternalServerError,
	"auth-checker plugin usage is incorrect",
	"multiple call ReCvOnce function",
)

MultiReCvErr authCheckerPlugin 并发认证限制

View Source
var MultiSendErr = drpc.NewStatus(
	drpc.CodeWriteFailed,
	"auth-bearer plugin usage is incorrect",
	"multiple call SendOnce function",
)

MultiSendErr authBearerPlugin组件并发发送限制

Functions

func NewBearerPlugin

func NewBearerPlugin(fn Bearer, setting ...message.MsgSetting) drpc.Plugin

NewBearerPlugin 创建票据生成插件

func NewCheckerPlugin

func NewCheckerPlugin(fn Checker, setting ...message.MsgSetting) drpc.Plugin

NewCheckerPlugin 创建票据检查插件

Types

type Bearer

type Bearer func(sess Session, fn SendOnce) *drpc.Status

Bearer 生成认证票据,并发送到对应的端

type Checker

type Checker func(sess Session, fn ReCvOnce) (ret interface{}, stat *drpc.Status)

Checker 检票方法,检查对端传入的票据是否合法

type ReCvOnce

type ReCvOnce func(infoReCv interface{}) *drpc.Status

ReCvOnce 检票

type SendOnce

type SendOnce func(info, retReCv interface{}) *drpc.Status

SendOnce 发送到对应端

type Session

type Session interface {
	Endpoint() drpc.Endpoint //会话所在endpoint
	SetID(newID string)      // 设置会话id
	LocalAddr() net.Addr     // 当前会话监听地址端口
	RemoteAddr() net.Addr    // 远端地址端口
	Swap() *gmap.Map         // 会话的缓冲区
}

Session 在权限认证组件中,会话只暴露以下方法

Jump to

Keyboard shortcuts

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