Documentation
¶
Overview ¶
Package protobuf implements Protocol Buffers encoding support for YARPC.
Index ¶
- Constants
- func BuildProcedures(params BuildProceduresParams) []transport.Procedure
- func CastError(expectedType proto.Message, actualType proto.Message) error
- func NewOnewayHandler(params OnewayHandlerParams) transport.OnewayHandler
- func NewUnaryHandler(params UnaryHandlerParams) transport.UnaryHandler
- type BuildProceduresOnewayHandlerParams
- type BuildProceduresParams
- type BuildProceduresUnaryHandlerParams
- type Client
- type ClientOption
- type ClientParams
- type OnewayHandlerParams
- type UnaryHandlerParams
Constants ¶
const ( // Encoding is the name of this encoding. Encoding transport.Encoding = "proto" // JSONEncoding is the name of the JSON encoding. // // Protobuf handlers are able to handle both Encoding and JSONEncoding encodings. JSONEncoding transport.Encoding = "json" )
Variables ¶
This section is empty.
Functions ¶
func BuildProcedures ¶
func BuildProcedures(params BuildProceduresParams) []transport.Procedure
BuildProcedures builds the transport.Procedures.
func CastError ¶
CastError returns an error saying that generated code could not properly cast a proto.Message to it's expected type.
func NewOnewayHandler ¶
func NewOnewayHandler(params OnewayHandlerParams) transport.OnewayHandler
NewOnewayHandler returns a new OnewayHandler.
func NewUnaryHandler ¶
func NewUnaryHandler(params UnaryHandlerParams) transport.UnaryHandler
NewUnaryHandler returns a new UnaryHandler.
Types ¶
type BuildProceduresOnewayHandlerParams ¶
type BuildProceduresOnewayHandlerParams struct {
MethodName string
Handler transport.OnewayHandler
}
BuildProceduresOnewayHandlerParams contains the parameters for a OnewayHandler for BuildProcedures.
type BuildProceduresParams ¶
type BuildProceduresParams struct {
ServiceName string
UnaryHandlerParams []BuildProceduresUnaryHandlerParams
OnewayHandlerParams []BuildProceduresOnewayHandlerParams
}
BuildProceduresParams contains the parameters for BuildProcedures.
type BuildProceduresUnaryHandlerParams ¶
type BuildProceduresUnaryHandlerParams struct {
MethodName string
Handler transport.UnaryHandler
}
BuildProceduresUnaryHandlerParams contains the parameters for a UnaryHandler for BuildProcedures.
type Client ¶
type Client interface {
Call(
ctx context.Context,
requestMethodName string,
request proto.Message,
newResponse func() proto.Message,
options ...yarpc.CallOption,
) (proto.Message, error)
CallOneway(
ctx context.Context,
requestMethodName string,
request proto.Message,
options ...yarpc.CallOption,
) (transport.Ack, error)
}
Client is a protobuf client.
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is an option for a new Client.
var UseJSON ClientOption = useJSON{}
UseJSON says to use the json encoding for client/server communication.
func ClientBuilderOptions ¶
func ClientBuilderOptions(_ transport.ClientConfig, structField reflect.StructField) []ClientOption
ClientBuilderOptions returns ClientOptions that yarpc.InjectClients should use for a specific client given information about the field into which the client is being injected.
type ClientParams ¶
type ClientParams struct {
ServiceName string
ClientConfig transport.ClientConfig
Options []ClientOption
}
ClientParams contains the parameters for creating a new Client.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package main provides a protoc plugin that generates code for the protobuf encoding for YARPC.
|
Package main provides a protoc plugin that generates code for the protobuf encoding for YARPC. |
|
internal/lib
Package lib contains the library code for protoc-gen-yarpc-go.
|
Package lib contains the library code for protoc-gen-yarpc-go. |
|
internal/testing
Package testing is a generated protocol buffer package.
|
Package testing is a generated protocol buffer package. |