rpc

package
v0.0.0-...-7644613 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clienter

type Clienter interface {
	// Get handle json response
	Get(url string, resp interface{}) (err error)

	PostForm(url string, body io.Reader, contentType string, resp interface{}) (err error)
	PostJSON(url string, req, resp interface{}) (err error)
	PutJSON(url string, req, resp interface{}) (err error)
	Delete(url string, resp interface{}) (err error)
}

Clienter client interface

func NewHTTPClient

func NewHTTPClient(secret string) Clienter

NewHTTPClient new http client with secret

func NewQuicClient

func NewQuicClient(secret string, opt ...interface{}) Clienter

NewQuicClient new quic client

type HTTPClient

type HTTPClient struct {
	*http.Client
}

HTTPClient client

func (*HTTPClient) Delete

func (c *HTTPClient) Delete(url string, resp interface{}) (err error)

Delete delete

func (*HTTPClient) Get

func (c *HTTPClient) Get(url string, resp interface{}) (err error)

Get implement clienter

func (*HTTPClient) PostForm

func (c *HTTPClient) PostForm(url string, body io.Reader, contentType string, resp interface{}) (err error)

func (*HTTPClient) PostJSON

func (c *HTTPClient) PostJSON(url string, req, resp interface{}) (err error)

PostJSON post with json

func (*HTTPClient) PutJSON

func (c *HTTPClient) PutJSON(url string, req, resp interface{}) (err error)

PutJSON put with json

type HTTPTransport

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

HTTPTransport http transport

func (*HTTPTransport) RoundTrip

func (htr *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implement http.RoundTripper

Jump to

Keyboard shortcuts

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