apps

package
v0.0.0-...-e06e715 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 40 Service, 怎么办? 写40个定义,
	// 使用Interface{} + 断言进行抽象
	HostService host.Service
)

Functions

func GetImp

func GetImp(name string) interface{}

返回一个对象,任何类型都可以,使用时,由使用方进行断言

func InitGin

func InitGin(r gin.IRouter)

func InitImpl

func InitImpl()

func LoadGinApps

func LoadGinApps() (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编写的handler 如果编写了http服务A,只要实现了Registry方法,就能把Handler注册给root Router

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