interface_core

package
v0.0.0-...-294a70e Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICache

type ICache interface {
	GetBackend() (result *redis.Client, err error)
	Get(key string) (result string, err error)
	Set(key string, value string) (result string, err error)
	SetEx(key string, value string, ttl time.Duration) (result string, err error)
	Del(key string) (result bool, err error)
	Exists(key string) (result bool, err error)
	Incr(key string) (result int64, err error)
	Decr(key string) (result int64, err error)
	CreateKey(key string) string
}

type ICaptcha

type ICaptcha interface {
	New() (result *types.Captcha, err error)
	Reload(id string) (result *types.Captcha, err error)
	Verify(id string, digits string) (result bool, err error)
}

type IDataBase

type IDataBase interface {
	GetDB() *gorm.DB
}

type IDrawCenter

type IDrawCenter interface {
	Draw(actionId string, playerId string) (result model_draw.Result, err error)
	Verify(actionId string, playerId string, giftId string, verify bool) (result model_draw.VerifyResult, err error)
	GetAction(actionId string) (result model_draw.Action, err error)
	GetActionGifts(actionId string) (result []model_draw.Gift, err error)
	GetActionWinners(actionId string) (result []model_draw.Player, err error)
	GetGift(actionId string, giftId string) (result model_draw.Gift, err error)
	GetPlayer(actionId string, playerId string) (result model_draw.Player, err error)
	GetPlayerGifts(actionId string, playerId string) (result []model_draw.Gift, err error)
}

type IJwtService

type IJwtService interface {
	// CreateToken 生成Token,默认存入Cookie中
	CreateToken(ctx iris.Context, claims interface{}) (token string, err error)
	// GetClaims 验证Token并返回其中包含的Claims对象指针,需要在Middleware处理后才能获得,如需手动验证,请使用VerifyToken方法,强烈建议使用此方法
	GetClaims(ctx iris.Context) (claims interface{})
	// VerifyToken 从默认渠道(Cookie)中获取Token信息并验证,验证成功后返回VerifiedToken对象,仅用于手动验证,不建议使用
	VerifyToken(ctx iris.Context) (result *jwt.VerifiedToken, err error)
	// RemoveToken 从Cookie中移除Token信息,一般用于"注销"功能
	RemoveToken(ctx iris.Context)
	// GetMiddleware 获取iris路由中间件,用于验证请求合法性
	GetMiddleware() iris.Handler
}

type ILruCache

type ILruCache interface {
	Add(key, value interface{}) (success bool)
	AddEx(key, value interface{}, expire time.Duration) (success bool)
	Get(key interface{}) (result interface{}, success bool)
	Contains(key interface{}) (success bool)
	Peek(key interface{}) (result interface{}, success bool)
	ContainsOrAdd(key, value interface{}) (success, evict bool)
	Remove(key interface{})
	RemoveOldest()
	Keys() (result []interface{})
	Len() (result int)
	Purge()
}

type IMsgCenter

type IMsgCenter interface {
	CreateAppChannelId(channelId string) (result string, err error)
	OpenChannel(channelIds []string, onReceiveMsg func(*types.MsgContent)) (err error)
	CloseChannel(channelIds []string) (err error)
	SendMsg(channelId, msgType, msg string) (err error)
}

type ISessionCache

type ISessionCache interface {
	Get(ctx iris.Context, key string) (result string, err error)
	Set(ctx iris.Context, key string, value string, ttl time.Duration) (result string, err error)
	Del(ctx iris.Context, key string) (result bool, err error)
	Exists(ctx iris.Context, key string) (result bool, err error)
	Incr(ctx iris.Context, key string) (result int64, err error)
	GetCacheKey(ctx iris.Context, key string) string
	Md5(str string) string
}

type ITaskCenter

type ITaskCenter interface {
	GetServer() (result server.Server)
	GetClient(clientPoolSize int) (result server.Client)
}

type IViewModel

type IViewModel interface {
	FromView() error
	FromDB() error
}

type IWxAuth

type IWxAuth interface {
	GetCurrentUser(ctx iris.Context) *types.WxAuthInfo
	CheckAuth(ctx iris.Context, returnUrl string) (result bool)
	DoAuth(ctx iris.Context)
}

Jump to

Keyboard shortcuts

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