bean

package
v0.0.0-...-d6ebf68 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

由于没有泛型, 每个类型都需要手动添加方法... 比如 AutoWiredGorm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(beanName string) interface{}

从 beanMap 中 获取 bean 对象

如果 bean 对象为空, 则直接 panic 程序

func GetGorm

func GetGorm(beanName string) *gorm.DB

获取 gorm 对象...

示例 tag: `bean-gorm:"master"`

func RegisterBeans

func RegisterBeans(cfg types.Any)

注册 bean

层级不能太多, 否则可能会引发 stack overflow.

cfg must be a config ptr.

func RunSetter

func RunSetter(entry func())

set 方法

传入一个注册方法 .

Types

This section is empty.

Jump to

Keyboard shortcuts

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