mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
* [docker-up] Minor fixes and add tests Tool: gitpod/catfood.gitpod.cloud * [image-builder-bob] Tests&fixes from an experimental PR Tool: gitpod/catfood.gitpod.cloud * [supervisor, ws-manager] Write docker credentials into client config file if passed into workspace Tool: gitpod/catfood.gitpod.cloud * [server] Introduce project.settings.enableDockerdAuthentication and expose it on the API Tool: gitpod/catfood.gitpod.cloud * [dashboard] Add "Docker registry authentication" toggle under projects/env vars Tool: gitpod/catfood.gitpod.cloud * [server] Guard project.settings.enableDockerdAuthentication by org write_settings permission Tool: gitpod/catfood.gitpod.cloud * review comments with cleanup + small fixes Tool: gitpod/catfood.gitpod.cloud
Golang bindings for Gitpod API
This package contains API definitions and client bindings for interacting with Gitpod API.
Usage
go get -u github.com/gitpod-io/gitpod/components/public-api/go
import (
"context"
"fmt"
"os"
"time"
"github.com/bufbuild/connect-go"
"github.com/gitpod-io/gitpod/components/public-api/go/client"
v1 "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1"
)
func ExampleListTeams() {
token := "gitpod_pat_example.personal-access-token"
gitpod, err := client.New(client.WithCredentials(token))
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to construct gitpod client %v", err)
return
}
response, err := gitpod.Teams.ListTeams(context.Background(), connect.NewRequest(&v1.ListTeamsRequest{}))
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to list teams %v", err)
return
}
fmt.Fprintf(os.Stdout, "Retrieved teams %v", response.Msg.GetTeams())
}
For more examples, see examples directory.