Documentation
¶
Index ¶
- func DoRequest[T any](ctx context.Context, req *resty.Request) (*T, error)
- func DoStreamingRequest[T any](ctx context.Context, c Client, req *resty.Request) (<-chan *T, <-chan error, error)
- func HTTPStatusToCode(code int) codes.Code
- func NewEventStreamMarshaller(marshaller *runtime.JSONPb) runtime.Marshaler
- type Client
- type ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoStreamingRequest ¶
func HTTPStatusToCode ¶
HTTPStatusToCode converts HTTP status code to gRPC error code https://github.com/grpc/grpc/blob/9d2a1a3d1aba56d94c56d2e01cf2511d1a082445/doc/http-grpc-status-mapping.md
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
Click to show internal directories.
Click to hide internal directories.