Go DeployGate is a Golang API client for interacting with most facets of the DeployGate API.
This is a client library, so there is nothing to install.
Download the library into your $GOPATH
:
$ go get github.com/recruit-mp/go-deploygate
Import the library into your tool:
import "github.com/recruit-mp/go-deploygate"
DeployGate's API is designed to work in the following manner:
- Create (or clone) a new configuration version for the service
- Make any changes to the version
- Validate the version
- Activate the version
This flow using the Golang client looks like this:
// Create a client object. The client has no state, so it can be persisted
// and re-used. It is also safe to use concurrently due to its lack of state.
// There is also a DefaultClient() method that reads an environment variable.
// Please see the documentation for more information and details.
client, err := deploygate.NewClient("YOUR_DEPLOYGATE_API_KEY")
// Get users who collaborate with your App
g := &deploygate.GetAppCollaboratorInput{
Owner: "owner-name",
Platform: "ios", // ios or android
AppId: "your.app.id",
}
// Add collaborator to your App
collaborator, err := client.GetAppCollaborator(g)
a := &deploygate.AddAppCollaboratorInput{
Owner: "owner-name",
Platform: "ios",
AppId: "your.app.id",
Users: "username",
Role: 2, //`1`(for developer) or `2`(for tester)
}
addResponse, err2 := client.AddAppCollaborator(a)
// Delete collaborator from your App
d := &deploygate.DeleteAppCollaboratorInput{
Owner: "owner-name",
Platform: "ios",
AppId: "your.app.id",
Users: "username",
Role: 2, //`1`(for developer) or `2`(for tester)
}
deleteResponse, err3 := client.DeleteAppCollaborator(d)
More information can be found in the DeployGate Godoc.
- Support following DeployGate API:
- [ ]: App Upload API
- Copyright 2016 Naoki Ainoya, Recruit Marketing Partners Co., Ltd., Apache License, Version 2.0
- This base client implementation is copied from sethvargo/go-fastly which is licensed as Copyright 2015 Seth Vargo, Apache Lisense, Version 2.0