featurebase/client
Matthew Jaffee a16fee5f88 set shardWidth properly in client
the shardwidth22 tests were broken client side, but we didn't realize
this because we weren't running the client side tests since moving the
client code into the main FB repo until recently (woops), and more
recently, we'd stopped running the shardwidth22 tests in the move to
Gitlab, so when we re-enabled them we finally noticed that they were
broken in the client.

All this change does is takes the shardWidth value from the core
featurebase package instead of using a hardcoded value in the client package.
2022-01-17 10:57:01 -06:00
..
csv add copyright notice back in 2021-12-10 11:01:04 -06:00
docs remove attributes 2021-05-14 10:28:08 -04:00
egpool add copyright notice back in 2021-12-10 11:01:04 -06:00
batch.go add sorting for ints/mutex in batch importer 2022-01-11 10:15:58 -06:00
batch_test.go refactor client batch tests to reduce duplication 2022-01-11 10:17:43 -06:00
client.go set shardWidth properly in client 2022-01-17 10:57:01 -06:00
client_it_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
client_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
cluster.go add copyright notice back in 2021-12-10 11:01:04 -06:00
cluster_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
doc.go add copyright notice back in 2021-12-10 11:01:04 -06:00
error.go add copyright notice back in 2021-12-10 11:01:04 -06:00
ingest_api_batch.go try to get some more test coverage on error cases 2021-12-06 20:19:42 -06:00
ingest_api_batch_test.go skip sometimes-failing test of experimental code 2022-01-13 13:16:57 -06:00
logimport.go add copyright notice back in 2021-12-10 11:01:04 -06:00
logimport_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
metrics.go add copyright notice back in 2021-12-10 11:01:04 -06:00
orm.go add copyright notice back in 2021-12-10 11:01:04 -06:00
orm_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
README.md Address PR comments 2021-03-24 18:09:01 +01:00
record.go add copyright notice back in 2021-12-10 11:01:04 -06:00
record_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
response.go add copyright notice back in 2021-12-10 11:01:04 -06:00
response_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
shardnodes.go add copyright notice back in 2021-12-10 11:01:04 -06:00
tracer.go add copyright notice back in 2021-12-10 11:01:04 -06:00
validate.go add copyright notice back in 2021-12-10 11:01:04 -06:00
validate_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
version.go add copyright notice back in 2021-12-10 11:01:04 -06:00

Go Client for Pilosa

Go client for Pilosa high performance distributed index.

Usage

If you have the pilosa repo in your GOPATH, you can import the library in your code using:

import "github.com/pilosa/pilosa/v2/client"

Quick overview

Assuming Pilosa server is running at localhost:10101 (the default):

package main

import (
	"fmt"

	"github.com/pilosa/pilosa/v2/client"
)

func main() {
	// Create the default client
	cli := client.DefaultClient()

	// Retrieve the schema
	schema, err := cli.Schema()

	// Create an Index object
	myindex := schema.Index("myindex")

	// Create a Field object
	myfield := myindex.Field("myfield")

	// make sure the index and the field exists on the server
	err := cli.SyncSchema(schema)

	// Send a Set query. If err is non-nil, response will be nil.
	response, err := cli.Query(myfield.Set(5, 42))

	// Send a Row query. If err is non-nil, response will be nil.
	response, err = cli.Query(myfield.Row(5))

	// Get the result
	result := response.Result()
	// Act on the result
	if result != nil {
		columns := result.Row().Columns
		fmt.Println("Got columns: ", columns)
	}

	// You can batch queries to improve throughput
	response, err = cli.Query(myindex.BatchQuery(
		myfield.Row(5),
		myfield.Row(10)))
	if err != nil {
		fmt.Println(err)
	}

	for _, result := range response.Results() {
		// Act on the result
		fmt.Println(result.Row().Columns)
	}
}

Documentation

Data Model and Queries

See: Data Model and Queries

Executing Queries

See: Server Interaction

Other Documentation