blob: 745a208c99d545abaa86b4f1e19854c20ca818ec [file] [log] [blame]
divyadesai81bb7ba2020-03-11 11:45:23 +00001package api
2
3// Raw can be used to do raw queries against custom endpoints
4type Raw struct {
5 c *Client
6}
7
8// Raw returns a handle to query endpoints
9func (c *Client) Raw() *Raw {
10 return &Raw{c}
11}
12
13// Query is used to do a GET request against an endpoint
14// and deserialize the response into an interface using
15// standard Consul conventions.
16func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) {
17 return raw.c.query(endpoint, out, q)
18}
19
20// Write is used to do a PUT request against an endpoint
21// and serialize/deserialized using the standard Consul conventions.
22func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) {
23 return raw.c.write(endpoint, in, out, q)
24}