common

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Runtime = NewApplication()

Functions

func SetupRuntimeForTest added in v1.0.20

func SetupRuntimeForTest(dbFilename string)

SetupRuntimeForTest for test purpose

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) GetMiddleware added in v1.1.15

func (e *Application) GetMiddleware() *jwt.GinJWTMiddleware

GetEngine 获取mw

func (*Application) GetOss added in v1.0.20

func (e *Application) GetOss() oss.Oss

SetOss 设置Oss service

func (*Application) GetRouter

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

GetRouter 获取路由表

func (*Application) GetSms added in v1.0.20

func (e *Application) GetSms() sms.Sms

SetSms 设置Sms service

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) SetMiddleware added in v1.1.15

func (e *Application) SetMiddleware(mw *jwt.GinJWTMiddleware)

SetEngine 设置mw

func (*Application) SetOss added in v1.0.20

func (e *Application) SetOss(oss oss.Oss)

SetOss 设置Oss service

func (*Application) SetQueueAdapter

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

SetQueueAdapter 设置队列适配器

func (*Application) SetSms added in v1.0.20

func (e *Application) SetSms(sms sms.Sms)

SetSms 设置Sms service

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