Documentation ¶
Index ¶
- Constants
- func Call(ctx *gin.Context, client RpcClientInterface, method string, ...) (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_Client
- type RpcConf_Client_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 Call ¶
func Call(ctx *gin.Context, client RpcClientInterface, method string, req, rsp interface{}) (err error)
func GetGinHandlerFunc ¶
func GetGinHandlerFunc() gin.HandlerFunc
func GetService ¶
func GetService(app, service string) interface{}
func IsRpcService ¶
func IsRpcService(instance interface{}) bool
Types ¶
type RpcClientContainer ¶
func (*RpcClientContainer) GetHost ¶ added in v0.0.5
func (i *RpcClientContainer) GetHost(app, service string) string
func (*RpcClientContainer) Save ¶
func (i *RpcClientContainer) Save(client *RpcConf_Client)
type RpcClientInterface ¶
type RpcConf ¶
type RpcConf struct {
Clients []*RpcConf_Client `json:"clients"`
}
func (*RpcConf) ConfigName ¶
type RpcConf_Client ¶ added in v0.0.6
type RpcConf_Client struct { Host string `json:"host"` Services []*RpcConf_Client_Service `json:"services"` }
type RpcConf_Client_Service ¶ added in v0.0.6
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.