Documentation
¶
Index ¶
- type AccessTokenImp
- func (this *AccessTokenImp) Add(tb TokenCreator)
- func (this *AccessTokenImp) Before(api *meta.Api, ctx *fasthttp.RequestCtx) (bool, error)
- func (this *AccessTokenImp) Call(req *fasthttp.Request) *fasthttp.Response
- func (this *AccessTokenImp) Init(addr string, db int, expire int64, rmm core.RoleMetaManager)
- type BalancePlugin
- type LuaPlugin
- type PluginCore
- type RedisTokenStore
- type TokenCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenImp ¶
type AccessTokenImp struct { runtime.BaseIntercepter // contains filtered or unexported fields }
func (*AccessTokenImp) Add ¶
func (this *AccessTokenImp) Add(tb TokenCreator)
func (*AccessTokenImp) Before ¶
func (this *AccessTokenImp) Before(api *meta.Api, ctx *fasthttp.RequestCtx) (bool, error)
func (*AccessTokenImp) Call ¶
func (this *AccessTokenImp) Call(req *fasthttp.Request) *fasthttp.Response
func (*AccessTokenImp) Init ¶
func (this *AccessTokenImp) Init(addr string, db int, expire int64, rmm core.RoleMetaManager)
type BalancePlugin ¶
type BalancePlugin struct {
LuaPlugin
}
func (*BalancePlugin) Config ¶
func (this *BalancePlugin) Config(p string)
func (*BalancePlugin) Select ¶
func (this *BalancePlugin) Select(req *fasthttp.RequestCtx, servers *[]*meta.Server) *meta.Server
type LuaPlugin ¶
type LuaPlugin struct {
// contains filtered or unexported fields
}
func (*LuaPlugin) GetType ¶
func (this *LuaPlugin) GetType() runtime.PluginType
type PluginCore ¶
type PluginCore interface { GetFromContext(key string) interface{} //获取信息 SetContext(key string, v interface{}) //设置信息 }
*
插件 基于lua脚本的插件 1、内部的方法 2、功能的扩展
type RedisTokenStore ¶
type RedisTokenStore struct {
// contains filtered or unexported fields
}
func (*RedisTokenStore) GetToken ¶
func (this *RedisTokenStore) GetToken(id string) *core.AccessToken
获取token
func (*RedisTokenStore) Init ¶
func (this *RedisTokenStore) Init(addr string, db int)
func (*RedisTokenStore) SaveToken ¶
func (this *RedisTokenStore) SaveToken(id string, t *core.AccessToken, expire int64)
保存token
type TokenCreator ¶
type TokenCreator interface { GetGrandType() string BuildToken(user string, secret string) (bool, string) SetTokenManager(tm *core.TokenManager) }
*
基本的Access toke 实现 参数:grandtype ==access_token ,user==分配的用户或应用id,secret==秘钥
创建token的creator
Click to show internal directories.
Click to hide internal directories.