auth

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidAuth = errors.New("invalid auth")
)

Functions

func Alias

func Alias() map[string]string

func FactoryRegister

func FactoryRegister(key string, factory IAuthFactory)

FactoryRegister 注册auth工厂到默认auth工厂注册器

func Keys

func Keys() []string

Keys 返回默认的auth工厂注册器中所有已注册的key

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type IAuthFactory

type IAuthFactory interface {
	Create(tokenName string, position string, rule interface{}) (application.IAuth, error)
	Alias() []string
	Render() interface{}
	ConfigType() reflect.Type
	UserType() reflect.Type
	PreRouters() []*PreRouter
}

IAuthFactory 鉴权工厂方法

func Get

func Get(key string) (IAuthFactory, bool)

Get 从默认auth工厂注册器中获取auth工厂

func GetFactory

func GetFactory(name string) (IAuthFactory, error)

GetFactory 获取指定auth工厂,若指定的不存在则返回一个已注册的工厂

type IAuthFactoryRegister

type IAuthFactoryRegister interface {
	RegisterFactoryByKey(key string, factory IAuthFactory)
	GetFactoryByKey(key string) (IAuthFactory, bool)
	Keys() []string
	Alias() map[string]string
}

IAuthFactoryRegister 实现了鉴权工厂管理器

type PreRouter added in v0.15.11

type PreRouter struct {
	ID         string
	PreHandler router.IRouterPreHandler
	Path       string
	Method     []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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