lib

package
v0.0.0-...-16baca5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMethodHasNoHTTPClientSupport  = errors.New("no google.api.http option for this method")
	ErrMethodHasNoHTTPBindingSupport = errors.New("no binding specified for google.api.HttpRule")
)

Functions

func DefaultHTTPRequestPreflightHandler

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

func DefaultHTTPResponseValidator

func DefaultHTTPResponseValidator(res *http.Response) error

func DefaultMethodValidator

func DefaultMethodValidator(msg ProtoMessageValidator) error

func WithResponseValidateError

func WithResponseValidateError()

func WithValidation

func WithValidation()

Types

type HTTPClientMethodValidatorHandler

type HTTPClientMethodValidatorHandler func(ProtoMessageValidator) (err error)

type HTTPClientService

type HTTPClientService struct {
	BaseURL               string
	Client                *http.Client
	PbDiscardUnknown      bool
	HttpRequestPreflight  HTTPRequestPreflightHandler
	HttpResponseValidator HTTPResponseValidatorHandler
	ResponseValidator     HTTPClientMethodValidatorHandler
}

func (HTTPClientService) Do

func (c HTTPClientService) Do(req *http.Request) (res *http.Response, err error)

func (*HTTPClientService) ResponseHTTPClientHandler

func (cs *HTTPClientService) ResponseHTTPClientHandler(res *http.Response, dst ProtoMessageIface) (err error)

type HTTPRequestPreflightHandler

type HTTPRequestPreflightHandler func(req *http.Request) (res *http.Request, err error)

type HTTPResponseValidatorHandler

type HTTPResponseValidatorHandler func(res *http.Response) (err error)

type ProtoMessageIface

type ProtoMessageIface interface {
	protoreflect.ProtoMessage
	// proto.Message
	protoiface.MessageV1
}

type ProtoMessageValidator

type ProtoMessageValidator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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