ioc

package
v0.0.0-...-d15be54 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

依赖注入IOC

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy() error

func Init

func Init() error

func RegisterGinApi

func RegisterGinApi(router gin.IRouter) error

Types

type Container

type Container struct {
	C_Storage map[string]Ioc
}

func Api

func Api() *Container

func Conf

func Conf() *Container

func Controller

func Controller() *Container

func NewContainer

func NewContainer() *Container

构造函数

func (*Container) Get

func (c *Container) Get(AppName string) any

func (*Container) Register

func (c *Container) Register(AppName string, ioc Ioc)

type Ioc

type Ioc interface {
	Init() error
	Destroy() error
}

type NameSpace

type NameSpace struct {
	N_Storage map[string]*Container
}

func (*NameSpace) Destroy

func (n *NameSpace) Destroy() error

func (*NameSpace) Init

func (n *NameSpace) Init() error

func (*NameSpace) RegisterApi

func (n *NameSpace) RegisterApi(router gin.IRouter) error

type RegisterApi

type RegisterApi interface {
	Ioc
	RegisterApi(router gin.IRouter) error
}

Jump to

Keyboard shortcuts

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