The Ionburst SDK for Go enables Golang developers to easily work with Ionburst Cloud and build ultra-secure and private storage into their applications.
$ go get gitlab.com/ionburst/ionburst-sdk-go
The Ionburst SDK can get its configuration (ionburst_id, ionburst_key, ionburst_uri) from the following three files.
If ionburst_id
and ionburst_key
are not specified by environment variable, they are obtained from the credentials file.
If ionburst_uri
is not specified in the Ionburst constructor, it'll check the credentials file.
IONBURST_ID=IB******************
IONBURST_KEY=eW91aGF2ZXRvb211Y2h0aW1lb255b3VyaGFuZHMh
IONBURST_URI=https://api.example.ionburst.cloud/
~/.ionburst/credentials
on Mac, Linux and BSD, and C:\Users\%USERNAME%\.ionburst\credentials
on Windows
[example]
ionburst_id=IB******************
ionburst_key=eW91aGF2ZXRvb211Y2h0aW1lb255b3VyaGFuZHMh
ionburst_uri=https://api.example.ionburst.cloud/
ioncli is a command line utility written using this SDK to perform basic operations.
Please click here to learn more.
package client
import (
ionburst "gitlab.com/ionburst/ionburst-sdk-go"
}
func main() {
//Create a new client using the default config
client, err := ionburst.NewClient()
//Create a client with implicit path and credentials profile name
client, err := ionburst.NewClientPathAndProfile(configFilePath, credentialsProfileName, setDebugMode [true/false])
}
//get a readable stream
ioReader, _ := os.Open(FilePath)
client.Put(FileID, ioReader, classification)
//if classification is an empty string ("") it wont be passed
//Upload from a filepath instead
client.PutFromFile(FileID, FilePath, classification)
ioReader, err := client.Get(FileID)
//Download to a filepath instead
err := client.GetToFile(FileID, OutputFilePath)
//Download and output the size of the downloaded content
ioReader, sizeOfContent, err := client.GetWithLen(FileID)
err := client.Delete(FileID)
classifications, _ := client.GetClassifications()
token, err := cli.PutDeferred(name, r, "")
if err != nil {
t.Error(err)
return
}
token, err := cli.GetDeferred(name)
if err != nil {
t.Error(err)
return
}
res, err = cli.CheckDeferred(tk)
if err != nil {
t.Error(err)
return
} else if !res.Success {
t.Error(fmt.Sprintf("ERR: %s - %d", res.Message, res.Status))
return
} else {
...
}
ioReader, err := cli.FetchDeferred(tk)
if err != nil {
t.Error(err)
return
}
Please use the following community resources to get help. We use Gitlab issues to track bugs and feature requests.
- Join the Ionburst Cloud community on Slack
- Get in touch with Ionburst Support
- If you have found a bug, please open an issue
If you find a bug, or have an issue with the Ionburst SDK for Go we would like to hear about it. Check the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of ionburst-sdk-go
and the OS you’re using. Please include a stack trace and steps to reproduce the issue.
The Gitlab issues are intended for bug reports and feature requests. For help and questions with using the Ionburst SDK for Go please make use of the resources listed in the Getting Help section. There are limited resources available for handling issues and by keeping the list of open issues clean we can respond in a timely manner.
The changelog for the SDK can be found in the CHANGELOG file.
A massive thanks to Craig Smith for developing this SDK.
- github.com/antihax/optional - a utility library for the handling of default and optional values
- golang.org/x/oauth2 - Google's OAuth library