Documentation ¶
Index ¶
- type Caller
- func (c *Caller) Exists(id string) bool
- func (c *Caller) ID(ctx context.Context) (id string)
- func (c *Caller) IdList() []string
- func (c *Caller) Invoke(id string, name string, args []interface{}, returnType ...reflect.Type) ([]interface{}, error)
- func (c *Caller) InvokeContext(ctx context.Context, id string, name string, args []interface{}, ...) ([]interface{}, error)
- func (c *Caller) UseService(remoteService interface{}, id string, namespace ...string)
- type Provider
- func (p *Provider) Add(method core.Method) *Provider
- func (p *Provider) AddAllMethods(target interface{}, namespace ...string) *Provider
- func (p *Provider) AddFunction(f interface{}, alias ...string) *Provider
- func (p *Provider) AddInstanceMethods(target interface{}, namespace ...string) *Provider
- func (p *Provider) AddMethod(name string, target interface{}, alias ...string) *Provider
- func (p *Provider) AddMethods(names []string, target interface{}, namespace ...string) *Provider
- func (p *Provider) AddMissingMethod(f interface{}) *Provider
- func (p *Provider) AddNetRPCMethods(rcvr interface{}, namespace ...string) *Provider
- func (p *Provider) Client() *core.Client
- func (p *Provider) Close() error
- func (p *Provider) Execute(ctx context.Context, name string, args []interface{}) (result []interface{}, err error)
- func (p *Provider) Get(name string) core.Method
- func (p *Provider) ID() (id string)
- func (p *Provider) Listen()
- func (p *Provider) Remove(name string) *Provider
- func (p *Provider) SetID(id string)
- func (p *Provider) Unuse(handler ...core.PluginHandler) *Provider
- func (p *Provider) Use(handler ...core.PluginHandler) *Provider
- type ProviderContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caller ¶
type Caller struct { *core.Service IdleTimeout time.Duration Timeout time.Duration HeartBeat time.Duration // contains filtered or unexported fields }
func UseService ¶
func (*Caller) InvokeContext ¶
func (*Caller) UseService ¶
type Provider ¶
type Provider struct { RetryInterval time.Duration OnError func(error) Debug bool // contains filtered or unexported fields }
func (*Provider) AddAllMethods ¶
AddAllMethods will publish all methods and non-nil function fields on the obj self and on its anonymous or non-anonymous struct fields (or pointer to pointer ... to pointer struct fields). This is a recursive operation. So it's a pit, if you do not know what you are doing, do not step on.
func (*Provider) AddFunction ¶
AddFunction is used for publishing function f with alias.
func (*Provider) AddInstanceMethods ¶
AddInstanceMethods is used for publishing all the public methods and func fields with namespace.
func (*Provider) AddMethod ¶
AddMethod is used for publishing method named name on target with alias.
func (*Provider) AddMethods ¶
AddMethods is used for publishing methods named names on target with namespace.
func (*Provider) AddMissingMethod ¶
AddMissingMethod is used for publishing a method, all methods not explicitly published will be redirected to this method.
func (*Provider) AddNetRPCMethods ¶
AddNetRPCMethods is used for publishing methods defined for net/rpc.
type ProviderContext ¶
func GetProviderContext ¶
func GetProviderContext(ctx context.Context) *ProviderContext
GetProviderContext returns the *reverse.ProviderContext bound to the context.
func NewProviderContext ¶
func NewProviderContext(client *core.Client, method core.Method) *ProviderContext
func (*ProviderContext) Client ¶
func (c *ProviderContext) Client() *core.Client
func (*ProviderContext) Clone ¶
func (c *ProviderContext) Clone() core.Context
func (*ProviderContext) Method ¶
func (c *ProviderContext) Method() core.Method