package main import ( "github.com.globocom.tsuru.service" ) func main() { auth := service.NewAuthenticationService() token, err := auth.Login("username", "password") if err != nil { // handle error } // use token for future requests }
package main import ( "github.com.globocom.tsuru.service" ) func main() { dataStore := service.NewDataStorageService() err := dataStore.Save("key", "value") if err != nil { // handle error } value, err := dataStore.Get("key") if err != nil { // handle error } // use value }Both examples illustrate how the Service package can be used to quickly and easily define services in Go that can be integrated with other parts of a larger application.