httpclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent = "KodeRover Client"

Functions

func ResponseError

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

Types

type Client

type Client struct {
	*http.Client
}

TODO: lou: implement a complete http client.

func (Client) Call

func (r Client) Call(
	ctx context.Context, ret interface{}, method, url1 string) (err error)

func (Client) CallWithJson

func (r Client) CallWithJson(
	ctx context.Context, ret interface{}, method, url1 string, param interface{}) (err error)

func (Client) DoRequestWithJson

func (r Client) DoRequestWithJson(
	ctx context.Context, method, url1 string, data interface{}) (resp *http.Response, err error)

type ErrorInfo

type ErrorInfo struct {
	Err   string `json:"error,omitempty"`
	Key   string `json:"key,omitempty"`
	Errno int    `json:"errno,omitempty"`
	Code  int    `json:"code"`
}

func (*ErrorInfo) Error

func (r *ErrorInfo) Error() string

func (*ErrorInfo) ErrorDetail

func (r *ErrorInfo) ErrorDetail() string

func (*ErrorInfo) HttpCode

func (r *ErrorInfo) HttpCode() int

func (*ErrorInfo) RpcError

func (r *ErrorInfo) RpcError() (code, errno int, key, err string)

Jump to

Keyboard shortcuts

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