TransIP API client for Go
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
colo
domain
haip
testdata
util
vps
webhosting
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
api.go
client.go
client_test.go
sign.go
sign_test.go
soap.go
soap_test.go

README.md

gotransip - TransIP API client for Go

Go Report Card Documentation

This is the Go client for the TransIP API. To use it you need an account with TransIP, enable API usage and setup a private API key.

NOTE: While the TransIP API's PHP client code is automatically generated, the Go client isn't. We try to follow the current PHP version as close as possible, but if something is not working 100% like you'd expect, please open an issue and of course: you're welcome to contribute!

Example usage

To print a list of your account's VPSes:

package main

import (
  "fmt"

  "github.com/transip/gotransip"
  "github.com/transip/gotransip/vps"
)

func main() {
  // create new TransIP API SOAP client
  c, err := gotransip.NewSOAPClient(gotransip.ClientConfig{
    AccountName: "accountname",
    PrivateKeyPath:  "/path/to/api/private.key"
  })
  if err != nil {
    panic(err.Error())
  }

  // get list of VPSes
  list, err := vps.GetVpses(c)
  if err != nil {
    panic(err.Error())
  }

  // print name and description for each VPS
  for _, v := range list {
    fmt.Printf("vps: %s (%s)\n", v.Name, v.Description)
  }
}

Documentation

For detailed descriptions of all functions, check out the TransIP API documentation. Details about the usage of the Go client can be found on godoc.org.