internal

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParamErr = fmt.Errorf("param error")
)

Functions

func GetTimeout

func GetTimeout(header http.Header, defaultTimeout time.Duration) time.Duration

GetTimeout returns the timeout from the header, if not set, returns the default timeout.

func NewRequestParser

func NewRequestParser(r *http.Request, resolver jsonpb.AnyResolver) (grpcurl.RequestParser, error)

NewRequestParser creates a new request parser from the given http.Request and resolver.

func ProcessHeaders

func ProcessHeaders(header http.Header) []string

ProcessHeaders builds the headers for the gateway from HTTP headers.

Types

type JSONRequestParser

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

func NewJSONRequestParser

func NewJSONRequestParser(r *http.Request, resolver jsonpb.AnyResolver) (*JSONRequestParser, error)

func (*JSONRequestParser) Next

func (f *JSONRequestParser) Next(m proto.Message) error

func (*JSONRequestParser) NumRequests

func (f *JSONRequestParser) NumRequests() int

type Method

type Method struct {
	HttpMethod string
	HttpPath   string
	RpcPath    string
}

func GetMethods

func GetMethods(source grpcurl.DescriptorSource) ([]Method, error)

GetMethods returns all methods of the given grpcurl.DescriptorSource.

Jump to

Keyboard shortcuts

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