forwarding

package
v0.8.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package forwarding is a generated protocol buffer package.

It is generated from these files:

types.proto

It has these top-level messages:

Request
URL
HeaderEntry
Response

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateForwardedHTTPRequest

func GenerateForwardedHTTPRequest(req *http.Request, addr string) (*http.Request, error)

GenerateForwardedRequest generates a new http.Request that contains the original requests's information in the new request's body.

func ParseForwardedHTTPRequest

func ParseForwardedHTTPRequest(req *http.Request) (*http.Request, error)

ParseForwardedRequest generates a new http.Request that is comprised of the values in the given request's body, assuming it correctly parses into a ForwardedRequest.

func ParseForwardedRequest

func ParseForwardedRequest(fq *Request) (*http.Request, error)

Types

type HeaderEntry

type HeaderEntry struct {
	Values []string `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
}

func (*HeaderEntry) Descriptor

func (*HeaderEntry) Descriptor() ([]byte, []int)

func (*HeaderEntry) GetValues added in v0.6.3

func (m *HeaderEntry) GetValues() []string

func (*HeaderEntry) ProtoMessage

func (*HeaderEntry) ProtoMessage()

func (*HeaderEntry) Reset

func (m *HeaderEntry) Reset()

func (*HeaderEntry) String

func (m *HeaderEntry) String() string

type RPCResponseWriter

type RPCResponseWriter struct {
	// contains filtered or unexported fields
}

func NewRPCResponseWriter

func NewRPCResponseWriter() *RPCResponseWriter

NewRPCResponseWriter returns an initialized RPCResponseWriter

func (*RPCResponseWriter) Body

func (w *RPCResponseWriter) Body() *bytes.Buffer

func (*RPCResponseWriter) Header

func (w *RPCResponseWriter) Header() http.Header

func (*RPCResponseWriter) StatusCode

func (w *RPCResponseWriter) StatusCode() int

func (*RPCResponseWriter) Write

func (w *RPCResponseWriter) Write(buf []byte) (int, error)

func (*RPCResponseWriter) WriteHeader

func (w *RPCResponseWriter) WriteHeader(code int)

type Request

type Request struct {
	// Not used right now but reserving in case it turns out that streaming
	// makes things more economical on the gRPC side
	// uint64 id = 1;
	Method           string                  `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"`
	Url              *URL                    `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"`
	HeaderEntries    map[string]*HeaderEntry `` /* 167-byte string literal not displayed */
	Body             []byte                  `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
	Host             string                  `protobuf:"bytes,6,opt,name=host" json:"host,omitempty"`
	RemoteAddr       string                  `protobuf:"bytes,7,opt,name=remote_addr,json=remoteAddr" json:"remote_addr,omitempty"`
	PeerCertificates [][]byte                `protobuf:"bytes,8,rep,name=peer_certificates,json=peerCertificates,proto3" json:"peer_certificates,omitempty"`
}

func GenerateForwardedRequest

func GenerateForwardedRequest(req *http.Request) (*Request, error)

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) GetBody added in v0.6.3

func (m *Request) GetBody() []byte

func (*Request) GetHeaderEntries

func (m *Request) GetHeaderEntries() map[string]*HeaderEntry

func (*Request) GetHost added in v0.6.3

func (m *Request) GetHost() string

func (*Request) GetMethod added in v0.6.3

func (m *Request) GetMethod() string

func (*Request) GetPeerCertificates added in v0.6.3

func (m *Request) GetPeerCertificates() [][]byte

func (*Request) GetRemoteAddr added in v0.6.3

func (m *Request) GetRemoteAddr() string

func (*Request) GetUrl

func (m *Request) GetUrl() *URL

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

type Response

type Response struct {
	// Not used right now but reserving in case it turns out that streaming
	// makes things more economical on the gRPC side
	// uint64 id = 1;
	StatusCode uint32 `protobuf:"varint,2,opt,name=status_code,json=statusCode" json:"status_code,omitempty"`
	Body       []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// Added in 0.6.2 to ensure that the content-type is set appropriately, as
	// well as any other information
	HeaderEntries map[string]*HeaderEntry `` /* 167-byte string literal not displayed */
}

func (*Response) Descriptor

func (*Response) Descriptor() ([]byte, []int)

func (*Response) GetBody added in v0.6.3

func (m *Response) GetBody() []byte

func (*Response) GetHeaderEntries added in v0.6.2

func (m *Response) GetHeaderEntries() map[string]*HeaderEntry

func (*Response) GetStatusCode added in v0.6.3

func (m *Response) GetStatusCode() uint32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

type URL

type URL struct {
	Scheme string `protobuf:"bytes,1,opt,name=scheme" json:"scheme,omitempty"`
	Opaque string `protobuf:"bytes,2,opt,name=opaque" json:"opaque,omitempty"`
	// This isn't needed now but might be in the future, so we'll skip the
	// number to keep the ordering in net/url
	// UserInfo user = 3;
	Host    string `protobuf:"bytes,4,opt,name=host" json:"host,omitempty"`
	Path    string `protobuf:"bytes,5,opt,name=path" json:"path,omitempty"`
	RawPath string `protobuf:"bytes,6,opt,name=raw_path,json=rawPath" json:"raw_path,omitempty"`
	// This also isn't needed right now, but we'll reserve the number
	// bool force_query = 7;
	RawQuery string `protobuf:"bytes,8,opt,name=raw_query,json=rawQuery" json:"raw_query,omitempty"`
	Fragment string `protobuf:"bytes,9,opt,name=fragment" json:"fragment,omitempty"`
}

func (*URL) Descriptor

func (*URL) Descriptor() ([]byte, []int)

func (*URL) GetFragment added in v0.6.3

func (m *URL) GetFragment() string

func (*URL) GetHost added in v0.6.3

func (m *URL) GetHost() string

func (*URL) GetOpaque added in v0.6.3

func (m *URL) GetOpaque() string

func (*URL) GetPath added in v0.6.3

func (m *URL) GetPath() string

func (*URL) GetRawPath added in v0.6.3

func (m *URL) GetRawPath() string

func (*URL) GetRawQuery added in v0.6.3

func (m *URL) GetRawQuery() string

func (*URL) GetScheme added in v0.6.3

func (m *URL) GetScheme() string

func (*URL) ProtoMessage

func (*URL) ProtoMessage()

func (*URL) Reset

func (m *URL) Reset()

func (*URL) String

func (m *URL) String() string

Jump to

Keyboard shortcuts

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