Documentation ¶
Index ¶
- func NewCache(prefix string, store storage.AdapterCache) storage.AdapterCache
- func NewLocker(prefix string, locker storage.AdapterLocker) storage.AdapterLocker
- func NewQueue(prefix string, queue storage.AdapterQueue) storage.AdapterQueue
- type Application
- func (e *Application) Bot() *telebot.Bot
- func (e *Application) BotHook() telebot.Hook
- func (e *Application) Cache() storage.AdapterCache
- func (e *Application) Config(ctx context.Context, pattern string) *gvar.Var
- func (e *Application) Cron() cron.Adapter
- func (e *Application) GetCacheAdapter() storage.AdapterCache
- func (e *Application) GetCachePrefix(key string) storage.AdapterCache
- func (e *Application) GetCasbin() map[string]*casbin.SyncedEnforcer
- func (e *Application) GetCasbinKey(key string) *casbin.SyncedEnforcer
- func (e *Application) GetConfig() *gcfg.Config
- func (e *Application) GetJwt() map[string]*jwt.GfJWTMiddleware
- func (e *Application) GetJwtKey(moduleKey string) *jwt.GfJWTMiddleware
- func (e *Application) GetLang() *gi18n.Manager
- func (e *Application) GetLockerAdapter() storage.AdapterLocker
- func (e *Application) GetLockerPrefix(key string) storage.AdapterLocker
- func (e *Application) GetMemoryQueue(prefix string) storage.AdapterQueue
- func (e *Application) GetQueueAdapter(key string) storage.AdapterQueue
- func (e *Application) GetQueueMessage(id, routingKey string, value map[string]interface{}) (storage.Messager, error)
- func (e *Application) GetRabbitQueue(prefix string) storage.AdapterQueue
- func (e *Application) GetRocketQueue(prefix string) storage.AdapterQueue
- func (e *Application) GetWebSocket() *ws.Instance
- func (e *Application) Lang(ctx context.Context, langKey string) string
- func (e *Application) MemoryTask() task.MemoryService
- func (e *Application) Monitor() *metrics.Monitor
- func (e *Application) RabbitTask() task.RabbitMqService
- func (e *Application) RocketMqTask() task.RocketMqService
- func (e *Application) Server() *ghttp.Server
- func (e *Application) SetBot(b *telebot.Bot)
- func (e *Application) SetBotHook(b telebot.Hook)
- func (e *Application) SetCache(c storage.AdapterCache)
- func (e *Application) SetCasbin(key string, enforcer *casbin.SyncedEnforcer)
- func (e *Application) SetConfig(c *gcfg.Config)
- func (e *Application) SetCron(srv cron.Adapter)
- func (e *Application) SetJwt(key string, jwtIns *jwt.GfJWTMiddleware)
- func (e *Application) SetLang(lang *gi18n.Manager)
- func (e *Application) SetLockerAdapter(c storage.AdapterLocker)
- func (e *Application) SetMemoryTask(srv task.MemoryService)
- func (e *Application) SetMetrics(m *metrics.Monitor)
- func (e *Application) SetQueueAdapter(key string, c storage.AdapterQueue)
- func (e *Application) SetRabbitTask(srv task.RabbitMqService)
- func (e *Application) SetRocketMqTask(srv task.RocketMqService)
- func (e *Application) SetServer(srv *ghttp.Server)
- func (e *Application) SetSettings(c *config.Settings)
- func (e *Application) SetTask(srv task.TasksService)
- func (e *Application) SetTus(t *tus.Uploader)
- func (e *Application) SetWebSocket(s *ws.Instance)
- func (e *Application) Settings() *config.Settings
- func (e *Application) Task() task.TasksService
- func (e *Application) Tus() *tus.Uploader
- func (e *Application) WebSocket() *ws.Instance
- type Cache
- func (e *Cache) Connect() error
- func (e *Cache) Decrease(ctx context.Context, key string) error
- func (e *Cache) Del(ctx context.Context, key string) error
- func (e *Cache) Expire(ctx context.Context, key string, dur time.Duration) error
- func (e *Cache) Get(ctx context.Context, key string) (*gvar.Var, error)
- func (e *Cache) HashDel(ctx context.Context, hk, key string) error
- func (e *Cache) HashGet(ctx context.Context, hk, key string) (*gvar.Var, error)
- func (e *Cache) Increase(ctx context.Context, key string) error
- func (e *Cache) Set(ctx context.Context, key string, val interface{}, expire int) error
- func (e *Cache) SetPrefix(prefix string)
- func (e *Cache) String() string
- type Locker
- type Queue
- type Runtime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCache ¶
func NewCache(prefix string, store storage.AdapterCache) storage.AdapterCache
NewCache 创建对应上下文缓存
func NewLocker ¶
func NewLocker(prefix string, locker storage.AdapterLocker) storage.AdapterLocker
NewLocker 创建对应上下文分布式锁
func NewQueue ¶
func NewQueue(prefix string, queue storage.AdapterQueue) storage.AdapterQueue
NewQueue 创建对应上下文队列
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func (*Application) Bot ¶ added in v1.0.5
func (e *Application) Bot() *telebot.Bot
func (*Application) BotHook ¶ added in v1.0.7
func (e *Application) BotHook() telebot.Hook
func (*Application) Cache ¶ added in v0.3.3
func (e *Application) Cache() storage.AdapterCache
func (*Application) Cron ¶
func (e *Application) Cron() cron.Adapter
func (*Application) GetCacheAdapter ¶
func (e *Application) GetCacheAdapter() storage.AdapterCache
GetCacheAdapter 获取缓存
func (*Application) GetCachePrefix ¶
func (e *Application) GetCachePrefix(key string) storage.AdapterCache
GetCachePrefix 获取带租户标记的cache
func (*Application) GetCasbin ¶
func (e *Application) GetCasbin() map[string]*casbin.SyncedEnforcer
func (*Application) GetCasbinKey ¶
func (e *Application) GetCasbinKey(key string) *casbin.SyncedEnforcer
GetCasbinKey 根据key获取casBin
func (*Application) GetConfig ¶
func (e *Application) GetConfig() *gcfg.Config
func (*Application) GetJwt ¶
func (e *Application) GetJwt() map[string]*jwt.GfJWTMiddleware
func (*Application) GetJwtKey ¶
func (e *Application) GetJwtKey(moduleKey string) *jwt.GfJWTMiddleware
GetJwtKey 根据key获取Jwt
func (*Application) GetLang ¶
func (e *Application) GetLang() *gi18n.Manager
func (*Application) GetLockerAdapter ¶
func (e *Application) GetLockerAdapter() storage.AdapterLocker
GetLockerAdapter 获取分布式锁
func (*Application) GetLockerPrefix ¶
func (e *Application) GetLockerPrefix(key string) storage.AdapterLocker
func (*Application) GetMemoryQueue ¶
func (e *Application) GetMemoryQueue(prefix string) storage.AdapterQueue
func (*Application) GetQueueAdapter ¶
func (e *Application) GetQueueAdapter(key string) storage.AdapterQueue
GetQueueAdapter 获取队列适配器
func (*Application) GetQueueMessage ¶
func (e *Application) GetQueueMessage(id, routingKey string, value map[string]interface{}) (storage.Messager, error)
GetQueueMessage 获取队列需要用的message
func (*Application) GetRabbitQueue ¶
func (e *Application) GetRabbitQueue(prefix string) storage.AdapterQueue
func (*Application) GetRocketQueue ¶
func (e *Application) GetRocketQueue(prefix string) storage.AdapterQueue
func (*Application) GetWebSocket ¶
func (e *Application) GetWebSocket() *ws.Instance
func (*Application) Lang ¶
func (e *Application) Lang(ctx context.Context, langKey string) string
Lang 多语言翻译
func (*Application) MemoryTask ¶ added in v0.1.5
func (e *Application) MemoryTask() task.MemoryService
func (*Application) Monitor ¶ added in v0.4.3
func (e *Application) Monitor() *metrics.Monitor
func (*Application) RabbitTask ¶ added in v0.1.4
func (e *Application) RabbitTask() task.RabbitMqService
func (*Application) RocketMqTask ¶ added in v0.1.5
func (e *Application) RocketMqTask() task.RocketMqService
func (*Application) Server ¶
func (e *Application) Server() *ghttp.Server
func (*Application) SetBot ¶ added in v1.0.5
func (e *Application) SetBot(b *telebot.Bot)
func (*Application) SetBotHook ¶ added in v1.0.7
func (e *Application) SetBotHook(b telebot.Hook)
func (*Application) SetCache ¶ added in v0.3.3
func (e *Application) SetCache(c storage.AdapterCache)
SetCache 设置缓存
func (*Application) SetCasbin ¶
func (e *Application) SetCasbin(key string, enforcer *casbin.SyncedEnforcer)
func (*Application) SetConfig ¶
func (e *Application) SetConfig(c *gcfg.Config)
func (*Application) SetCron ¶
func (e *Application) SetCron(srv cron.Adapter)
func (*Application) SetJwt ¶
func (e *Application) SetJwt(key string, jwtIns *jwt.GfJWTMiddleware)
func (*Application) SetLang ¶
func (e *Application) SetLang(lang *gi18n.Manager)
func (*Application) SetLockerAdapter ¶
func (e *Application) SetLockerAdapter(c storage.AdapterLocker)
SetLockerAdapter 设置分布式锁
func (*Application) SetMemoryTask ¶ added in v0.1.5
func (e *Application) SetMemoryTask(srv task.MemoryService)
func (*Application) SetMetrics ¶ added in v0.4.3
func (e *Application) SetMetrics(m *metrics.Monitor)
func (*Application) SetQueueAdapter ¶
func (e *Application) SetQueueAdapter(key string, c storage.AdapterQueue)
SetQueueAdapter 设置队列适配器
func (*Application) SetRabbitTask ¶ added in v0.1.4
func (e *Application) SetRabbitTask(srv task.RabbitMqService)
func (*Application) SetRocketMqTask ¶ added in v0.1.5
func (e *Application) SetRocketMqTask(srv task.RocketMqService)
func (*Application) SetServer ¶
func (e *Application) SetServer(srv *ghttp.Server)
func (*Application) SetSettings ¶ added in v0.2.3
func (e *Application) SetSettings(c *config.Settings)
func (*Application) SetTask ¶ added in v0.1.6
func (e *Application) SetTask(srv task.TasksService)
func (*Application) SetTus ¶ added in v0.3.8
func (e *Application) SetTus(t *tus.Uploader)
func (*Application) SetWebSocket ¶
func (e *Application) SetWebSocket(s *ws.Instance)
func (*Application) Settings ¶ added in v0.2.3
func (e *Application) Settings() *config.Settings
func (*Application) Task ¶ added in v0.1.6
func (e *Application) Task() task.TasksService
func (*Application) Tus ¶ added in v0.3.8
func (e *Application) Tus() *tus.Uploader
func (*Application) WebSocket ¶
func (e *Application) WebSocket() *ws.Instance
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) Consumer ¶
func (e *Queue) Consumer(ctx context.Context, name string, f storage.ConsumerFunc, optionFuncs ...func(*storage.ConsumeOptions))
Consumer 注册消费者
type Runtime ¶
type Runtime interface { // SetServer Http Server SetServer(srv *ghttp.Server) Server() *ghttp.Server // SetCasbin casbin module SetCasbin(key string, enforcer *casbin.SyncedEnforcer) GetCasbin() map[string]*casbin.SyncedEnforcer GetCasbinKey(key string) *casbin.SyncedEnforcer // SetJwt jwt module SetJwt(key string, jwtIns *jwt.GfJWTMiddleware) GetJwt() map[string]*jwt.GfJWTMiddleware GetJwtKey(moduleKey string) *jwt.GfJWTMiddleware // SetLang gi18n SetLang(lang *gi18n.Manager) GetLang() *gi18n.Manager Lang(ctx context.Context, langKey string) string // SetConfig config SetConfig(c *gcfg.Config) GetConfig() *gcfg.Config Config(ctx context.Context, pattern string) *gvar.Var SetSettings(c *config.Settings) Settings() *config.Settings // SetCache cache SetCache(storage.AdapterCache) Cache() storage.AdapterCache GetCacheAdapter() storage.AdapterCache GetCachePrefix(string) storage.AdapterCache // SetWebSocket websocket SetWebSocket(s *ws.Instance) WebSocket() *ws.Instance GetWebSocket() *ws.Instance GetMemoryQueue(prefix string) storage.AdapterQueue GetRabbitQueue(prefix string) storage.AdapterQueue GetRocketQueue(prefix string) storage.AdapterQueue SetQueueAdapter(string, storage.AdapterQueue) GetQueueAdapter(key string) storage.AdapterQueue GetQueueMessage(id, routingKey string, value map[string]interface{}) (storage.Messager, error) SetLockerAdapter(storage.AdapterLocker) GetLockerAdapter() storage.AdapterLocker GetLockerPrefix(string) storage.AdapterLocker SetCron(srv cron.Adapter) Cron() cron.Adapter SetTask(srv task.TasksService) Task() task.TasksService SetRabbitTask(srv task.RabbitMqService) RabbitTask() task.RabbitMqService SetRocketMqTask(srv task.RocketMqService) RocketMqTask() task.RocketMqService SetMemoryTask(srv task.MemoryService) MemoryTask() task.MemoryService SetTus(c *tus.Uploader) Tus() *tus.Uploader SetMetrics(m *metrics.Monitor) Monitor() *metrics.Monitor SetBotHook(b telebot.Hook) BotHook() telebot.Hook SetBot(b *telebot.Bot) Bot() *telebot.Bot }
Click to show internal directories.
Click to hide internal directories.