Documentation ¶
Overview ¶
A rest client to be used with server.
Index ¶
- func MetaResponse(resp *http.Response) (IndexMetaResponse, error)
- type RestClient
- func (client *RestClient) Create(indexinfo IndexInfo) (string, IndexInfo, error)
- func (client *RestClient) Drop(uuid string) (string, error)
- func (client *RestClient) Index(uuid string) (IndexInfo, error)
- func (client *RestClient) List(serverUuid string) (string, []IndexInfo, error)
- func (client *RestClient) Nodes() ([]NodeInfo, error)
- func (client *RestClient) Notify(serverUuid string) (ResponseStatus, string, error)
- func (client *RestClient) Scan(index *IndexInfo, q QueryParams) ([]IndexRow, error)
- func (client *RestClient) Trait(index *IndexInfo, op interface{}) TraitInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetaResponse ¶
Gather index meta response from http response.
Types ¶
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
A notion of catalog on the client side. For most operations we access the server - transparently.
func NewRestClient ¶
func NewRestClient(addr string) *RestClient
Create a notion of catalog on the client side.
func (*RestClient) Create ¶
func (client *RestClient) Create(indexinfo IndexInfo) ( string, IndexInfo, error)
Create a new index. If successful, return index-info as returned by the server, also the unique id generated by the server.
func (*RestClient) Drop ¶
func (client *RestClient) Drop(uuid string) (string, error)
Drop index. `uuid` identies the index to be droped but is unique-id. The call returns server's new unique-id.
func (*RestClient) Index ¶
func (client *RestClient) Index(uuid string) (IndexInfo, error)
Get Finder interface for the index.
func (*RestClient) List ¶
func (client *RestClient) List(serverUuid string) ( string, []IndexInfo, error)
List of all indexes. if `serverUuid` is same as server's unique-id then index-data is not sent back, if it doesn't match or if it is empty, then list of all index data is sent back.
func (*RestClient) Nodes ¶
func (client *RestClient) Nodes() ([]NodeInfo, error)
func (*RestClient) Notify ¶
func (client *RestClient) Notify(serverUuid string) (ResponseStatus, string, error)
Return a error channel that will send a nil when server changes state or will return an error if something goes wrong.
func (*RestClient) Scan ¶
func (client *RestClient) Scan(index *IndexInfo, q QueryParams) ( []IndexRow, error)
Scan for index entries.
func (*RestClient) Trait ¶
func (client *RestClient) Trait(index *IndexInfo, op interface{}) TraitInfo