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 must be installed under $GOPATH/src/github.com/SpectraLogic
, where $GOPATH
denotes the location of the Go workspace, and src
denotes the location of source files within the workspace.
For information regarding Go workspace, see Golang Workspaces.
Install the latest version of the Go SDK in the src/github.com/SpectraLogic
folder. You can clone it with the following command:
cd $GOPATH/src/github.com/SpectraLogic
git clone https://github.com/SpectraLogic/ds3_go_sdk.git
Install the latest version of GB. Make sure to compiled the GB project.
Compile the Go SDK using GB with the commands:
cd ds3_go_sdk
gb build all
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, theClient
instance 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. To run tests, cd to
the Go SDK's main folder ds3_go_sdk
.
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:
gb test -v
Run unit tests with test output:
gb test -v ds3
Run integration tests with test output:
gb test -v ds3_integration