Documentation ¶
Index ¶
Constants ¶
const Name = "rpc-client"
Variables ¶
This section is empty.
Functions ¶
func GetImpl ¶
GetImpl returns impl ptr of rpc client, key should has lowercase character prefix, and 'IOCRPCClient' suffix like 'github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.SimpleServiceIOCRPCClient'
The returned interface is proxy struct pointer like pointer of 'github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.simpleServiceIOCRPCClient_'
The returned interface can be asserted to ioc rpc client interface like 'github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.SimpleServiceIOCRPCClient'
An example to use this API is : ```go simpleClient, err := rpc_client.GetImpl("github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.SimpleServiceIOCRPCClient", param)
if err != nil{ panic(err) }
usr, err := simpleClient.(api.SimpleServiceIOCRPCClient).GetUser("laurence", 23) ```
func ImplClientStub ¶
ImplClientStub returns impl ptr of rpc client, clientStubPtr should be a generated ioc rpc interface client ptr like 'github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.SimpleServiceIOCRPCClient'
new(simpleServiceIOCRPCClient)
The returned interface is proxy struct pointer like pointer of 'github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.simpleServiceIOCRPCClient_'
The returned interface can be asserted to ioc rpc client interface like 'github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api.SimpleServiceIOCRPCClient'
An example to use this API is : ```go import(
"github.com/cc-cheunggg/ioc-golang/example/autowire/autowire_rpc/client/test/service/api"
)
simpleClient, err := rpc_client.ImplClientStub(new(api.SimpleServiceIOCRPCClient), param)
if err != nil{ panic(err) }
usr, err := simpleClient.(api.SimpleServiceIOCRPCClient).GetUser("laurence", 23) ```
func RegisterStructDescriptor ¶
func RegisterStructDescriptor(s *autowire.StructDescriptor)
Types ¶
type Autowire ¶
func (*Autowire) GetAllStructDescriptors ¶
func (a *Autowire) GetAllStructDescriptors() map[string]*autowire.StructDescriptor
GetAllStructDescriptors re-write SingletonAutowire