Documentation ¶
Index ¶
- func Actions(actions ...api.Action) api.Action
- func Body(msg string) api.RequestOption
- func EchoHandler(mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
- func EchoHandlerWithPrefix(prefix string, mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
- func ErrorHandler(err error, mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
- func GRPCRequest(options ...api.RequestOption) api.Action
- func GRPCService(options ...api.ServiceOption) api.Lifecycle
- func GiveAndWantLargeBodyIsEchoed(numOfBytes int) api.RequestOption
- func HTTPRequest(options ...api.RequestOption) api.Action
- func HTTPService(options ...api.ServiceOption) api.Lifecycle
- func Lifecycles(l ...api.Lifecycle) api.Lifecycle
- func Name(name string) *types.Name
- func NewPortProvider(t testing.TB) *types.PortProvider
- func OrderedRequestHandler(options ...api.HandlerOption) *types.OrderedHandler
- func Port(port uint16) *types.Port
- func Proc(options ...api.ProcOption) api.ServiceOption
- func Procedure(procedure string) *types.Procedure
- func Service(service string) *types.Service
- func ShardKey(key string) *types.ShardKey
- func StaticHandler(msg string, mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
- func TChannelRequest(options ...api.RequestOption) api.Action
- func TChannelService(options ...api.ServiceOption) api.Lifecycle
- func WantError(errMsg string) api.RequestOption
- func WantHeader(key, value string) *types.WantHeader
- func WantRespBody(body string) api.RequestOption
- func WithHeader(key, value string) *types.GiveHeader
- type Action
- type Lifecycle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Body ¶
func Body(msg string) api.RequestOption
Body sets the body on a request to the raw representation of the msg field.
func EchoHandler ¶
func EchoHandler(mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
EchoHandler is a Unary Handler that will echo the body of the request into the response.
func EchoHandlerWithPrefix ¶
func EchoHandlerWithPrefix(prefix string, mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
EchoHandlerWithPrefix will echo the request it receives into the response, but, it will insert a prefix in front of the message.
func ErrorHandler ¶
func ErrorHandler(err error, mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
ErrorHandler will always return an Error.
func GRPCRequest ¶
func GRPCRequest(options ...api.RequestOption) api.Action
GRPCRequest creates a new grpc unary request.
func GRPCService ¶
func GRPCService(options ...api.ServiceOption) api.Lifecycle
GRPCService will create a runnable GRPC service.
func GiveAndWantLargeBodyIsEchoed ¶
func GiveAndWantLargeBodyIsEchoed(numOfBytes int) api.RequestOption
GiveAndWantLargeBodyIsEchoed creates an extremely large random byte buffer and validates that the body is echoed back to the response.
func HTTPRequest ¶
func HTTPRequest(options ...api.RequestOption) api.Action
HTTPRequest creates a new YARPC http request.
func HTTPService ¶
func HTTPService(options ...api.ServiceOption) api.Lifecycle
HTTPService will create a runnable HTTP service.
func Lifecycles ¶
Lifecycles is a wrapper around a list of Lifecycle definitions.
func Name ¶
Name is a shared option across services and procedures. It can be used as input in the constructor of both types.
func NewPortProvider ¶
func NewPortProvider(t testing.TB) *types.PortProvider
NewPortProvider creates an object that can be used to synchronize ports in yarpctest infrastructure. Ports can be acquired through the "Port" function which will create new ports for the test based on the id passed into the function.
func OrderedRequestHandler ¶
func OrderedRequestHandler(options ...api.HandlerOption) *types.OrderedHandler
OrderedRequestHandler will execute a series of Handlers in the order they are passed in. If the number of requests does not match, it will return an unknown error.
func Port ¶
Port is a shared option across services and requests. It can be embedded in the constructor of both types.
func Proc ¶
func Proc(options ...api.ProcOption) api.ServiceOption
Proc will create a new Procedure that can be included in a Service.
func Procedure ¶
Procedure specifies the "procedure" header for a request. It is a shared option across different requests.
func Service ¶
Service specifies the "service" header for a request. It is a shared option across different requests.
func ShardKey ¶
ShardKey specifies that "shard key" header for a request. It is a shared option across different requests.
func StaticHandler ¶
func StaticHandler(msg string, mw ...api.UnaryInboundMiddleware) *types.UnaryHandler
StaticHandler will always return the same response.
func TChannelRequest ¶
func TChannelRequest(options ...api.RequestOption) api.Action
TChannelRequest creates a new tchannel request.
func TChannelService ¶
func TChannelService(options ...api.ServiceOption) api.Lifecycle
TChannelService will create a runnable TChannel service.
func WantError ¶
func WantError(errMsg string) api.RequestOption
WantError creates an assertion on the request response to validate the error.
func WantHeader ¶
func WantHeader(key, value string) *types.WantHeader
WantHeader will set up a header assertion for request/response headers.
func WantRespBody ¶
func WantRespBody(body string) api.RequestOption
WantRespBody will assert that the response body matches at the end of the request.
func WithHeader ¶
func WithHeader(key, value string) *types.GiveHeader
WithHeader will send headers for requests and responses.
Types ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package api is for all interfaces and patterns that need to be implemented to interact with the yarpctest api, but not the explicit types we'll use to make requests, or the types that we'll use directly in tests.
|
Package api is for all interfaces and patterns that need to be implemented to interact with the yarpctest api, but not the explicit types we'll use to make requests, or the types that we'll use directly in tests. |
Package types are for objects in the yarpctest API that implement multiple interfaces.
|
Package types are for objects in the yarpctest API that implement multiple interfaces. |