mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
24 lines
697 B
Go
24 lines
697 B
Go
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
// Licensed under the GNU Affero General Public License (AGPL).
|
|
// See License-AGPL.txt in the project root for license information.
|
|
|
|
package supervisor_helper
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/gitpod-io/gitpod/supervisor/api"
|
|
supervisor "github.com/gitpod-io/gitpod/supervisor/api"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func FetchInfo(ctx context.Context, conn *grpc.ClientConn) (*api.WorkspaceInfoResponse, error) {
|
|
wsInfo, err := supervisor.NewInfoServiceClient(conn).WorkspaceInfo(ctx, &supervisor.WorkspaceInfoRequest{})
|
|
if err != nil {
|
|
return nil, fmt.Errorf("failed to retrieve workspace info: %w", err)
|
|
}
|
|
|
|
return wsInfo, nil
|
|
}
|