Spectra S3 Go SDK
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.
Contributing
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.
Documentation
The latest documentation is located at Go SDK Documentation.
Installing with GB
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
Client
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 Endpoint
DS3_ACCESS_KEY
- The DS3 access key
DS3_SECRET_KEY
- The DS3 secret key
http_proxy
- If set, the Client
instance will proxy through this URL
Examples
All examples are listed in the samples module. All samples can be run from samples main.
Running Tests with GB
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