Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
github.com/rockset/rockset-go-client
Official Go client library for Rockset
Install the Rockset Go client from Github:
go get github.com/rockset/rockset-go-client
or install it from a source code checkout:
cd $GOPATH/src/github.com
mkdir rockset
cd rockset
git clone git@github.com:rockset/rockset-go-client.git
go install rockset-go-client/rockclient.go
You can see a few examples in the godoc of how to create a collection, how to put documents in a collection and how to use SQL to query your collections.
client, err := rockset.NewClient()
if err != nil {
log.Fatal(err)
}
ctx := context.TODO()
q := `SELECT * FROM "_events" LIMIT 1`
res, _, err := client.Query(ctx, q)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", res)
If the OpenAPI specification has changed, you need to regenerate the OpenAPI client
# bump the minor version
vi version.go
# generate a new client
./generate.sh
# record new VCR cassettes
VCR_MODE=record go test ./...
There are a number of testable examples which require an API key, i.e. set the ROCKSET_APIKEY
and ROCKSET_APISERVER
environment variables.
To run tests:
go test -v -timeout 30m ./...
To generate the fakes used for testing:
go generate ./...
Most tests use Go VCR, and they will use a cassette (recorded response) by default,
so if you want to re-record a cassette, set the environment variable VCR_MODE
to record
.
The VCR tracks ignore the patch version of the client version, so when the OpenAPI spec is updated you have to re-record the VCR cassettes.
If you don't have git lfs
set up, install before committing new recordings:
brew install git-lfs
git lfs install
git lfs track "*.cassette.gz"
go test ./... -coverprofile cover.out
go tool cover -func=cover.out
go tool cover -html=cover.out -o coverage.html
Feel free to log issues against this client through GitHub.
The Rockset Go Client is licensed under the Apache 2.0 License
version.go
generate.sh
git submodule update --init
go mod tidy
rm -rf testdata/cassettes/ && VCR_MODE=record go test -v -timeout 30m ./...
git lfs
before committing: brew install git-lfs && git lfs install && git lfs track "*.cassette.gz"
git tag v{version_number}
on mastergit push origin v{version_number}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.