package main import ( "fmt" "github.com/tsuru/tsuru-client/tsuru/app" ) func main() { appName := "my_app" appPlatform := "ruby" result, err := app.Create(appName, appPlatform, nil) if err != nil { panic(err) } fmt.Printf("Created app %s\n", result.Name) }
package main import ( "fmt" "github.com/tsuru/tsuru-client/tsuru/app" ) func main() { appName := "my_app" imageData := []byte("docker image data") result, err := app.Deploy(appName, imageData) if err != nil { panic(err) } fmt.Printf("Deployed app %s using image %s\n", result.Name, result.Image) }
package main import ( "fmt" "github.com/tsuru/tsuru-client/tsuru/app" ) func main() { appName := "my_app" numUnits := 5 result, err := app.Scale(appName, numUnits) if err != nil { panic(err) } fmt.Printf("Scaled app %s to %d units\n", result.Name, result.Units) }In summary, the go github.com.tsuru.tsuru.service Service package is a library that provides a wide range of services for managing tsuru applications, including creating new apps, deploying apps, scaling apps, and more.