yarpctest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package yarpctest provides utilities to test YARPC services and clients.

Index

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

Build builds a yarpc.ReqMeta from this CallResMetaBuilder.

The CallResMetaBuilder is not re-usable and becomes invalid after this call.

func (*CallResMetaBuilder) Headers

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

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.

Jump to

Keyboard shortcuts

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