Module etcd-client.client.http
HTTP client for etcd.
Instance methods
| instance.request (self, location, req) | Send the request to the specified location. |
| instance.stream (self, location) | Create a stream to the specified location. |
| instance.api (self) | Determinates and returns an api version of the endpoint. |
| instance.close (self) | Close a client. |
Module functions
| new (endpoint, opts) | Create a new http client instance. |
Constansts
| API_V3_ALPHA | v3alpha |
| API_V3_BETA | v3beta |
| API_V3 | v3 |
Defaults
| http_client_new_opts_default | Default HTTP client instance options. |
| http_client_request_opts_default | Default HTTP client request options. |
HTTP options
| http_client_new_opts | HTTP client instance options. |
| http_client_request_opts | HTTP client request options. |
Instance methods
- instance.request (self, location, req)
-
Send the request to the specified location.
Parameters:
- self
HTTP client instance.
- location
(string)
A target location.
- req
(string)
Request body.
Returns:
- true, response
- false, etcd-client.error.http.HttpError
- false, etcd-client.error.etcd.EtcdError.
- self
- instance.stream (self, location)
-
Create a stream to the specified location.
Parameters:
- self
HTTP client instance.
- location
(string)
A target location.
Returns:
- true, etcd-client.client.jsstream instance
- false, etcd-client.error.http.HttpError
- false, etcd-client.error.etcd.EtcdError
- self
- instance.api (self)
-
Determinates and returns an api version of the endpoint.
It may return false and an error if unable to get an API version.
Parameters:
- self
HTTP client instance.
Returns:
- true, string
- false, etcd-client.error.http.HttpError
- false, etcd-client.error.etcd.EtcdError
- self
- instance.close (self)
-
Close a client.
Parameters:
- self
HTTP client instance.
Returns:
-
nil
- self
Module functions
- new (endpoint, opts)
-
Create a new http client instance.
Parameters:
- endpoint
(string)
An endpoint for requests.
- opts
(table)
http client options.
- http_client
(table,
optional)
http.client object options.
- http_client.new
(table,
optional)
- http_client.request
(table,
optional)
- http_client
(table,
optional)
Returns:
-
http client instance.
- endpoint
(string)
Constansts
Defaults
- Default HTTP client instance options.
-
Just empty table at the moment.
- Default HTTP client request options.
-
Enables
keepalive_*options to enforce the HTTP client to hold connections for a while in order to reuse them for next requests.Fields:
- keepalive_idle
= 60
- keepalive_interval
= 60
- keepalive_idle
= 60