Skip to content

Commit 49b462a

Browse files
committed
Add an API go module for external usage.
1 parent 87d6b0d commit 49b462a

File tree

113 files changed

+5834
-4747
lines changed

Some content is hidden

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

113 files changed

+5834
-4747
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ bin
1010

1111
/cmd/phlare/data
1212
data/
13-
go.work
14-
go.work.sum
1513
.DS_Store
1614

1715
node_modules

.golangci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# options for analysis running
55
run:
6-
go: '1.18'
6+
go: "1.18"
77
# default concurrency is a available CPU number
88
concurrency: 16
99

@@ -33,9 +33,9 @@ run:
3333
# no need to include all autogenerated files, we confidently recognize
3434
# autogenerated files. If it's not please let us know.
3535
skip-files:
36-
- .*.pb.go
37-
- .*.y.go
38-
- .*.rl.go
36+
- .*.pb.go
37+
- .*.y.go
38+
- .*.rl.go
3939
# output configuration options
4040
output:
4141
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
@@ -49,7 +49,7 @@ output:
4949

5050
linters-settings:
5151
goimports:
52-
local-prefixes: github.com/grafana/phlare/pkg,github.com/grafana/phlare/tools
52+
local-prefixes: github.com/grafana/phlare/pkg,github.com/grafana/phlare/api,github.com/grafana/phlare/tools
5353

5454
depguard:
5555
list-type: blacklist

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ GORELEASER_ENV := GIT_LAST_COMMIT_DATE=$(GIT_LAST_COMMIT_DATE)
3030
# Build flags
3131
VPREFIX := github.com/grafana/phlare/pkg/util/build
3232
GO_LDFLAGS := -X $(VPREFIX).Branch=$(GIT_BRANCH) -X $(VPREFIX).Version=$(IMAGE_TAG) -X $(VPREFIX).Revision=$(GIT_REVISION) -X $(VPREFIX).BuildDate=$(GIT_LAST_COMMIT_DATE)
33-
GO_FLAGS := -ldflags "-extldflags \"-static\" -s -w $(GO_LDFLAGS)" -tags netgo -mod=mod
33+
GO_FLAGS := -ldflags "-extldflags \"-static\" -s -w $(GO_LDFLAGS)" -tags netgo
3434

3535
.PHONY: help
3636
help: ## Describe useful make targets
@@ -47,7 +47,7 @@ test: go/test ## Run unit tests
4747

4848
.PHONY: generate
4949
generate: $(BIN)/buf $(BIN)/protoc-gen-go $(BIN)/protoc-gen-go-vtproto $(BIN)/protoc-gen-openapiv2 $(BIN)/protoc-gen-grpc-gateway $(BIN)/protoc-gen-connect-go $(BIN)/protoc-gen-connect-go-mux $(BIN)/gomodifytags ## Regenerate protobuf
50-
rm -rf pkg/gen/ pkg/openapiv2/gen
50+
rm -Rf api/openapiv2/gen/ api/gen
5151
PATH=$(BIN) $(BIN)/buf generate
5252
PATH=$(BIN):$(PATH) ./tools/add-parquet-tags.sh
5353
go run ./tools/doc-generator/ ./docs/sources/operators-guide/configure/reference-configuration-parameters/index.template > docs/sources/operators-guide/configure/reference-configuration-parameters/index.md
@@ -108,7 +108,8 @@ go/lint: $(BIN)/golangci-lint
108108
.PHONY: go/mod
109109
go/mod:
110110
GO111MODULE=on go mod download
111-
GO111MODULE=on go mod verify
111+
# doesn't work for go workspace
112+
# GO111MODULE=on go mod verify
112113
GO111MODULE=on go mod tidy
113114

114115
.PHONY: fmt

proto/agent/v1/agent.proto renamed to api/agent/v1alpha1/agent.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
package agent.v1;
3+
package agent.v1alpha1;
44

55
import "google/api/annotations.proto";
66
import "google/api/field_behavior.proto";
File renamed without changes.
File renamed without changes.

pkg/gen/agent/v1/agent.pb.go renamed to api/gen/proto/go/agent/v1alpha1/agent.pb.go

Lines changed: 141 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/gen/agent/v1/agent.pb.gw.go renamed to api/gen/proto/go/agent/v1alpha1/agent.pb.gw.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/gen/agent/v1/agent_vtproto.pb.go renamed to api/gen/proto/go/agent/v1alpha1/agent_vtproto.pb.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/gen/agent/v1/agentv1connect/agent.connect.go renamed to api/gen/proto/go/agent/v1alpha1/agentv1alpha1connect/agent.connect.go

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)