Module etcd-client.client.auth_http
HTTP client for etcd with authorization.
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.close (self) | Close a client. |
Module functions
| new (endpoint, name, password, opts) | Create a new http client instance. |
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.close (self)
-
Close a client.
Parameters:
- self
HTTP client instance.
Returns:
-
nil
- self
Module functions
- new (endpoint, name, password, opts)
-
Create a new http client instance.
It's a wrapper around etcd-client.client.http with automatic authentification and re-authentification on token expire.
Parameters:
- endpoint
(string)
An endpoint for requests.
- name
(string)
User name.
- password
(string)
User password.
- opts
(table)
HTTP client options, see
optsparam at etcd-client.client.http.new.
Returns:
-
http client instance
- endpoint
(string)