Documentation
¶
Index ¶
Constants ¶
const ( Consumer = iota Provider )
constant values for consumer and provider
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Invocation ¶
type Invocation struct {
HandlerIndex int
Endpoint string //service's ip and port, it is decided in load balancing
Protocol string
Port string //Port is the name of a real service port
SourceServiceID string
SourceMicroService string
MicroServiceName string //Target micro service name
SchemaID string //correspond struct name
OperationID string //correspond struct func name
Args interface{}
URLPathFormat string
Reply interface{}
Ctx context.Context //ctx can save protocol headers
Metadata map[string]interface{} //local scope data
RouteTags utiltags.Tags //route tags is decided in router handler
Strategy string //load balancing strategy
Filters []string
}
Invocation is the basic struct that used in go chassis to make client and transport layer transparent . developer should implements a client which is able to transfer invocation to there own request a protocol server should transfer request to invocation and then back to request
func New ¶ added in v0.7.1
func New(ctx context.Context) *Invocation
New create invocation, context can not be nil if you don't set ContextHeaderKey, then New will init it
func (*Invocation) GetMark ¶ added in v1.8.1
func (inv *Invocation) GetMark() string
GetMark return match rule name that request matches
func (*Invocation) Headers ¶ added in v0.7.1
func (inv *Invocation) Headers() map[string]string
Headers return a map that protocol plugin should deliver in transport
func (*Invocation) Mark ¶ added in v1.8.1
func (inv *Invocation) Mark(matchRuleName string)
Mark marks a invocation, it means the invocation matches a match rule so that governance rule can be applied to invocation with specific mark
func (*Invocation) SetHeader ¶ added in v0.7.1
func (inv *Invocation) SetHeader(k, v string)
SetHeader set headers, the client and server plugins should use them in protocol headers it is convenience but has lower performance than you use Headers[k]=v, when you have a batch of kv to set
func (*Invocation) SetMetadata ¶ added in v0.7.1
func (inv *Invocation) SetMetadata(key string, value interface{})
SetMetadata local scope params
type ResponseCallBack ¶
ResponseCallBack process invocation response