types

package
v0.1.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	HTTPMethod    string
	Path          string
	RawQuery      string
	Fragment      string
	Proto         string
	ProtoMajor    int
	ProtoMinor    int
	Host          string
	RemoteAddr    string
	RequestURI    string
	ContentLength int64
	Body          []byte
	Headers       map[string][]string
	PathParams    map[string]string
	QueryParams   map[string][]string
	Route         string
}

This is just a wrapper around the protobuf definition in proto/ingress.proto It makes them easier to use and avoids exposing the generated code to the rest of the runtime package.

func ReqFromHTTP

func ReqFromHTTP(req *http.Request, route string, pathParams map[string]string) *Request

func (*Request) ToProto

func (req *Request) ToProto() (*manifest.FoldHTTPRequest, error)

type Response

type Response struct {
	Status  int
	Body    []byte
	Headers map[string][]string
}

This is just a wrapper around the protobuf definition in proto/ingress.proto It makes them easier to use and avoids exposing the generated code to the rest of the runtime package.

func ResFromProto

func ResFromProto(res *manifest.FoldHTTPResponse) *Response

Jump to

Keyboard shortcuts

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