Documentation ¶
Index ¶
- Constants
- func Call(ctx *gin.Context, client, method string, req, rsp interface{}) (err error)
- func GetGinHandlerFunc() gin.HandlerFunc
- func GetService(app, service string) interface{}
- func Inject(instance interface{})
- func IsRpcService(instance interface{}) bool
- func Load()
- type RpcClientContainer
- type RpcClientInterface
- type RpcConf
- type RpcConf_Service
- type RpcContainer
- type RpcController
- type RpcServiceInterface
Constants ¶
View Source
const ( Header_Rpc_App = "Rpc-App" Header_Rpc_Service = "Rpc-Service" Header_Rpc_Method = "Rpc-Method" )
Variables ¶
This section is empty.
Functions ¶
func GetGinHandlerFunc ¶
func GetGinHandlerFunc() gin.HandlerFunc
func GetService ¶
func GetService(app, service string) interface{}
func IsRpcService ¶
func IsRpcService(instance interface{}) bool
Types ¶
type RpcClientContainer ¶
type RpcClientContainer struct { Lock *sync.Mutex Instances map[string]*RpcConf_Service }
func (*RpcClientContainer) Get ¶
func (i *RpcClientContainer) Get(client string) (host, app, service string, err error)
func (*RpcClientContainer) Save ¶
func (i *RpcClientContainer) Save(client string, conf *RpcConf_Service)
type RpcClientInterface ¶
type RpcClientInterface interface {
RpcClientName() string
}
type RpcConf ¶
type RpcConf struct {
Services []*RpcConf_Service `json:"services"`
}
func (*RpcConf) ConfigName ¶
type RpcConf_Service ¶
type RpcContainer ¶
func (*RpcContainer) Get ¶
func (i *RpcContainer) Get(app, service string) interface{}
func (*RpcContainer) Save ¶
func (i *RpcContainer) Save(instance interface{})
type RpcController ¶
type RpcController struct { }
func (*RpcController) ControllerName ¶
func (c *RpcController) ControllerName() string
type RpcServiceInterface ¶
Click to show internal directories.
Click to hide internal directories.