factory

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("404")
)

Functions

func Add added in v1.9.10

func Add[T any](o *T, name ...string)

Add 保存

@Code var some Add(&some)

func Get added in v1.9.10

func Get[T any](ptrType *T, name ...string) (err error)

Get 获取

var some; 必须用: Get(&some). 原理是: 变量先存在于内存中. 如果定义一个指针, 必须是var some=new(type)

func GetAmqp

func GetAmqp() (session rabbit.Session)

func GetCache

func GetCache() (c cache.C)

func GetCtx

func GetCtx() (ctx context.Context)

func GetMqtt added in v1.10.0

func GetMqtt() (session mqtt.Session)

func GetNamedOrm

func GetNamedOrm(aliaName string) *persistence.OrmContext

func GetOrm

func GetOrm() *persistence.OrmContext

func RegisterAmqp

func RegisterAmqp(session rabbit.Session)

func RegisterCache

func RegisterCache(c cache.C)

func RegisterCtx

func RegisterCtx(ctx context.Context)

func RegisterMqtt added in v1.10.0

func RegisterMqtt(session mqtt.Session)

Types

This section is empty.

Jump to

Keyboard shortcuts

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