sessionID := os.Getenv("SESSION_ID")
client, err := storage.NewClient(storage.Options{
Key: os.Getenv("PIERRE_PRIVATE_KEY"),
Name: "acme",
})
ctx := context.Background()
repositoryID := "acme/storefront"
repo, err := client.FindOne(ctx, storage.FindOneOptions{ID: repositoryID})
sessionBranch := fmt.Sprintf("sessions/%s", sessionID)
ephemeral := true
view, err := repo.GetBranchDiff(ctx, storage.GetBranchDiffOptions{
Base: repo.DefaultBranch,
Branch: sessionBranch,
Ephemeral: &ephemeral,
})
fmt.Println(view.Stats)
fmt.Println(view.Files)