Documentation ¶
Overview ¶
Package raw provides the raw encoding for YARPC.
To make outbound requests,
client := raw.New(channel) resBody, resMeta, err := client.Call( yarpc.NewReqMeta(ctx).Procedure("submit"), []byte{1, 2, 3}, )
To register a raw procedure, define a Registrant or use Procedure to make a single-function Registrant, and register it with Register.
func Submit(reqMeta yarpc.ReqMeta, reqBody []byte) ([]byte, yarpc.ResMeta, error) { // ... } raw.Register(dispatcher, raw.Procedure("submit", Submit))
Index ¶
Constants ¶
View Source
const Encoding transport.Encoding = "raw"
Encoding is the name of this encoding.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(reg transport.Registry, registrant Registrant)
Register registers the procedures defined by the given Registrant with the given Registry.
Types ¶
type Client ¶
type Client interface { // Call performs an outbound Raw request. Call(ctx context.Context, reqMeta yarpc.CallReqMeta, body []byte) ([]byte, yarpc.CallResMeta, error) }
Client makes Raw requests to a single service.
type Registrant ¶
type Registrant interface {
// contains filtered or unexported methods
}
Registrant is used for types that define or know about different Raw procedures.
func Procedure ¶
func Procedure(name string, handler Handler) Registrant
Procedure builds a Registrant with a single procedure in it.
Click to show internal directories.
Click to hide internal directories.