Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPRequest ¶
func HTTPRequest(r *http.Request) (*httpgrpc.HTTPRequest, error)
HTTPRequest wraps an ordinary HTTPRequest with a gRPC one
func ParseURL ¶
ParseURL deals with direct:// style URLs, as well as kubernetes:// urls. For backwards compatibility it treats URLs without schems as kubernetes://.
func WriteError ¶
func WriteError(w http.ResponseWriter, err error)
WriteError converts an httpgrpc error to an HTTP one
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, resp *httpgrpc.HTTPResponse) error
WriteResponse converts an httpgrpc response to an HTTP one
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a http.Handler that forwards the request over gRPC.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements HTTPServer. HTTPServer is a generated interface that gRPC servers must implement.
func (Server) Handle ¶
func (s Server) Handle(ctx context.Context, r *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error)
Handle implements HTTPServer.
Click to show internal directories.
Click to hide internal directories.