github.com/DerekStrickland/consul@v1.4.5/api/raw.go (about)

     1  package api
     2  
     3  // Raw can be used to do raw queries against custom endpoints
     4  type Raw struct {
     5  	c *Client
     6  }
     7  
     8  // Raw returns a handle to query endpoints
     9  func (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.
    16  func (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.
    22  func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) {
    23  	return raw.c.write(endpoint, in, out, q)
    24  }