client

package
v0.0.0-...-5d1c7d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

A rest client to be used with server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetaResponse

func MetaResponse(resp *http.Response) (IndexMetaResponse, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL