yarpc

package
v1.36.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadResponse

func BadResponse(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)

BadResponse returns an object that's not a valid JSON response.

func EchoJSON

func EchoJSON(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)

EchoJSON implements the echo procedure.

func EchoRaw

func EchoRaw(ctx context.Context, body []byte) ([]byte, error)

EchoRaw implements the echo/raw procedure.

func Sleep

func Sleep(ctx context.Context, body interface{}) (interface{}, error)

Sleep responds to json requests over any transport by sleeping for one second.

func SleepRaw

func SleepRaw(ctx context.Context, body []byte) ([]byte, error)

SleepRaw responds to raw requests over any transport by sleeping for one second.

func Start

func Start()

Start starts the test server that clients will make requests to

func Stop

func Stop()

Stop stops running the RPC test subject

func UnexpectedError

func UnexpectedError(ctx context.Context, body interface{}) (interface{}, error)

UnexpectedError fails with an unexpected error.

func WaitForTimeoutRaw

func WaitForTimeoutRaw(ctx context.Context, body []byte) ([]byte, error)

WaitForTimeoutRaw waits after the context deadline then returns the context error. yarpc should interpret this as an handler timeout, which in turns should be forwarded to the yarpc client as a remote handler timeout.

Types

type EchoProtobuf added in v1.8.0

type EchoProtobuf struct{}

EchoProtobuf implements the Protobuf Echo service.

func (EchoProtobuf) Echo added in v1.8.0

Echo implements the Echo function for the Protobuf Echo service.

type EchoThrift

type EchoThrift struct{}

EchoThrift implements the Thrift Echo service.

func (EchoThrift) Echo

func (EchoThrift) Echo(ctx context.Context, ping *echo.Ping) (*echo.Pong, error)

Echo endpoint for the Echo service.

type HTTPTransport

type HTTPTransport struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

HTTPTransport contains information about an HTTP transport.

type PhoneRequest

type PhoneRequest struct {
	Service   string          `json:"service"`
	Procedure string          `json:"procedure"`
	Transport TransportConfig `json:"transport"`
	Body      *js.RawMessage  `json:"body"`
}

PhoneRequest is a request to make another request to a different service.

type PhoneResponse

type PhoneResponse struct {
	Service   string         `json:"service"`
	Procedure string         `json:"procedure"`
	Body      *js.RawMessage `json:"body"`
}

PhoneResponse is the response of a Phone request.

func Phone

func Phone(ctx context.Context, body *PhoneRequest) (*PhoneResponse, error)

Phone implements the phone procedure

type TChannelTransport

type TChannelTransport struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

TChannelTransport contains information about a TChannel transport.

type TransportConfig

type TransportConfig struct {
	HTTP     *HTTPTransport     `json:"http"`
	TChannel *TChannelTransport `json:"tchannel"`
}

TransportConfig contains the transport configuration for the phone request.

Jump to

Keyboard shortcuts

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