Documentation ¶
Index ¶
- Variables
- type InvocationOption
- func StreamingRequest() InvocationOption
- func WithAppID(p string) InvocationOption
- func WithContentType(ct string) InvocationOption
- func WithEndpoint(ep string) InvocationOption
- func WithFilters(f ...selector.Filter) InvocationOption
- func WithMetadata(h map[string]interface{}) InvocationOption
- func WithProtocol(p string) InvocationOption
- func WithStrategy(s string) InvocationOption
- func WithVersion(v string) InvocationOption
- type InvokeOptions
- type Option
- type Options
- type RPCInvoker
- type RestInvoker
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = Options{
ChainName: "default",
}
DefaultOptions for chain name
Functions ¶
This section is empty.
Types ¶
type InvocationOption ¶
type InvocationOption func(*InvokeOptions)
InvocationOption is a requestOption used by invocation
func WithContentType ¶
func WithContentType(ct string) InvocationOption
WithContentType is a request option
func WithFilters ¶
func WithFilters(f ...selector.Filter) InvocationOption
WithFilters is a request option
func WithMetadata ¶
func WithMetadata(h map[string]interface{}) InvocationOption
WithMetadata is a request option
type InvokeOptions ¶
type InvokeOptions struct { //microservice version Version string Stream bool // Transport Dial Timeout DialTimeout time.Duration // Request/Response timeout RequestTimeout time.Duration // end to end,Directly call Endpoint string // end to end,Directly call Protocol string // end to end,Directly call ContentType string //loadbalance stratery //StrategyFunc loadbalance.Strategy StrategyFunc string Filters []selector.Filter URLPath string MethodType string AppID string // local data Metadata map[string]interface{} }
InvokeOptions struct having information about microservice API call parameters
type Option ¶
type Option func(*Options)
Option used by the invoker
func DefaultCallOptions ¶
func DefaultCallOptions(io InvokeOptions) Option
DefaultCallOptions is request option
type Options ¶
type Options struct { // chain for client ChainName string Filters []selector.Filter InvocationOptions InvokeOptions }
Options is a struct to stores information about chain name, filters, and their invocation options
type RPCInvoker ¶
RPCInvoker is rpc invoker one invoker for one microservice thread safe
func NewRPCInvoker ¶
func NewRPCInvoker(opt ...Option) *RPCInvoker
NewRPCInvoker is gives the object of rpc invoker
func (*RPCInvoker) Invoke ¶
func (ri *RPCInvoker) Invoke(ctx context.Context, microServiceName, schemaID, operationID string, arg interface{}, reply interface{}, options ...InvocationOption) error
Invoke is for to invoke the functions during API calls
type RestInvoker ¶
type RestInvoker struct {
// contains filtered or unexported fields
}
RestInvoker is rest invoker one invoker for one microservice thread safe
func NewRestInvoker ¶
func NewRestInvoker(opt ...Option) *RestInvoker
NewRestInvoker is gives the object of rest invoker
Directories ¶
Path | Synopsis |
---|---|
Package codec is an interface for encoding messages
|
Package codec is an interface for encoding messages |
Package lager is the package for lager
|
Package lager is the package for lager |
Package loadbalance is a way to load balance service nodes
|
Package loadbalance is a way to load balance service nodes |
util
|
|
metadata
Package metadata is a way of defining message headers
|
Package metadata is a way of defining message headers |