gateway

package
v0.0.0-...-e933104 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequest

func DoRequest[T any](ctx context.Context, req *resty.Request) (*T, error)

func DoStreamingRequest

func DoStreamingRequest[T any](ctx context.Context, c Client, req *resty.Request) (<-chan *T, <-chan error, error)

func HTTPStatusToCode

func HTTPStatusToCode(code int) codes.Code

HTTPStatusToCode converts HTTP status code to gRPC error code https://github.com/grpc/grpc/blob/9d2a1a3d1aba56d94c56d2e01cf2511d1a082445/doc/http-grpc-status-mapping.md

func NewEventStreamMarshaller

func NewEventStreamMarshaller(marshaller *runtime.JSONPb) runtime.Marshaler

Types

type Client

type Client interface {
	NewRequest(method, url string) *resty.Request

	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
}

func NewClient

func NewClient(baseURL string, opts ...ClientOption) Client

type ClientOption

type ClientOption func(*client)

func SkipTLSVerify

func SkipTLSVerify(skip bool) ClientOption

func WithHTTPClient

func WithHTTPClient(hc *http.Client) ClientOption

func WithMarshaller

func WithMarshaller(m *runtime.JSONPb) ClientOption

Jump to

Keyboard shortcuts

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