Documentation ¶
Index ¶
- Variables
- func Call(ctx context.Context, ch *tchannel.Channel, hostPort string, ...) ([]byte, []byte, *tchannel.OutboundCallResponse, error)
- func CallSC(ctx context.Context, sc *tchannel.SubChannel, method string, arg2, arg3 []byte) ([]byte, []byte, *tchannel.OutboundCallResponse, error)
- func ReadArgsV2(r tchannel.ArgReadable) ([]byte, []byte, error)
- func Wrap(handler Handler) tchannel.Handler
- func WriteArgs(call *tchannel.OutboundCall, arg2, arg3 []byte) ([]byte, []byte, *tchannel.OutboundCallResponse, error)
- func WriteResponse(response *tchannel.InboundCallResponse, resp *Res) error
- type Args
- type CArgs
- type CRes
- type Handler
- type Res
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAppError = errors.New("application error")
ErrAppError is returned if the application sets an error response.
Functions ¶
func Call ¶
func Call(ctx context.Context, ch *tchannel.Channel, hostPort string, serviceName, method string, arg2, arg3 []byte) ([]byte, []byte, *tchannel.OutboundCallResponse, error)
Call makes a call to the given hostPort with the given arguments and returns the response args.
func CallSC ¶
func CallSC(ctx context.Context, sc *tchannel.SubChannel, method string, arg2, arg3 []byte) ( []byte, []byte, *tchannel.OutboundCallResponse, error)
CallSC makes a call using the given subcahnnel
func ReadArgsV2 ¶
ReadArgsV2 reads arg2 and arg3 from a reader.
func Wrap ¶
func Wrap(handler Handler) tchannel.Handler
Wrap wraps a Handler as a tchannel.Handler that can be passed to tchannel.Register.
func WriteArgs ¶
func WriteArgs(call *tchannel.OutboundCall, arg2, arg3 []byte) ([]byte, []byte, *tchannel.OutboundCallResponse, error)
WriteArgs writes the given arguments to the call, and returns the response args.
func WriteResponse ¶
WriteResponse writes the given Res to the InboundCallResponse.
Types ¶
type Handler ¶
type Handler interface { // Handle is called on incoming calls, and contains all the arguments. // If an error is returned, it will set ApplicationError Arg3 will be the error string. Handle(ctx context.Context, args *Args) (*Res, error) OnError(ctx context.Context, err error) }
Handler is the interface for a raw handler.
Click to show internal directories.
Click to hide internal directories.