featurebase/client
2021-10-08 08:27:49 -07:00
..
csv FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
docs remove attributes 2021-05-14 10:28:08 -04:00
egpool FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
batch.go adds more detail to CSV ingest error message 2021-10-08 08:27:49 -07:00
batch_test.go fix batch import of time fields with key translation 2021-06-10 09:41:59 -04:00
client.go CORE-747: Build tooling to provide datagen-like functionality that uses the API 2021-09-02 10:18:50 -04:00
client_it_test.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
client_test.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
cluster.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
cluster_test.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
doc.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
error.go Move internals proto files into separate package (pb) 2021-03-22 20:28:00 +01:00
logimport.go Add client package with go-pilosa implementation 2021-03-22 20:22:38 +01:00
logimport_test.go Add client package with go-pilosa implementation 2021-03-22 20:22:38 +01:00
metrics.go Add client package with go-pilosa implementation 2021-03-22 20:22:38 +01:00
orm.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
orm_test.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
README.md Address PR comments 2021-03-24 18:09:01 +01:00
record.go Move internals proto files into separate package (pb) 2021-03-22 20:28:00 +01:00
record_test.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
response.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
response_test.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
shardnodes.go FeatureBase Renaming: changing go.mod module name for featurebase 2021-07-19 09:20:30 -07:00
tracer.go Move internals proto files into separate package (pb) 2021-03-22 20:28:00 +01:00
validate.go Move internals proto files into separate package (pb) 2021-03-22 20:28:00 +01:00
validate_test.go Move internals proto files into separate package (pb) 2021-03-22 20:28:00 +01:00
version.go Move internals proto files into separate package (pb) 2021-03-22 20:28:00 +01: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