Documentation ¶
Overview ¶
Package yarpctest provides utilities to test YARPC services and clients.
Index ¶
- type CallResMetaBuilder
- type ReqMetaBuilder
- func (f *ReqMetaBuilder) Build() yarpc.ReqMeta
- func (f *ReqMetaBuilder) Caller(s string) *ReqMetaBuilder
- func (f *ReqMetaBuilder) Encoding(e transport.Encoding) *ReqMetaBuilder
- func (f *ReqMetaBuilder) Headers(h yarpc.Headers) *ReqMetaBuilder
- func (f *ReqMetaBuilder) Procedure(s string) *ReqMetaBuilder
- func (f *ReqMetaBuilder) Service(s string) *ReqMetaBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallResMetaBuilder ¶
type CallResMetaBuilder struct {
// contains filtered or unexported fields
}
CallResMetaBuilder helps build fake yarpc.CallResMeta objects for testing.
resMeta := NewCallResMetaBuilder(ctx). Headers(headers). Build()
func NewCallResMetaBuilder ¶
func NewCallResMetaBuilder() *CallResMetaBuilder
NewCallResMetaBuilder builds a new fake ReqMeta for unit tests
func (*CallResMetaBuilder) Build ¶
func (f *CallResMetaBuilder) Build() yarpc.CallResMeta
Build builds a yarpc.ReqMeta from this CallResMetaBuilder.
The CallResMetaBuilder is not re-usable and becomes invalid after this call.
func (*CallResMetaBuilder) Headers ¶
func (f *CallResMetaBuilder) Headers(h yarpc.Headers) *CallResMetaBuilder
Headers specifies the response headers for this CallResMeta.
type ReqMetaBuilder ¶
type ReqMetaBuilder struct {
// contains filtered or unexported fields
}
ReqMetaBuilder helps build fake yarpc.ReqMeta objects for testing.
reqMeta := NewReqMetaBuilder(). Encoding(json.Encoding). Caller("mytestcaller"). Procedure("hello"). Service("testservice"). Build()
func NewReqMetaBuilder ¶
func NewReqMetaBuilder() *ReqMetaBuilder
NewReqMetaBuilder instantiates a new ReqMetaBuilder with the given context.
func (*ReqMetaBuilder) Build ¶
func (f *ReqMetaBuilder) Build() yarpc.ReqMeta
Build builds a yarpc.ReqMeta from this ReqMetaBuilder.
The ReqMetaBuilder is not re-usable and becomes invalid after this call.
func (*ReqMetaBuilder) Caller ¶
func (f *ReqMetaBuilder) Caller(s string) *ReqMetaBuilder
Caller specifies the name of the caller for this request.
func (*ReqMetaBuilder) Encoding ¶
func (f *ReqMetaBuilder) Encoding(e transport.Encoding) *ReqMetaBuilder
Encoding specifies the Encoding for the ReqMeta.
func (*ReqMetaBuilder) Headers ¶
func (f *ReqMetaBuilder) Headers(h yarpc.Headers) *ReqMetaBuilder
Headers specifies the headers attached to this ReqMeta.
func (*ReqMetaBuilder) Procedure ¶
func (f *ReqMetaBuilder) Procedure(s string) *ReqMetaBuilder
Procedure specifies the name of the procedure being called.
func (*ReqMetaBuilder) Service ¶
func (f *ReqMetaBuilder) Service(s string) *ReqMetaBuilder
Service specifies the target service name for this request.