Documentation ¶
Index ¶
- Constants
- Variables
- type InvocationOption
- func StreamingRequest() InvocationOption
- func WithCheckRedirect() InvocationOption
- func WithFilters(f ...string) InvocationOption
- func WithMetadata(h map[string]interface{}) InvocationOption
- func WithProtocol(p string) InvocationOption
- func WithRouteTags(t map[string]string) InvocationOption
- func WithStrategy(s string) InvocationOption
- func WithoutSD() InvocationOption
- type InvokeOptions
- type Option
- type Options
- type RPCInvoker
- type RestInvoker
Constants ¶
const ( HTTP = "http" HTTPS = "https" )
schemas
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 WithCheckRedirect ¶ added in v2.5.0
func WithCheckRedirect() InvocationOption
WithCheckRedirect is a request option
func WithMetadata ¶
func WithMetadata(h map[string]interface{}) InvocationOption
WithMetadata is a request option
func WithRouteTags ¶
func WithRouteTags(t map[string]string) InvocationOption
WithRouteTags is a request option
func WithoutSD ¶ added in v2.1.0
func WithoutSD() InvocationOption
WithoutSD will skip client-side load balancing phase. it means, go chassis can work without service discovery(ike consul, etcd, eureka,kubernetes). use this API, when you don't want to make your micro service depend on a centralized service.
type InvokeOptions ¶
type InvokeOptions struct { Stream bool // Transport Dial Timeout DialTimeout time.Duration // Request/Response timeout RequestTimeout time.Duration DisableSD bool // end to end, Directly call Protocol string Port string //loadbalancer stratery //StrategyFunc loadbalancer.Strategy StrategyFunc string Filters []string URLPath string MethodType string // local data Metadata map[string]interface{} // tags for router RouteTags utiltags.Tags //http.CheckRedirect CheckRedirect func(req *http.Request, via []*http.Request) error }
InvokeOptions struct having information about microservice API call parameters
type Option ¶
type Option func(*Options)
Option used by the invoker
func ChainName ¶
ChainName is able to custom handler chain for a invoker. you can specify a handler chain name under "servicecomb.handler.chain.Consumer" in chassis.yaml file. so that you can define different invoker with different handler chain. a handler chain is bind to a invoker instance.
func DefaultCallOptions ¶
func DefaultCallOptions(io InvokeOptions) Option
DefaultCallOptions is request option
type Options ¶
type Options struct { // chain for client ChainName string Filters []string 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 client is an interface for any protocol's client
|
Package client is an interface for any protocol's client |
Package loadbalancer is client side load balancer
|
Package loadbalancer is client side load balancer |
Package metadata provides framework info registered to registry.
|
Package metadata provides framework info registered to registry. |
Package router expose API for user to get or set route rule
|
Package router expose API for user to get or set route rule |
Package server is a package for protocol of a micro service
|
Package server is a package for protocol of a micro service |