GAAS 广汽安道拓GFrame金属件MOM项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

30 lines
739 B

package container
import (
"github.com/kataras/iris/core/router"
"leit.com/LAPP_GAAS_GFrame/grmi/rpc"
)
type ComponentContainer interface {
Parse(perserInstance interface{}) error
Errors() []string
ServiceInfos() []InvokerInfo
None() Invoker
}
func NewComponentContainer() ComponentContainer {
return &DefaultComponentContainer{
errors: make([]string, 0, 100),
serviceInfos: make([]InvokerInfo, 0, 100),
none: NewNoneInvoker(),
}
}
func Bind(container ComponentContainer, party router.Party) error {
//rpc.RegisterHandler(party, "/Ping", builder.BuildServiceHandler(container.None()))
for _, info := range container.ServiceInfos() {
rpc.RegisterHandler(party, info.Path, info.Invoker)
}
return nil
}