Transloadit's official Go SDK, maintained by the community
Go Shell Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
examples
fixtures
scripts
.gitignore
.travis.yml
LICENSE
Makefile
README.md
Vagrantfile
assembly.go
assembly_test.go
bored_instance.go
bored_instance_test.go
notification.go
notification_test.go
template.go
template_test.go
transloadit.go
transloadit_test.go
version.go
wait.go
wait_test.go
watch.go
watch_test.go

README.md

Build Status Coverage Status

go-sdk

A Go SDK to make it easy to talk to the Transloadit REST API.

We also offer transloadify that bundles much of the technology inside this SDK as a commandline utility.

Example

// Create client
options := transloadit.DefaultConfig
options.AuthKey = "TRANSLOADIT_KEY"
options.AuthSecret = "TRANSLOADIT_SECRET"
client, err := transloadit.NewClient(options)
if err != nil {
    panic(err)
}

// Initialize new assembly
assembly := client.CreateAssembly()

// Add input file to upload
assembly.AddFile("myimage", "./lol_cat.jpg")

// Add instructions, e.g. resize image to 75x75px
assembly.AddStep("resize", map[string]interface{}{
    "robot":           "/image/resize",
    "width":           75,
    "height":          75,
    "resize_strategy": "pad",
    "background":      "#000000",
})

// Wait until transloadit is done processing all uploads
// and is ready to download the results
assembly.Blocking = true

// Start the upload
info, err := assembly.Upload()
if err != nil {
    panic(err)
}

fmt.Printf("You can view the result at: %s\n", info.Results["resize"][0].Url)

For examples on how to use templates, non-blocking processing and more, take a look at examples/.

Installation

go get github.com/transloadit/go-sdk

The Go SDK requires Go 1.1 or higher.

Documentation

See Godoc.

License

MIT Licensed