Skip to content

Commit 96c3fa1

Browse files
committed
init
1 parent 864214b commit 96c3fa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+8003
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typescript-rest/lib/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
packages:
2+
- name: proto
3+
type: generic
4+
srcs:
5+
- "*.proto"
6+
- "third_party/**/*.proto"
7+
config:
8+
commands:
9+
- ["echo"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
if [ -n "$DEBUG" ]; then
4+
set -x
5+
fi
6+
7+
set -o errexit
8+
set -o nounset
9+
set -o pipefail
10+
11+
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../../../../
12+
COMPONENTS_DIR=$ROOT_DIR/components
13+
14+
# include protoc bash functions
15+
# shellcheck disable=SC1090,SC1091
16+
source "$ROOT_DIR"/scripts/protoc-generator.sh
17+
18+
THIRD_PARTY_INCLUDES=${PROTOLOC:-$PWD/third_party}
19+
if [ ! -d "$THIRD_PARTY_INCLUDES"/google/api ]; then
20+
echo "missing $THIRD_PARTY_INCLUDES/google/api"
21+
exit 1
22+
fi
23+
24+
# TODO (aledbf): refactor to avoid duplication
25+
local_go_protoc() {
26+
local ROOT_DIR=$1
27+
# shellcheck disable=2035
28+
protoc \
29+
-I/usr/lib/protoc/include -I"$COMPONENTS_DIR" -I. -I"$THIRD_PARTY_INCLUDES" \
30+
--go_out=go \
31+
--go_opt=paths=source_relative \
32+
--go-grpc_out=go \
33+
--go-grpc_opt=paths=source_relative \
34+
*.proto
35+
}
36+
37+
go_protoc_gateway() {
38+
# shellcheck disable=2035
39+
protoc \
40+
-I/usr/lib/protoc/include -I"$COMPONENTS_DIR" -I. -I"$THIRD_PARTY_INCLUDES" \
41+
--grpc-gateway_out=logtostderr=true,paths=source_relative:go \
42+
*.proto
43+
}
44+
45+
local_java_protoc() {
46+
protoc \
47+
-I /usr/lib/protoc/include -I"$COMPONENTS_DIR" -I. -I"$THIRD_PARTY_INCLUDES" \
48+
--plugin=protoc-gen-grpc-java=/tmp/protoc-gen-grpc-java \
49+
--grpc-java_out=java/src/main/java \
50+
--java_out=java/src/main/java \
51+
./*.proto
52+
# remove trailing spaces
53+
find "$COMPONENTS_DIR"/ide-proxy/components/ide-metrics-api/java/src/main/java/io/gitpod/ide_metrics/api -maxdepth 1 -name "*.java" -exec sed -i -e "s/[[:space:]]*$//" {} \;
54+
}
55+
56+
install_dependencies
57+
local_go_protoc "$COMPONENTS_DIR"
58+
go_protoc_gateway "$COMPONENTS_DIR"
59+
local_java_protoc "$COMPONENTS_DIR"
60+
update_license
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/gitpod-io/generated_code_dependencies
2+
3+
go 1.18

components/ide-proxy/components/ide-metrics-api/go.sum

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
packages:
2+
- name: lib
3+
type: go
4+
srcs:
5+
- "**/*.go"
6+
- "go.mod"
7+
- "go.sum"
8+
config:
9+
packaging: library
10+
dontTest: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License-AGPL.txt in the project root for license information.
4+
5+
package config
6+
7+
import (
8+
"github.com/gitpod-io/gitpod/common-go/grpc"
9+
)
10+
11+
type ServiceConfiguration struct {
12+
Server struct {
13+
Port int `json:"port"`
14+
// TLS struct {
15+
// CA string `json:"ca"`
16+
// Certificate string `json:"crt"`
17+
// PrivateKey string `json:"key"`
18+
// } `json:"tls"`
19+
RateLimits map[string]grpc.RateLimit `json:"ratelimits"`
20+
} `json:"server"`
21+
22+
PProf struct {
23+
Addr string `json:"addr"`
24+
} `json:"pprof"`
25+
26+
Prometheus struct {
27+
Addr string `json:"addr"`
28+
} `json:"prometheus"`
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module github.com/gitpod-io/gitpod/ide-metrics-api
2+
3+
go 1.18
4+
5+
require (
6+
github.com/gitpod-io/gitpod/common-go v0.0.0-00010101000000-000000000000
7+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
8+
google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced
9+
google.golang.org/grpc v1.45.0
10+
google.golang.org/protobuf v1.28.0
11+
)
12+
13+
require (
14+
github.com/golang/protobuf v1.5.2 // indirect
15+
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
16+
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
17+
golang.org/x/text v0.3.5 // indirect
18+
)
19+
20+
replace github.com/gitpod-io/gitpod/common-go => ../../../../common-go // leeway

components/ide-proxy/components/ide-metrics-api/go/go.sum

+412
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)