rpc

package
v0.0.0-...-8f6b5bc Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = Client{http.DefaultClient}
View Source
var UserAgent = "Golang qiniu/rpc package"

Functions

func ResponseError

func ResponseError(resp *http.Response) (err error)

Types

type Client

type Client struct {
	*http.Client
}

func (Client) Call

func (r Client) Call(
	l Logger, ret interface{}, url1 string) (err error)

func (Client) CallWith

func (r Client) CallWith(
	l Logger, ret interface{}, url1 string, bodyType string, body io.Reader, bodyLength int) (err error)

func (Client) CallWith64

func (r Client) CallWith64(
	l Logger, ret interface{}, url1 string, bodyType string, body io.Reader, bodyLength int64) (err error)

func (Client) CallWithForm

func (r Client) CallWithForm(l Logger, ret interface{}, url1 string, param map[string][]string) (err error)

func (Client) CallWithJson

func (r Client) CallWithJson(l Logger, ret interface{}, url1 string, param interface{}) (err error)

func (Client) Do

func (r Client) Do(l Logger, req *http.Request) (resp *http.Response, err error)

func (Client) Get

func (r Client) Get(l Logger, url string) (resp *http.Response, err error)

func (Client) PostWith

func (r Client) PostWith(
	l Logger, url1 string, bodyType string, body io.Reader, bodyLength int) (resp *http.Response, err error)

func (Client) PostWith64

func (r Client) PostWith64(
	l Logger, url1 string, bodyType string, body io.Reader, bodyLength int64) (resp *http.Response, err error)

func (Client) PostWithForm

func (r Client) PostWithForm(
	l Logger, url1 string, data map[string][]string) (resp *http.Response, err error)

func (Client) PostWithJson

func (r Client) PostWithJson(
	l Logger, url1 string, data interface{}) (resp *http.Response, err error)

type ErrorInfo

type ErrorInfo struct {
	Err     string   `json:"error"`
	Reqid   string   `json:"reqid"`
	Details []string `json:"details"`
	Code    int      `json:"code"`
}

func (*ErrorInfo) Error

func (r *ErrorInfo) Error() string

type Logger

type Logger interface {
	ReqId() string
	Xput(logs []string)
}

Jump to

Keyboard shortcuts

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