common

package
v0.0.0-...-79307e8 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Runtime = NewApplication()

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication() Application

NewApplication 默认值

func (*Application) Cache

func (e *Application) Cache() storage.AdapterCache

WxCache 获取cache

func (*Application) GetCasbin

func (e *Application) GetCasbin() *casbin.SyncedEnforcer

func (*Application) GetCrontab

func (e *Application) GetCrontab() *cronjob.CronJob

GetCrontab 获取所有map里的crontab数据

func (*Application) GetDb

func (e *Application) GetDb() *gorm.DB

GetDb 获取所有map里的db数据

func (*Application) GetEngine

func (e *Application) GetEngine() http.Handler

GetEngine 获取路由引擎

func (*Application) GetRouter

func (e *Application) GetRouter() []Router

GetRouter 获取路由表

func (*Application) GetStreamMessage

func (e *Application) GetStreamMessage(id, stream string, value map[string]interface{}) (storage.Messager, error)

GetStreamMessage 获取队列需要用的message

func (*Application) Locker

func (e *Application) Locker() storage.AdapterLocker

Locker 获取分布式锁

func (*Application) Queue

func (e *Application) Queue() storage.AdapterQueue

Queue 获取queue

func (*Application) SetCacheAdapter

func (e *Application) SetCacheAdapter(c storage.AdapterCache)

SetCacheAdapter 设置缓存

func (*Application) SetCasbin

func (e *Application) SetCasbin(enforcer *casbin.SyncedEnforcer)

func (*Application) SetCrontab

func (e *Application) SetCrontab(crontab *cronjob.CronJob)

SetCrontab 设置对应key的crontab

func (*Application) SetDb

func (e *Application) SetDb(db *gorm.DB)

SetDb 设置对应key的db

func (*Application) SetEngine

func (e *Application) SetEngine(engine http.Handler)

SetEngine 设置路由引擎

func (*Application) SetLockerAdapter

func (e *Application) SetLockerAdapter(c storage.AdapterLocker)

SetLockerAdapter 设置分布式锁

func (*Application) SetQueueAdapter

func (e *Application) SetQueueAdapter(c storage.AdapterQueue)

SetQueueAdapter 设置队列适配器

type Router

type Router struct {
	HttpMethod, RelativePath, Handler string
}

type Routers

type Routers struct {
	List []Router
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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