import ( "github.com/tsuru/tsuru/service" ) func createInstance() error { instance := service.ServiceInstance{ Name: "my-instance", PlanName: "basic", Provider: "aws", } err := service.Provisioner().Provision(&instance) if err != nil { return err } return nil }
import ( "github.com/tsuru/tsuru/service" ) func deleteInstance() error { instance := service.ServiceInstance{Name: "my-instance"} err := service.Provisioner().Destroy(&instance) if err != nil { return err } return nil }In this example, we delete a ServiceInstance with the name "my-instance" using the Destroy() function provided by the Provisioner. Overall, the github.com.tsuru.tsuru.service package library provides functionality for managing ServiceInstances in Tsuru, including provisioning and destroying instances with various providers.