Documentation ¶
Index ¶
- func BadResponse(ctx context.Context, reqMeta yarpc.ReqMeta, body map[string]interface{}) (map[string]interface{}, yarpc.ResMeta, error)
- func EchoJSON(ctx context.Context, reqMeta yarpc.ReqMeta, body map[string]interface{}) (map[string]interface{}, yarpc.ResMeta, error)
- func EchoRaw(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) ([]byte, yarpc.ResMeta, error)
- func Sleep(ctx context.Context, reqMeta yarpc.ReqMeta, body interface{}) (interface{}, yarpc.ResMeta, error)
- func SleepRaw(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) ([]byte, yarpc.ResMeta, error)
- func Start()
- func Stop()
- func UnexpectedError(ctx context.Context, reqMeta yarpc.ReqMeta, body interface{}) (interface{}, yarpc.ResMeta, error)
- func WaitForTimeoutRaw(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) ([]byte, yarpc.ResMeta, error)
- type EchoThrift
- type HTTPTransport
- type PhoneRequest
- type PhoneResponse
- type TChannelTransport
- type TransportConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadResponse ¶
func BadResponse(ctx context.Context, reqMeta yarpc.ReqMeta, body map[string]interface{}) (map[string]interface{}, yarpc.ResMeta, error)
BadResponse returns an object that's not a valid JSON response.
func EchoJSON ¶
func EchoJSON(ctx context.Context, reqMeta yarpc.ReqMeta, body map[string]interface{}) (map[string]interface{}, yarpc.ResMeta, error)
EchoJSON implements the echo procedure.
func EchoRaw ¶
func EchoRaw(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) ([]byte, yarpc.ResMeta, error)
EchoRaw implements the echo/raw procedure.
func Sleep ¶
func Sleep(ctx context.Context, reqMeta yarpc.ReqMeta, body interface{}) (interface{}, yarpc.ResMeta, error)
Sleep responds to json requests over any transport by sleeping for one second.
func SleepRaw ¶
func SleepRaw(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) ([]byte, yarpc.ResMeta, error)
SleepRaw responds to raw requests over any transport by sleeping for one second.
func UnexpectedError ¶
func UnexpectedError(ctx context.Context, reqMeta yarpc.ReqMeta, body interface{}) (interface{}, yarpc.ResMeta, error)
UnexpectedError fails with an unexpected error.
func WaitForTimeoutRaw ¶
func WaitForTimeoutRaw(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) ([]byte, yarpc.ResMeta, 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 HTTPTransport ¶
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.
type TChannelTransport ¶
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.