import "github.com/globocom/tsuru/service" // define the service configuration serviceConfig := &service.ServiceConfig{ Name: "my-service", Type: "database", PlanName: "basic", Units: 1, } // create the service err := service.Create(context.Background(), serviceConfig) if err != nil { // handle error }
import "github.com/globocom/tsuru/service" // describe the service serviceInfo, err := service.Describe(context.Background(), "my-service") if err != nil { // handle error } // print the service info fmt.Println(serviceInfo)This example demonstrates how to describe a service using the tsuru.service package. The Describe function is called with the name of the service to describe, and the resulting service information is printed to the console. In both examples, the tsuru.service package is imported and functions are called with context.Background as the first argument, indicating that these functions are being used in a context-aware manner.