rest

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// Name is a constant of type string
	Name = "rest"
	// FailureTypePrefix is a constant of type string
	FailureTypePrefix = "http_"
	//DefaultTimeoutBySecond defines the default timeout for http connections
	DefaultTimeoutBySecond = 60 * time.Second
	//DefaultKeepAliveSecond defines the connection time
	DefaultKeepAliveSecond = 60 * time.Second
	//DefaultMaxConnsPerHost defines the maximum number of concurrent connections
	DefaultMaxConnsPerHost = 512
	//SchemaHTTP represents the http schema
	SchemaHTTP = "http"
	//SchemaHTTPS represents the https schema
	SchemaHTTPS = "https"
)

Variables

View Source
var (

	//ErrInvalidResp invalid input
	ErrInvalidResp = errors.New("rest consumer response arg is not *rest.Response type")
)

Functions

func NewRequest

func NewRequest(method, urlStr string, body []byte) (*http.Request, error)

NewRequest is a function which creates new request

func NewResponse

func NewResponse() *http.Response

NewResponse is creating the object of response

func NewRestClient

func NewRestClient(opts client.Options) (client.ProtocolClient, error)

NewRestClient is a function

Types

type Client

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

Client is a struct

func (*Client) Call

func (c *Client) Call(ctx context.Context, addr string, inv *invocation.Invocation, rsp interface{}) error

Call is a method which uses client struct object

func (*Client) Close added in v0.8.1

func (c *Client) Close() error

Close is noop

func (*Client) GetOptions added in v1.3.0

func (c *Client) GetOptions() client.Options

GetOptions method return opts

func (*Client) ReloadConfigs added in v1.3.0

func (c *Client) ReloadConfigs(opts client.Options)

ReloadConfigs reload configs for timeout and tls

func (*Client) String

func (c *Client) String() string

Jump to

Keyboard shortcuts

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