package proto

import "github.com/go-kit/kit/transport/http/proto"

Index

Functions

func EncodeProtoRequest

func EncodeProtoRequest(_ context.Context, r *http.Request, preq interface{}) error

EncodeProtoRequest is an EncodeRequestFunc that serializes the request as Protobuf. If the request implements Headerer, the provided headers will be applied to the request. If the given request does not implement proto.Message, an error will be returned.

func EncodeProtoResponse

func EncodeProtoResponse(ctx context.Context, w http.ResponseWriter, pres interface{}) error

EncodeProtoResponse is an EncodeResponseFunc that serializes the response as Protobuf. Many Proto-over-HTTP services can use it as a sensible default. If the response implements Headerer, the provided headers will be applied to the response. If the response implements StatusCoder, the provided StatusCode will be used instead of 200.

Source Files

client.go generate.go server.go

Version
v0.13.0 (latest)
Published
May 29, 2023
Platform
linux/amd64
Imports
7 packages
Last checked
1 day ago

Tools for package owners.