import ( "github.com/globocom/tsuru/service" ) func main() { si := &service.ServiceInstance{ Name: "my-service", Plan: "basic", } err := si.Create() if err != nil { panic(err) } }
import ( "github.com/globocom/tsuru/service" ) func main() { si := &service.ServiceInstance{ Name: "my-service", } err := si.Delete() if err != nil { panic(err) } }This code deletes an existing service instance with the name "my-service" by calling its Delete() method. If any error occurs, it is panic'ed. Overall, the ServiceInstance type in the "github.com/globocom/tsuru/service" library provides a convenient way to manage service instances in Tsuru, and these examples illustrate how it can be used for common tasks like creating and deleting instances.