apps

package
v0.0.0-...-78a9a19 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HostService host.Service
)

1. HostService的实例必须注册过来,不然HostService就是一个nil,在服务启动的时候注册 2. HTTP暴露模块,依赖IOC中的HostService

Functions

func GetImpl

func GetImpl(name string) interface{}

根据名称,返回一个对象,任何类型都可以,具体的使用由使用方通过断言的方式进行判断和使用 从implApps中去获取这个指定名称的对象

func InitGin

func InitGin(r gin.IRouter)

func InitImpl

func InitImpl()

用于初始化注册到IOC中的所有服务

func LoadedGinApps

func LoadedGinApps() (names []string)

已经加载的完成的Gin App列表

func RegistryGin

func RegistryGin(svc GinService)

func RegistryImpl

func RegistryImpl(svc ImplService)

Types

type GinService

type GinService interface {
	Registry(r gin.IRouter)
	Config()
	Name() string
}

注册由Gin编写的Http Handler 比如实现了HTTP A,只需要实现Registry()方法,就能把Handler注册给Root Handler

type ImplService

type ImplService interface {
	Config()
	Name() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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