client

package
v0.0.0-...-56bb206 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

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

func ParseURL(unparsed string) (string, error)

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.

func NewClient

func NewClient(address string) (*Client, error)

NewClient makes a new Client, given a kubernetes service address.

func (*Client) ServeHTTP

func (c *Client) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL