dubbo2_context

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FilterSkillName = config.TypeNameOf((*DubboFilter)(nil))
)

Functions

func DoDubboFilter

func DoDubboFilter(httpFilter DubboFilter, ctx eocontext.EoContext, next eocontext.IChain) (err error)

Types

type DubboFilter

type DubboFilter interface {
	DoDubboFilter(ctx IDubbo2Context, next eocontext.IChain) (err error)
}

type IDubbo2Context

type IDubbo2Context interface {
	eocontext.EoContext
	HeaderReader() IRequestReader // 读取原始请求
	Proxy() IProxy                // 读写转发请求
	Response() IResponse          // 处理返回结果,可读可写
	Invoke(address string, timeout time.Duration) error
}

func Assert

func Assert(ctx eocontext.EoContext) (IDubbo2Context, error)

type IProxy

type IProxy interface {
	Service() IServiceWriter
	SetParam(interface{})
	GetParam() interface{}
	SetAttachment(string, interface{})
	Attachments() map[string]interface{}
}

type IRequestReader

type IRequestReader interface {
	Service() IServiceReader
	Body() interface{}
	Host() string
	Attachments() map[string]interface{}
	Attachment(string) (interface{}, bool)
	RemoteIp() string
}

type IResponse

type IResponse interface {
	ResponseError() error
	SetResponseTime(duration time.Duration)
	ResponseTime() time.Duration
	GetBody() interface{}
	SetBody(interface{})
}

type IServiceReader

type IServiceReader interface {
	Path() string
	Interface() string
	Group() string
	Version() string
	Method() string
	Timeout() time.Duration //request timeout
}

type IServiceWriter

type IServiceWriter interface {
	IServiceReader
	SetPath(string)
	SetInterface(string)
	SetGroup(string)
	SetVersion(string)
	SetMethod(string)
	SetTimeout(duration time.Duration) //request timeout
}

Jump to

Keyboard shortcuts

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