An SDK conforming to Spectra S3 for Golang 1.10
Join us at our Google Groups forum to ask questions, or see frequently asked questions.
If you would like to contribute to the source code, sign the Contributors Agreement. For an overview of how we use Github, please review our Github Workflow.
The latest documentation is located at Go SDK Documentation.
The Go SDK is a Go module. Add it to your project with:
go get github.com/SpectraLogic/ds3_go_sdkTo build the SDK from source, clone the repo anywhere and run:
git clone https://github.com/SpectraLogic/ds3_go_sdk.git
cd ds3_go_sdk
go build ./...Requires Go 1.23 or later.
In the ds3_go_sdk you create a Client instance through the setting of the following environment variables and using buildclient.FromEnv().
DS3_ENDPOINT- The URL to the DS3 EndpointDS3_ACCESS_KEY- The DS3 access keyDS3_SECRET_KEY- The DS3 secret keyhttp_proxy- If set, theClientinstance will proxy through this URL
All examples are listed in the samples module. All samples can be run from samples main.
- How to use get service to list buckets
- How to create a bucket
- How to get a list of S3 objects in a bucket
- How to get a single object using a naked S3 get
- How to use bulk put to send multiple files to the BP efficiently
- How to use bulk get to retrieve multiple files from the BP efficiently
There are unit tests in the ds3 package, and integration tests in the ds3_integration package. Run from the repo root.
In order to run the integration tests the following environment variables must be used to configure which DS3 appliance
to run the tests against: DS3_ENDPOINT, DS3_ACCESS_KEY, and DS3_SECRET_KEY.
Run all tests (unit and integration) with test output:
go test -v ./...Run unit tests with test output:
go test -v ./ds3/...Run integration tests with test output:
go test -v ./ds3_integration/...