Documentation
¶
Overview ¶
Package httpgrpc is a generated protocol buffer package.
It is generated from these files:
github.com/weaveworks/common/httpgrpc/httpgrpc.proto
It has these top-level messages:
HTTPRequest HTTPResponse Header
Index ¶
- func ErrorFromHTTPResponse(resp *HTTPResponse) error
- func Errorf(code int, tmpl string, args ...interface{}) error
- func RegisterHTTPServer(s *grpc.Server, srv HTTPServer)
- type HTTPClient
- type HTTPRequest
- func (*HTTPRequest) Descriptor() ([]byte, []int)
- func (m *HTTPRequest) GetBody() []byte
- func (m *HTTPRequest) GetHeaders() []*Header
- func (m *HTTPRequest) GetMethod() string
- func (m *HTTPRequest) GetUrl() string
- func (*HTTPRequest) ProtoMessage()
- func (m *HTTPRequest) Reset()
- func (m *HTTPRequest) String() string
- type HTTPResponse
- type HTTPServer
- type Header
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorFromHTTPResponse ¶
func ErrorFromHTTPResponse(resp *HTTPResponse) error
ErrorFromHTTPResponse converts an HTTP response into a grpc error
func Errorf ¶
Errorf returns a HTTP gRPC error than is correctly forwarded over gRPC, and can eventually be converted back to a HTTP response with HTTPResponseFromError.
func RegisterHTTPServer ¶
func RegisterHTTPServer(s *grpc.Server, srv HTTPServer)
Types ¶
type HTTPClient ¶
type HTTPClient interface {
Handle(ctx context.Context, in *HTTPRequest, opts ...grpc.CallOption) (*HTTPResponse, error)
}
func NewHTTPClient ¶
func NewHTTPClient(cc *grpc.ClientConn) HTTPClient
type HTTPRequest ¶
type HTTPRequest struct { Method string `protobuf:"bytes,1,opt,name=method" json:"method,omitempty"` Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` Headers []*Header `protobuf:"bytes,3,rep,name=headers" json:"headers,omitempty"` Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` }
func (*HTTPRequest) Descriptor ¶
func (*HTTPRequest) Descriptor() ([]byte, []int)
func (*HTTPRequest) GetBody ¶
func (m *HTTPRequest) GetBody() []byte
func (*HTTPRequest) GetHeaders ¶
func (m *HTTPRequest) GetHeaders() []*Header
func (*HTTPRequest) GetMethod ¶
func (m *HTTPRequest) GetMethod() string
func (*HTTPRequest) GetUrl ¶
func (m *HTTPRequest) GetUrl() string
func (*HTTPRequest) ProtoMessage ¶
func (*HTTPRequest) ProtoMessage()
func (*HTTPRequest) Reset ¶
func (m *HTTPRequest) Reset()
func (*HTTPRequest) String ¶
func (m *HTTPRequest) String() string
type HTTPResponse ¶
type HTTPResponse struct { Code int32 `protobuf:"varint,1,opt,name=Code" json:"Code,omitempty"` Headers []*Header `protobuf:"bytes,2,rep,name=headers" json:"headers,omitempty"` Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` }
func HTTPResponseFromError ¶
func HTTPResponseFromError(err error) (*HTTPResponse, bool)
HTTPResponseFromError converts a grpc error into an HTTP response
func (*HTTPResponse) Descriptor ¶
func (*HTTPResponse) Descriptor() ([]byte, []int)
func (*HTTPResponse) GetBody ¶
func (m *HTTPResponse) GetBody() []byte
func (*HTTPResponse) GetCode ¶
func (m *HTTPResponse) GetCode() int32
func (*HTTPResponse) GetHeaders ¶
func (m *HTTPResponse) GetHeaders() []*Header
func (*HTTPResponse) ProtoMessage ¶
func (*HTTPResponse) ProtoMessage()
func (*HTTPResponse) Reset ¶
func (m *HTTPResponse) Reset()
func (*HTTPResponse) String ¶
func (m *HTTPResponse) String() string
type HTTPServer ¶
type HTTPServer interface {
Handle(context.Context, *HTTPRequest) (*HTTPResponse, error)
}
type Header ¶
type Header struct { Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` Values []string `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"` }
func (*Header) Descriptor ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.