invocation

package
v0.0.0-...-5dc8409 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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 {
	//service's ip and port, it is decided in load balance
	Endpoint string
	//specify rest,highway
	Protocol string
	//Ctx value will be send as header in transport
	Ctx                context.Context
	SourceServiceID    string
	SourceMicroService string
	MicroServiceName   string
	Version            string
	//correspond struct
	SchemaID string
	//correspond struct func
	OperationID string
	Args        interface{}
	//an url path has muntil path params such as "/v2/microsvice/:id/instance/:instanceid",http client use this to format correct url
	URLPathFormat string
	MethodType    string
	Reply         interface{}
	//just in local memory
	Metadata    map[string]interface{}
	ContentType string
	//loadbalance stratery
	//Strategy loadbalance.Strategy
	Strategy string
	Filters  []selector.Filter
	AppID    string
}

Invocation is the basic struct that used in go sdk to make client and transport layer transparent . developer should implements a client which is able to encode from invocation to there own request

func CreateInvocation

func CreateInvocation() *Invocation

CreateInvocation create invocation

func (*Invocation) WithContext

func (i *Invocation) WithContext(ctx context.Context) *Invocation

WithContext invocation with context

type InvocationResponse

type InvocationResponse struct {
	Status int
	Result interface{}
	Err    error
}

InvocationResponse invocation response struct

type ResponseCallBack

type ResponseCallBack func(*InvocationResponse) error

ResponseCallBack process invocation response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL