Documentation ¶
Index ¶
- Constants
- Variables
- func NewRequest(method, urlStr string, body []byte) (*http.Request, error)
- func NewResponse() *http.Response
- func NewRestClient(opts client.Options) (client.ProtocolClient, error)
- type Client
- func (c *Client) Call(ctx context.Context, addr string, inv *invocation.Invocation, rsp interface{}) error
- func (c *Client) Close() error
- func (c *Client) GetOptions() client.Options
- func (c *Client) ReloadConfigs(opts client.Options)
- func (c *Client) Status(rsp interface{}) (status int, err error)
- func (c *Client) String() string
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 * 20 //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 ¶
NewRequest is a function which creates new request
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) GetOptions ¶
GetOptions method return opts
func (*Client) ReloadConfigs ¶
ReloadConfigs reload configs for timeout and tls
Click to show internal directories.
Click to hide internal directories.