runtime

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

func NewConfig

func NewConfig() *Application

NewConfig 默认值

func (*Application) GetConfig

func (e *Application) GetConfig(key string) interface{}

func (*Application) GetDb

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

GetDb 获取所有map里的db数据

func (*Application) GetDynamicDb

func (e *Application) GetDynamicDb(name string) *gorm.DB

GetDynamicDb 获取所有map里的db数据

func (*Application) GetEngine

func (e *Application) GetEngine() *fiber.App

GetEngine 获取路由引擎

func (*Application) GetEs

func (e *Application) GetEs() *elasticsearch.TypedClient

func (*Application) GetRedis

func (e *Application) GetRedis() *redisClient.RedisClient

func (*Application) IsDebug

func (e *Application) IsDebug() bool

func (*Application) Mode

func (e *Application) Mode(value ...string) string

func (*Application) SetConfig

func (e *Application) SetConfig(key string, value interface{})

func (*Application) SetDb

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

SetDb 设置对应key的db

func (*Application) SetDynamicDb

func (e *Application) SetDynamicDb(name string, db *gorm.DB)

SetDynamicDb 设置对应key的db

func (*Application) SetEngine

func (e *Application) SetEngine(engine *fiber.App)

SetEngine 设置路由引擎

func (*Application) SetEs

func (e *Application) SetEs(es *elasticsearch.TypedClient)

SetEs 设置对应key的es

func (*Application) SetRedis

func (e *Application) SetRedis(redis *redisClient.RedisClient)

type ReflectFunc

type ReflectFunc struct {
	Type  reflect.Type
	Value reflect.Value
}

func (*ReflectFunc) Call

func (r *ReflectFunc) Call(params ...any) []reflect.Value

func (*ReflectFunc) CallMethod

func (r *ReflectFunc) CallMethod(name string, params ...any) []reflect.Value

func (*ReflectFunc) Of

func (r *ReflectFunc) Of(f any) (params []any)

type Runtime

type Runtime interface {
	Mode(value ...string) string
	IsDebug() bool
	SetDb(db *gorm.DB)
	GetDb() *gorm.DB

	SetDynamicDb(name string, db *gorm.DB)
	GetDynamicDb(name string) *gorm.DB

	SetEs(es *elasticsearch.TypedClient)
	GetEs() *elasticsearch.TypedClient

	// SetEngine 使用的路由
	SetEngine(engine *fiber.App)
	GetEngine() *fiber.App

	GetConfig(key string) interface{}
	SetConfig(key string, value interface{})

	SetRedis(redis *redisClient.RedisClient)
	GetRedis() *redisClient.RedisClient
}

Jump to

Keyboard shortcuts

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