Documentation
¶
Index ¶
- Constants
- func InitIocObject() error
- func ListApiObjectNames() (names []string)
- func ListControllerObjectNames() (names []string)
- func LoadGinApi(pathPrefix string, root gin.IRouter)
- func LoadGoRestfulApi(pathPrefix string, root *restful.Container)
- func LoadGrpcController(server *grpc.Server)
- func ObjectUid(o IocObject) string
- func RegistryApi(obj IocObject)
- func RegistryController(obj IocObject)
- func RegistryObject(obj IocObject)
- func RegistryObjectWithNs(namespace string, obj IocObject)
- type DefaultStore
- type GRPCControllerObject
- type GinApiObject
- type GoRestfulApiObject
- type IocObject
- type IocObjectImpl
- type IocObjectSet
- func (s *IocObjectSet) Add(obj IocObject)
- func (s *IocObjectSet) Exist(name, version string) bool
- func (s *IocObjectSet) Get(name, version string) IocObject
- func (s *IocObjectSet) Len() int
- func (s *IocObjectSet) Less(i, j int) bool
- func (s *IocObjectSet) ObjectUids() (uids []string)
- func (s *IocObjectSet) Sort()
- func (s *IocObjectSet) Swap(i, j int)
Constants ¶
View Source
const (
ApiNamespace = "apis"
)
View Source
const (
ControllerNamespace = "controllers"
)
View Source
const (
DEFAULT_VERSION = "v1"
)
View Source
const (
DefaultNamespace = "default"
)
Variables ¶
This section is empty.
Functions ¶
func LoadGoRestfulApi ¶
LoadHttpApp 装载所有的http app
Types ¶
type DefaultStore ¶
type DefaultStore struct {
// contains filtered or unexported fields
}
func NewDefaultStore ¶
func NewDefaultStore() *DefaultStore
func (*DefaultStore) Namespace ¶
func (s *DefaultStore) Namespace(namespace string) *IocObjectSet
func (*DefaultStore) ShowRegistryObjectNames ¶
func (s *DefaultStore) ShowRegistryObjectNames() (names []string)
type GRPCControllerObject ¶
GRPCService GRPC服务的实例
type GinApiObject ¶
type GoRestfulApiObject ¶
type GoRestfulApiObject interface {
IocObject
Registry(*restful.WebService)
}
type IocObject ¶
type IocObject interface {
// 对象初始化
Init() error
// 对象的名称
Name() string
// 对象版本
Version() string
// 对象优先级
Priority() int
}
IocObject 内部服务实例, 不需要暴露
func GetApiWithVersion ¶ added in v1.9.17
获取API对象并指定版本
func GetControllerWithVersion ¶ added in v1.9.17
获取控制器对象
type IocObjectImpl ¶
type IocObjectImpl struct {
}
func (*IocObjectImpl) Init ¶
func (i *IocObjectImpl) Init() error
func (*IocObjectImpl) Name ¶
func (i *IocObjectImpl) Name() string
func (*IocObjectImpl) Priority ¶
func (i *IocObjectImpl) Priority() int
func (*IocObjectImpl) Version ¶ added in v1.9.17
func (i *IocObjectImpl) Version() string
type IocObjectSet ¶
type IocObjectSet struct {
Items []IocObject
}
func NewIocObjectSet ¶
func NewIocObjectSet() *IocObjectSet
func (*IocObjectSet) Add ¶
func (s *IocObjectSet) Add(obj IocObject)
func (*IocObjectSet) Exist ¶
func (s *IocObjectSet) Exist(name, version string) bool
func (*IocObjectSet) Get ¶
func (s *IocObjectSet) Get(name, version string) IocObject
func (*IocObjectSet) Len ¶
func (s *IocObjectSet) Len() int
func (*IocObjectSet) Less ¶
func (s *IocObjectSet) Less(i, j int) bool
func (*IocObjectSet) ObjectUids ¶ added in v1.9.17
func (s *IocObjectSet) ObjectUids() (uids []string)
func (*IocObjectSet) Swap ¶
func (s *IocObjectSet) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.