Path: blob/main/components/public-api/go/experimental/v1/v1connect/stats.connect.go
2501 views
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-connect-go. DO NOT EDIT.5//6// Source: gitpod/experimental/v1/stats.proto78package v1connect910import (11context "context"12errors "errors"13connect_go "github.com/bufbuild/connect-go"14v1 "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1"15http "net/http"16strings "strings"17)1819// This is a compile-time assertion to ensure that this generated file and the connect package are20// compatible. If you get a compiler error that this constant is not defined, this code was21// generated with a version of connect newer than the one compiled into your binary. You can fix the22// problem by either regenerating this code with an older version of connect or updating the connect23// version compiled into your binary.24const _ = connect_go.IsAtLeastVersion0_1_02526const (27// StatsServiceName is the fully-qualified name of the StatsService service.28StatsServiceName = "gitpod.experimental.v1.StatsService"29)3031// StatsServiceClient is a client for the gitpod.experimental.v1.StatsService service.32type StatsServiceClient interface {33// Retrieves the current user stats34GetUserStats(context.Context, *connect_go.Request[v1.GetUserStatsRequest]) (*connect_go.Response[v1.GetUserStatsResponse], error)35}3637// NewStatsServiceClient constructs a client for the gitpod.experimental.v1.StatsService service. By38// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,39// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the40// connect.WithGRPC() or connect.WithGRPCWeb() options.41//42// The URL supplied here should be the base URL for the Connect or gRPC server (for example,43// http://api.acme.com or https://acme.com/grpc).44func NewStatsServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) StatsServiceClient {45baseURL = strings.TrimRight(baseURL, "/")46return &statsServiceClient{47getUserStats: connect_go.NewClient[v1.GetUserStatsRequest, v1.GetUserStatsResponse](48httpClient,49baseURL+"/gitpod.experimental.v1.StatsService/GetUserStats",50opts...,51),52}53}5455// statsServiceClient implements StatsServiceClient.56type statsServiceClient struct {57getUserStats *connect_go.Client[v1.GetUserStatsRequest, v1.GetUserStatsResponse]58}5960// GetUserStats calls gitpod.experimental.v1.StatsService.GetUserStats.61func (c *statsServiceClient) GetUserStats(ctx context.Context, req *connect_go.Request[v1.GetUserStatsRequest]) (*connect_go.Response[v1.GetUserStatsResponse], error) {62return c.getUserStats.CallUnary(ctx, req)63}6465// StatsServiceHandler is an implementation of the gitpod.experimental.v1.StatsService service.66type StatsServiceHandler interface {67// Retrieves the current user stats68GetUserStats(context.Context, *connect_go.Request[v1.GetUserStatsRequest]) (*connect_go.Response[v1.GetUserStatsResponse], error)69}7071// NewStatsServiceHandler builds an HTTP handler from the service implementation. It returns the72// path on which to mount the handler and the handler itself.73//74// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf75// and JSON codecs. They also support gzip compression.76func NewStatsServiceHandler(svc StatsServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {77mux := http.NewServeMux()78mux.Handle("/gitpod.experimental.v1.StatsService/GetUserStats", connect_go.NewUnaryHandler(79"/gitpod.experimental.v1.StatsService/GetUserStats",80svc.GetUserStats,81opts...,82))83return "/gitpod.experimental.v1.StatsService/", mux84}8586// UnimplementedStatsServiceHandler returns CodeUnimplemented from all methods.87type UnimplementedStatsServiceHandler struct{}8889func (UnimplementedStatsServiceHandler) GetUserStats(context.Context, *connect_go.Request[v1.GetUserStatsRequest]) (*connect_go.Response[v1.GetUserStatsResponse], error) {90return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.StatsService.GetUserStats is not implemented"))91}929394