You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/04/01 06:21:31 UTC
[skywalking-goapi] branch main updated: Add query protocol and
documentation (#3)
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-goapi.git
The following commit(s) were added to refs/heads/main by this push:
new a049ca1 Add query protocol and documentation (#3)
a049ca1 is described below
commit a049ca15c62db6388d37dbdfde96bd741d9f074f
Author: Zhenxu Ke <ke...@apache.org>
AuthorDate: Thu Apr 1 14:21:22 2021 +0800
Add query protocol and documentation (#3)
---
.github/workflows/build.yaml | 2 +-
Makefile | 30 +
README.md | 66 ++
go.mod | 2 +
go.sum | 67 +-
gqlgen.yml | 31 +
query/schema.go | 1206 +++++++++++++++++++++
scripts/update.sh | 39 +-
scripts/{update.sh => update_collect_protocol.sh} | 0
scripts/{update.sh => update_query_protocol.sh} | 26 +-
10 files changed, 1414 insertions(+), 55 deletions(-)
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 043daeb..a140aff 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -35,4 +35,4 @@ jobs:
go-version: 1.16
- name: Build
- run: bash scripts/update.sh
+ run: make
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..05a624d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+default: update
+
+.PHONY: update-collect
+update-collect:
+ bash scripts/update_collect_protocol.sh
+
+.PHONY: update-query
+update-query:
+ bash scripts/update_query_protocol.sh
+
+.PHONY: update
+update:
+ bash scripts/update.sh
diff --git a/README.md b/README.md
index d58c323..f327b1a 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,69 @@
This repository contains the Go files generated from
the [data collect protocol](http://github.com/apache/skywalking-data-collect-protocol) and
the [query protocol](http://github.com/apache/skywalking-query-protocol) for convenient use.
+
+You can use the following commands to install this module.
+
+```shell
+go get skywalking.apache.org/repo/goapi
+```
+
+## Data Collect Protocol
+
+To use the Go files generated from
+the [data collect protocol](http://github.com/apache/skywalking-data-collect-protocol), use the import
+path `skywalking.apache.org/repo/goapi/collect`, for example,
+
+```go
+package main
+
+import (
+ "fmt"
+
+ "skywalking.apache.org/repo/goapi/collect/event/v3"
+)
+
+func main() {
+ event := &v3.Event{
+ Uuid: "",
+ Source: nil,
+ Name: "",
+ Type: 0,
+ Message: "",
+ Parameters: nil,
+ StartTime: 0,
+ EndTime: 0,
+ }
+
+ fmt.Printf("+%v", event)
+}
+```
+
+## Query Protocol
+
+To use the Go files generated from the [query protocol](http://github.com/apache/skywalking-query-protocol), use the
+import path `skywalking.apache.org/repo/goapi/query`, for example,
+
+```go
+package main
+
+import (
+ "fmt"
+
+ "skywalking.apache.org/repo/goapi/query"
+)
+
+func main() {
+ events := query.Events{
+ Events: nil,
+ Total: 0,
+ }
+
+ fmt.Printf("+%v", events)
+}
+```
+
+## Development
+
+To update this repo, update the commit sha in the `dependencies.sh` file, and run `make` to regenerate the Go files,
+then commit and open a pull request.
diff --git a/go.mod b/go.mod
index 67bea9a..a6c4bd0 100644
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,8 @@ module skywalking.apache.org/repo/goapi
go 1.16
require (
+ github.com/99designs/gqlgen v0.13.0
+ github.com/vektah/gqlparser/v2 v2.1.0
google.golang.org/grpc v1.36.1
google.golang.org/protobuf v1.26.0
)
diff --git a/go.sum b/go.sum
index 6ee6f61..a50ffb7 100644
--- a/go.sum
+++ b/go.sum
@@ -1,13 +1,29 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/99designs/gqlgen v0.13.0 h1:haLTcUp3Vwp80xMVEg5KRNwzfUrgFdRmtBY8fuB8scA=
+github.com/99designs/gqlgen v0.13.0/go.mod h1:NV130r6f4tpRWuAI+zsrSdooO/eWUv+Gyyoi3rEfXIk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
+github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0=
+github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs=
+github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
+github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
+github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
+github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c h1:TUuUh0Xgj97tLMNtWtNvI9mIV6isjEb9lBMNv+77IGM=
+github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
+github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -29,33 +45,75 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
+github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ=
+github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
+github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
+github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
+github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
+github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
+github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
+github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
+github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
+github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
+github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U=
+github.com/vektah/gqlparser/v2 v2.1.0 h1:uiKJ+T5HMGGQM2kRKQ8Pxw8+Zq9qhhZhz/lieYvCMns=
+github.com/vektah/gqlparser/v2 v2.1.0/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
@@ -83,6 +141,11 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
+sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k=
diff --git a/gqlgen.yml b/gqlgen.yml
new file mode 100644
index 0000000..e8fa97d
--- /dev/null
+++ b/gqlgen.yml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+schema: temp/query-protocol/*.graphqls
+
+skip_validation: true
+
+exec:
+ filename: temp/ignored.go
+ package: query
+
+model:
+ filename: query/schema.go
+ package: query
+
+models:
+ Long:
+ model: github.com/99designs/gqlgen/graphql.Int64
diff --git a/query/schema.go b/query/schema.go
new file mode 100644
index 0000000..2cf2d65
--- /dev/null
+++ b/query/schema.go
@@ -0,0 +1,1206 @@
+// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
+
+package query
+
+import (
+ "fmt"
+ "io"
+ "strconv"
+)
+
+type AlarmMessage struct {
+ StartTime int64 `json:"startTime"`
+ Scope *Scope `json:"scope"`
+ ID string `json:"id"`
+ Message string `json:"message"`
+}
+
+type AlarmTrend struct {
+ NumOfAlarm []*int `json:"numOfAlarm"`
+}
+
+type Alarms struct {
+ Msgs []*AlarmMessage `json:"msgs"`
+ Total int `json:"total"`
+}
+
+type Attribute struct {
+ Name string `json:"name"`
+ Value string `json:"value"`
+}
+
+type BasicTrace struct {
+ SegmentID string `json:"segmentId"`
+ EndpointNames []string `json:"endpointNames"`
+ Duration int `json:"duration"`
+ Start string `json:"start"`
+ IsError *bool `json:"isError"`
+ TraceIds []string `json:"traceIds"`
+}
+
+type BatchMetricConditions struct {
+ Name string `json:"name"`
+ Ids []string `json:"ids"`
+}
+
+type BrowserErrorLog struct {
+ Service string `json:"service"`
+ ServiceVersion string `json:"serviceVersion"`
+ Time int64 `json:"time"`
+ PagePath string `json:"pagePath"`
+ Category ErrorCategory `json:"category"`
+ Grade *string `json:"grade"`
+ Message *string `json:"message"`
+ Line *int `json:"line"`
+ Col *int `json:"col"`
+ Stack *string `json:"stack"`
+ ErrorURL *string `json:"errorUrl"`
+ FirstReportedError bool `json:"firstReportedError"`
+}
+
+type BrowserErrorLogQueryCondition struct {
+ ServiceID *string `json:"serviceId"`
+ ServiceVersionID *string `json:"serviceVersionId"`
+ PagePathID *string `json:"pagePathId"`
+ PagePath *string `json:"pagePath"`
+ Category *ErrorCategory `json:"category"`
+ QueryDuration *Duration `json:"queryDuration"`
+ Paging *Pagination `json:"paging"`
+}
+
+type BrowserErrorLogs struct {
+ Logs []*BrowserErrorLog `json:"logs"`
+ Total int `json:"total"`
+}
+
+type Bucket struct {
+ Min string `json:"min"`
+ Max string `json:"max"`
+}
+
+type Call struct {
+ Source string `json:"source"`
+ SourceComponents []string `json:"sourceComponents"`
+ Target string `json:"target"`
+ TargetComponents []string `json:"targetComponents"`
+ ID string `json:"id"`
+ DetectPoints []DetectPoint `json:"detectPoints"`
+}
+
+type ClusterBrief struct {
+ NumOfService int `json:"numOfService"`
+ NumOfEndpoint int `json:"numOfEndpoint"`
+ NumOfDatabase int `json:"numOfDatabase"`
+ NumOfCache int `json:"numOfCache"`
+ NumOfMq int `json:"numOfMQ"`
+}
+
+type DashboardConfiguration struct {
+ Name string `json:"name"`
+ Type TemplateType `json:"type"`
+ Configuration string `json:"configuration"`
+ Activated bool `json:"activated"`
+ Disabled bool `json:"disabled"`
+}
+
+type DashboardSetting struct {
+ Name string `json:"name"`
+ Type TemplateType `json:"type"`
+ Configuration string `json:"configuration"`
+ Active bool `json:"active"`
+}
+
+type Database struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Type string `json:"type"`
+}
+
+type Duration struct {
+ Start string `json:"start"`
+ End string `json:"end"`
+ Step Step `json:"step"`
+}
+
+type Endpoint struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+}
+
+type EndpointInfo struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ ServiceID string `json:"serviceId"`
+ ServiceName string `json:"serviceName"`
+}
+
+type EndpointNode struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ ServiceID string `json:"serviceId"`
+ ServiceName string `json:"serviceName"`
+ Type *string `json:"type"`
+ IsReal bool `json:"isReal"`
+}
+
+type EndpointTopology struct {
+ Nodes []*EndpointNode `json:"nodes"`
+ Calls []*Call `json:"calls"`
+}
+
+type Entity struct {
+ Scope Scope `json:"scope"`
+ ServiceName *string `json:"serviceName"`
+ Normal *bool `json:"normal"`
+ ServiceInstanceName *string `json:"serviceInstanceName"`
+ EndpointName *string `json:"endpointName"`
+ DestServiceName *string `json:"destServiceName"`
+ DestNormal *bool `json:"destNormal"`
+ DestServiceInstanceName *string `json:"destServiceInstanceName"`
+ DestEndpointName *string `json:"destEndpointName"`
+}
+
+type Event struct {
+ UUID string `json:"uuid"`
+ Source *Source `json:"source"`
+ Name string `json:"name"`
+ Type EventType `json:"type"`
+ Message *string `json:"message"`
+ Parameters []*KeyValue `json:"parameters"`
+ StartTime int64 `json:"startTime"`
+ EndTime *int64 `json:"endTime"`
+}
+
+type EventQueryCondition struct {
+ UUID *string `json:"uuid"`
+ Source *SourceInput `json:"source"`
+ Name *string `json:"name"`
+ Type *EventType `json:"type"`
+ Time *Duration `json:"time"`
+ Order *Order `json:"order"`
+ Size *int `json:"size"`
+}
+
+type Events struct {
+ Events []*Event `json:"events"`
+ Total int `json:"total"`
+}
+
+type HealthStatus struct {
+ Score int `json:"score"`
+ Details *string `json:"details"`
+}
+
+type HeatMap struct {
+ Values []*HeatMapColumn `json:"values"`
+ Buckets []*Bucket `json:"buckets"`
+}
+
+type HeatMapColumn struct {
+ ID string `json:"id"`
+ Values []int64 `json:"values"`
+}
+
+type IntValues struct {
+ Values []*KVInt `json:"values"`
+}
+
+type KVInt struct {
+ ID string `json:"id"`
+ Value int64 `json:"value"`
+}
+
+type KeyValue struct {
+ Key string `json:"key"`
+ Value *string `json:"value"`
+}
+
+type Log struct {
+ ServiceName *string `json:"serviceName"`
+ ServiceID *string `json:"serviceId"`
+ ServiceInstanceName *string `json:"serviceInstanceName"`
+ ServiceInstanceID *string `json:"serviceInstanceId"`
+ EndpointName *string `json:"endpointName"`
+ EndpointID *string `json:"endpointId"`
+ TraceID *string `json:"traceId"`
+ Timestamp int64 `json:"timestamp"`
+ ContentType ContentType `json:"contentType"`
+ Content *string `json:"content"`
+ Tags []*KeyValue `json:"tags"`
+}
+
+type LogEntity struct {
+ Time int64 `json:"time"`
+ Data []*KeyValue `json:"data"`
+}
+
+type LogQueryCondition struct {
+ ServiceID *string `json:"serviceId"`
+ ServiceInstanceID *string `json:"serviceInstanceId"`
+ EndpointID *string `json:"endpointId"`
+ EndpointName *string `json:"endpointName"`
+ RelatedTrace *TraceScopeCondition `json:"relatedTrace"`
+ QueryDuration *Duration `json:"queryDuration"`
+ Paging *Pagination `json:"paging"`
+ Tags []*LogTag `json:"tags"`
+ KeywordsOfContent []string `json:"keywordsOfContent"`
+ ExcludingKeywordsOfContent []string `json:"excludingKeywordsOfContent"`
+ QueryOrder *Order `json:"queryOrder"`
+}
+
+type LogTag struct {
+ Key string `json:"key"`
+ Value *string `json:"value"`
+}
+
+type Logs struct {
+ Logs []*Log `json:"logs"`
+ Total int `json:"total"`
+}
+
+type MetricCondition struct {
+ Name string `json:"name"`
+ ID *string `json:"id"`
+}
+
+type MetricDefinition struct {
+ Name string `json:"name"`
+ Type MetricsType `json:"type"`
+ Catalog *string `json:"catalog"`
+}
+
+type MetricsCondition struct {
+ Name string `json:"name"`
+ Entity *Entity `json:"entity"`
+}
+
+type MetricsValues struct {
+ Label *string `json:"label"`
+ Values *IntValues `json:"values"`
+}
+
+type Node struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Type *string `json:"type"`
+ IsReal bool `json:"isReal"`
+}
+
+type Pagination struct {
+ PageNum *int `json:"pageNum"`
+ PageSize int `json:"pageSize"`
+ NeedTotal *bool `json:"needTotal"`
+}
+
+type ProfileAnalyzation struct {
+ Tip *string `json:"tip"`
+ Trees []*ProfileStackTree `json:"trees"`
+}
+
+type ProfileAnalyzeTimeRange struct {
+ Start int64 `json:"start"`
+ End int64 `json:"end"`
+}
+
+type ProfileStackElement struct {
+ ID string `json:"id"`
+ ParentID string `json:"parentId"`
+ CodeSignature string `json:"codeSignature"`
+ Duration int `json:"duration"`
+ DurationChildExcluded int `json:"durationChildExcluded"`
+ Count int `json:"count"`
+}
+
+type ProfileStackTree struct {
+ Elements []*ProfileStackElement `json:"elements"`
+}
+
+type ProfileTask struct {
+ ID string `json:"id"`
+ ServiceID string `json:"serviceId"`
+ ServiceName string `json:"serviceName"`
+ EndpointName string `json:"endpointName"`
+ StartTime int64 `json:"startTime"`
+ Duration int `json:"duration"`
+ MinDurationThreshold int `json:"minDurationThreshold"`
+ DumpPeriod int `json:"dumpPeriod"`
+ MaxSamplingCount int `json:"maxSamplingCount"`
+ Logs []*ProfileTaskLog `json:"logs"`
+}
+
+type ProfileTaskCreationRequest struct {
+ ServiceID string `json:"serviceId"`
+ EndpointName string `json:"endpointName"`
+ StartTime *int64 `json:"startTime"`
+ Duration int `json:"duration"`
+ MinDurationThreshold int `json:"minDurationThreshold"`
+ DumpPeriod int `json:"dumpPeriod"`
+ MaxSamplingCount int `json:"maxSamplingCount"`
+}
+
+type ProfileTaskCreationResult struct {
+ ErrorReason *string `json:"errorReason"`
+ ID *string `json:"id"`
+}
+
+type ProfileTaskLog struct {
+ ID string `json:"id"`
+ InstanceID string `json:"instanceId"`
+ InstanceName string `json:"instanceName"`
+ OperationType ProfileTaskLogOperationType `json:"operationType"`
+ OperationTime int64 `json:"operationTime"`
+}
+
+type ProfiledSegment struct {
+ Spans []*ProfiledSpan `json:"spans"`
+}
+
+type ProfiledSpan struct {
+ SpanID int `json:"spanId"`
+ ParentSpanID int `json:"parentSpanId"`
+ ServiceCode string `json:"serviceCode"`
+ ServiceInstanceName string `json:"serviceInstanceName"`
+ StartTime int64 `json:"startTime"`
+ EndTime int64 `json:"endTime"`
+ EndpointName *string `json:"endpointName"`
+ Type string `json:"type"`
+ Peer *string `json:"peer"`
+ Component *string `json:"component"`
+ IsError *bool `json:"isError"`
+ Layer *string `json:"layer"`
+ Tags []*KeyValue `json:"tags"`
+ Logs []*LogEntity `json:"logs"`
+}
+
+type Ref struct {
+ TraceID string `json:"traceId"`
+ ParentSegmentID string `json:"parentSegmentId"`
+ ParentSpanID int `json:"parentSpanId"`
+ Type RefType `json:"type"`
+}
+
+type SelectedRecord struct {
+ Name string `json:"name"`
+ ID string `json:"id"`
+ Value *string `json:"value"`
+ RefID *string `json:"refId"`
+}
+
+type Service struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Group string `json:"group"`
+}
+
+type ServiceInstance struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Attributes []*Attribute `json:"attributes"`
+ Language Language `json:"language"`
+ InstanceUUID string `json:"instanceUUID"`
+}
+
+type ServiceInstanceNode struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ ServiceID string `json:"serviceId"`
+ ServiceName string `json:"serviceName"`
+ Type *string `json:"type"`
+ IsReal bool `json:"isReal"`
+}
+
+type ServiceInstanceTopology struct {
+ Nodes []*ServiceInstanceNode `json:"nodes"`
+ Calls []*Call `json:"calls"`
+}
+
+type Source struct {
+ Service *string `json:"service"`
+ ServiceInstance *string `json:"serviceInstance"`
+ Endpoint *string `json:"endpoint"`
+}
+
+type SourceInput struct {
+ Service *string `json:"service"`
+ ServiceInstance *string `json:"serviceInstance"`
+ Endpoint *string `json:"endpoint"`
+}
+
+type Span struct {
+ TraceID string `json:"traceId"`
+ SegmentID string `json:"segmentId"`
+ SpanID int `json:"spanId"`
+ ParentSpanID int `json:"parentSpanId"`
+ Refs []*Ref `json:"refs"`
+ ServiceCode string `json:"serviceCode"`
+ ServiceInstanceName string `json:"serviceInstanceName"`
+ StartTime int64 `json:"startTime"`
+ EndTime int64 `json:"endTime"`
+ EndpointName *string `json:"endpointName"`
+ Type string `json:"type"`
+ Peer *string `json:"peer"`
+ Component *string `json:"component"`
+ IsError *bool `json:"isError"`
+ Layer *string `json:"layer"`
+ Tags []*KeyValue `json:"tags"`
+ Logs []*LogEntity `json:"logs"`
+}
+
+type SpanTag struct {
+ Key string `json:"key"`
+ Value *string `json:"value"`
+}
+
+type TemplateChangeStatus struct {
+ Status bool `json:"status"`
+ Message *string `json:"message"`
+}
+
+type Thermodynamic struct {
+ Nodes [][]*int `json:"nodes"`
+ AxisYStep int `json:"axisYStep"`
+}
+
+type TimeInfo struct {
+ Timezone *string `json:"timezone"`
+ CurrentTimestamp *int64 `json:"currentTimestamp"`
+}
+
+type TopNCondition struct {
+ Name string `json:"name"`
+ ParentService *string `json:"parentService"`
+ Normal *bool `json:"normal"`
+ Scope *Scope `json:"scope"`
+ TopN int `json:"topN"`
+ Order Order `json:"order"`
+}
+
+type TopNEntity struct {
+ Name string `json:"name"`
+ ID string `json:"id"`
+ Value int64 `json:"value"`
+}
+
+type TopNRecord struct {
+ Statement *string `json:"statement"`
+ Latency int64 `json:"latency"`
+ TraceID *string `json:"traceId"`
+}
+
+type TopNRecordsCondition struct {
+ ServiceID string `json:"serviceId"`
+ MetricName string `json:"metricName"`
+ TopN int `json:"topN"`
+ Order Order `json:"order"`
+ Duration *Duration `json:"duration"`
+}
+
+type Topology struct {
+ Nodes []*Node `json:"nodes"`
+ Calls []*Call `json:"calls"`
+}
+
+type Trace struct {
+ Spans []*Span `json:"spans"`
+}
+
+type TraceBrief struct {
+ Traces []*BasicTrace `json:"traces"`
+ Total int `json:"total"`
+}
+
+type TraceQueryCondition struct {
+ ServiceID *string `json:"serviceId"`
+ ServiceInstanceID *string `json:"serviceInstanceId"`
+ TraceID *string `json:"traceId"`
+ EndpointID *string `json:"endpointId"`
+ EndpointName *string `json:"endpointName"`
+ QueryDuration *Duration `json:"queryDuration"`
+ MinTraceDuration *int `json:"minTraceDuration"`
+ MaxTraceDuration *int `json:"maxTraceDuration"`
+ TraceState TraceState `json:"traceState"`
+ QueryOrder QueryOrder `json:"queryOrder"`
+ Tags []*SpanTag `json:"tags"`
+ Paging *Pagination `json:"paging"`
+}
+
+type TraceScopeCondition struct {
+ TraceID string `json:"traceId"`
+ SegmentID *string `json:"segmentId"`
+ SpanID *int `json:"spanId"`
+}
+
+type ContentType string
+
+const (
+ ContentTypeText ContentType = "TEXT"
+ ContentTypeJSON ContentType = "JSON"
+ ContentTypeYaml ContentType = "YAML"
+)
+
+var AllContentType = []ContentType{
+ ContentTypeText,
+ ContentTypeJSON,
+ ContentTypeYaml,
+}
+
+func (e ContentType) IsValid() bool {
+ switch e {
+ case ContentTypeText, ContentTypeJSON, ContentTypeYaml:
+ return true
+ }
+ return false
+}
+
+func (e ContentType) String() string {
+ return string(e)
+}
+
+func (e *ContentType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = ContentType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid ContentType", str)
+ }
+ return nil
+}
+
+func (e ContentType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type DetectPoint string
+
+const (
+ DetectPointClient DetectPoint = "CLIENT"
+ DetectPointServer DetectPoint = "SERVER"
+ DetectPointProxy DetectPoint = "PROXY"
+)
+
+var AllDetectPoint = []DetectPoint{
+ DetectPointClient,
+ DetectPointServer,
+ DetectPointProxy,
+}
+
+func (e DetectPoint) IsValid() bool {
+ switch e {
+ case DetectPointClient, DetectPointServer, DetectPointProxy:
+ return true
+ }
+ return false
+}
+
+func (e DetectPoint) String() string {
+ return string(e)
+}
+
+func (e *DetectPoint) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = DetectPoint(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid DetectPoint", str)
+ }
+ return nil
+}
+
+func (e DetectPoint) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type ErrorCategory string
+
+const (
+ ErrorCategoryAll ErrorCategory = "ALL"
+ ErrorCategoryAjax ErrorCategory = "AJAX"
+ ErrorCategoryResource ErrorCategory = "RESOURCE"
+ ErrorCategoryVue ErrorCategory = "VUE"
+ ErrorCategoryPromise ErrorCategory = "PROMISE"
+ ErrorCategoryJs ErrorCategory = "JS"
+ ErrorCategoryUnknown ErrorCategory = "UNKNOWN"
+)
+
+var AllErrorCategory = []ErrorCategory{
+ ErrorCategoryAll,
+ ErrorCategoryAjax,
+ ErrorCategoryResource,
+ ErrorCategoryVue,
+ ErrorCategoryPromise,
+ ErrorCategoryJs,
+ ErrorCategoryUnknown,
+}
+
+func (e ErrorCategory) IsValid() bool {
+ switch e {
+ case ErrorCategoryAll, ErrorCategoryAjax, ErrorCategoryResource, ErrorCategoryVue, ErrorCategoryPromise, ErrorCategoryJs, ErrorCategoryUnknown:
+ return true
+ }
+ return false
+}
+
+func (e ErrorCategory) String() string {
+ return string(e)
+}
+
+func (e *ErrorCategory) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = ErrorCategory(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid ErrorCategory", str)
+ }
+ return nil
+}
+
+func (e ErrorCategory) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type EventType string
+
+const (
+ EventTypeNormal EventType = "Normal"
+ EventTypeError EventType = "Error"
+)
+
+var AllEventType = []EventType{
+ EventTypeNormal,
+ EventTypeError,
+}
+
+func (e EventType) IsValid() bool {
+ switch e {
+ case EventTypeNormal, EventTypeError:
+ return true
+ }
+ return false
+}
+
+func (e EventType) String() string {
+ return string(e)
+}
+
+func (e *EventType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = EventType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid EventType", str)
+ }
+ return nil
+}
+
+func (e EventType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type Language string
+
+const (
+ LanguageUnknown Language = "UNKNOWN"
+ LanguageJava Language = "JAVA"
+ LanguageDotnet Language = "DOTNET"
+ LanguageNodejs Language = "NODEJS"
+ LanguagePython Language = "PYTHON"
+ LanguageRuby Language = "RUBY"
+ LanguageGo Language = "GO"
+ LanguageLua Language = "LUA"
+ LanguagePhp Language = "PHP"
+)
+
+var AllLanguage = []Language{
+ LanguageUnknown,
+ LanguageJava,
+ LanguageDotnet,
+ LanguageNodejs,
+ LanguagePython,
+ LanguageRuby,
+ LanguageGo,
+ LanguageLua,
+ LanguagePhp,
+}
+
+func (e Language) IsValid() bool {
+ switch e {
+ case LanguageUnknown, LanguageJava, LanguageDotnet, LanguageNodejs, LanguagePython, LanguageRuby, LanguageGo, LanguageLua, LanguagePhp:
+ return true
+ }
+ return false
+}
+
+func (e Language) String() string {
+ return string(e)
+}
+
+func (e *Language) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = Language(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid Language", str)
+ }
+ return nil
+}
+
+func (e Language) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type MetricsType string
+
+const (
+ MetricsTypeUnknown MetricsType = "UNKNOWN"
+ MetricsTypeRegularValue MetricsType = "REGULAR_VALUE"
+ MetricsTypeLabeledValue MetricsType = "LABELED_VALUE"
+ MetricsTypeHeatmap MetricsType = "HEATMAP"
+ MetricsTypeSampledRecord MetricsType = "SAMPLED_RECORD"
+)
+
+var AllMetricsType = []MetricsType{
+ MetricsTypeUnknown,
+ MetricsTypeRegularValue,
+ MetricsTypeLabeledValue,
+ MetricsTypeHeatmap,
+ MetricsTypeSampledRecord,
+}
+
+func (e MetricsType) IsValid() bool {
+ switch e {
+ case MetricsTypeUnknown, MetricsTypeRegularValue, MetricsTypeLabeledValue, MetricsTypeHeatmap, MetricsTypeSampledRecord:
+ return true
+ }
+ return false
+}
+
+func (e MetricsType) String() string {
+ return string(e)
+}
+
+func (e *MetricsType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = MetricsType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid MetricsType", str)
+ }
+ return nil
+}
+
+func (e MetricsType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type NodeType string
+
+const (
+ NodeTypeService NodeType = "SERVICE"
+ NodeTypeEndpoint NodeType = "ENDPOINT"
+ NodeTypeUser NodeType = "USER"
+)
+
+var AllNodeType = []NodeType{
+ NodeTypeService,
+ NodeTypeEndpoint,
+ NodeTypeUser,
+}
+
+func (e NodeType) IsValid() bool {
+ switch e {
+ case NodeTypeService, NodeTypeEndpoint, NodeTypeUser:
+ return true
+ }
+ return false
+}
+
+func (e NodeType) String() string {
+ return string(e)
+}
+
+func (e *NodeType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = NodeType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid NodeType", str)
+ }
+ return nil
+}
+
+func (e NodeType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type Order string
+
+const (
+ OrderAsc Order = "ASC"
+ OrderDes Order = "DES"
+)
+
+var AllOrder = []Order{
+ OrderAsc,
+ OrderDes,
+}
+
+func (e Order) IsValid() bool {
+ switch e {
+ case OrderAsc, OrderDes:
+ return true
+ }
+ return false
+}
+
+func (e Order) String() string {
+ return string(e)
+}
+
+func (e *Order) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = Order(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid Order", str)
+ }
+ return nil
+}
+
+func (e Order) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type ProfileTaskLogOperationType string
+
+const (
+ ProfileTaskLogOperationTypeNotified ProfileTaskLogOperationType = "NOTIFIED"
+ ProfileTaskLogOperationTypeExecutionFinished ProfileTaskLogOperationType = "EXECUTION_FINISHED"
+)
+
+var AllProfileTaskLogOperationType = []ProfileTaskLogOperationType{
+ ProfileTaskLogOperationTypeNotified,
+ ProfileTaskLogOperationTypeExecutionFinished,
+}
+
+func (e ProfileTaskLogOperationType) IsValid() bool {
+ switch e {
+ case ProfileTaskLogOperationTypeNotified, ProfileTaskLogOperationTypeExecutionFinished:
+ return true
+ }
+ return false
+}
+
+func (e ProfileTaskLogOperationType) String() string {
+ return string(e)
+}
+
+func (e *ProfileTaskLogOperationType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = ProfileTaskLogOperationType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid ProfileTaskLogOperationType", str)
+ }
+ return nil
+}
+
+func (e ProfileTaskLogOperationType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type QueryOrder string
+
+const (
+ QueryOrderByStartTime QueryOrder = "BY_START_TIME"
+ QueryOrderByDuration QueryOrder = "BY_DURATION"
+)
+
+var AllQueryOrder = []QueryOrder{
+ QueryOrderByStartTime,
+ QueryOrderByDuration,
+}
+
+func (e QueryOrder) IsValid() bool {
+ switch e {
+ case QueryOrderByStartTime, QueryOrderByDuration:
+ return true
+ }
+ return false
+}
+
+func (e QueryOrder) String() string {
+ return string(e)
+}
+
+func (e *QueryOrder) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = QueryOrder(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid QueryOrder", str)
+ }
+ return nil
+}
+
+func (e QueryOrder) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type RefType string
+
+const (
+ RefTypeCrossProcess RefType = "CROSS_PROCESS"
+ RefTypeCrossThread RefType = "CROSS_THREAD"
+)
+
+var AllRefType = []RefType{
+ RefTypeCrossProcess,
+ RefTypeCrossThread,
+}
+
+func (e RefType) IsValid() bool {
+ switch e {
+ case RefTypeCrossProcess, RefTypeCrossThread:
+ return true
+ }
+ return false
+}
+
+func (e RefType) String() string {
+ return string(e)
+}
+
+func (e *RefType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = RefType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid RefType", str)
+ }
+ return nil
+}
+
+func (e RefType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type Scope string
+
+const (
+ ScopeAll Scope = "All"
+ ScopeService Scope = "Service"
+ ScopeServiceInstance Scope = "ServiceInstance"
+ ScopeEndpoint Scope = "Endpoint"
+ ScopeServiceRelation Scope = "ServiceRelation"
+ ScopeServiceInstanceRelation Scope = "ServiceInstanceRelation"
+ ScopeEndpointRelation Scope = "EndpointRelation"
+)
+
+var AllScope = []Scope{
+ ScopeAll,
+ ScopeService,
+ ScopeServiceInstance,
+ ScopeEndpoint,
+ ScopeServiceRelation,
+ ScopeServiceInstanceRelation,
+ ScopeEndpointRelation,
+}
+
+func (e Scope) IsValid() bool {
+ switch e {
+ case ScopeAll, ScopeService, ScopeServiceInstance, ScopeEndpoint, ScopeServiceRelation, ScopeServiceInstanceRelation, ScopeEndpointRelation:
+ return true
+ }
+ return false
+}
+
+func (e Scope) String() string {
+ return string(e)
+}
+
+func (e *Scope) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = Scope(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid Scope", str)
+ }
+ return nil
+}
+
+func (e Scope) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type Step string
+
+const (
+ StepDay Step = "DAY"
+ StepHour Step = "HOUR"
+ StepMinute Step = "MINUTE"
+ StepSecond Step = "SECOND"
+)
+
+var AllStep = []Step{
+ StepDay,
+ StepHour,
+ StepMinute,
+ StepSecond,
+}
+
+func (e Step) IsValid() bool {
+ switch e {
+ case StepDay, StepHour, StepMinute, StepSecond:
+ return true
+ }
+ return false
+}
+
+func (e Step) String() string {
+ return string(e)
+}
+
+func (e *Step) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = Step(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid Step", str)
+ }
+ return nil
+}
+
+func (e Step) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type TemplateType string
+
+const (
+ TemplateTypeDashboard TemplateType = "DASHBOARD"
+ TemplateTypeTopologyService TemplateType = "TOPOLOGY_SERVICE"
+ TemplateTypeTopologyInstance TemplateType = "TOPOLOGY_INSTANCE"
+ TemplateTypeTopologyEndpoint TemplateType = "TOPOLOGY_ENDPOINT"
+ TemplateTypeTopologyServiceRelation TemplateType = "TOPOLOGY_SERVICE_RELATION"
+ TemplateTypeTopologyServiceInstanceRelation TemplateType = "TOPOLOGY_SERVICE_INSTANCE_RELATION"
+)
+
+var AllTemplateType = []TemplateType{
+ TemplateTypeDashboard,
+ TemplateTypeTopologyService,
+ TemplateTypeTopologyInstance,
+ TemplateTypeTopologyEndpoint,
+ TemplateTypeTopologyServiceRelation,
+ TemplateTypeTopologyServiceInstanceRelation,
+}
+
+func (e TemplateType) IsValid() bool {
+ switch e {
+ case TemplateTypeDashboard, TemplateTypeTopologyService, TemplateTypeTopologyInstance, TemplateTypeTopologyEndpoint, TemplateTypeTopologyServiceRelation, TemplateTypeTopologyServiceInstanceRelation:
+ return true
+ }
+ return false
+}
+
+func (e TemplateType) String() string {
+ return string(e)
+}
+
+func (e *TemplateType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = TemplateType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid TemplateType", str)
+ }
+ return nil
+}
+
+func (e TemplateType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type TraceState string
+
+const (
+ TraceStateAll TraceState = "ALL"
+ TraceStateSuccess TraceState = "SUCCESS"
+ TraceStateError TraceState = "ERROR"
+)
+
+var AllTraceState = []TraceState{
+ TraceStateAll,
+ TraceStateSuccess,
+ TraceStateError,
+}
+
+func (e TraceState) IsValid() bool {
+ switch e {
+ case TraceStateAll, TraceStateSuccess, TraceStateError:
+ return true
+ }
+ return false
+}
+
+func (e TraceState) String() string {
+ return string(e)
+}
+
+func (e *TraceState) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = TraceState(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid TraceState", str)
+ }
+ return nil
+}
+
+func (e TraceState) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
diff --git a/scripts/update.sh b/scripts/update.sh
index ec6b480..450b490 100644
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -19,40 +19,7 @@
set -e
-BASEDIR=$(dirname "$0")/..
-TEMPDIR="$BASEDIR"/temp
+bash "$(dirname "$0")"/update_collect_protocol.sh
+bash "$(dirname "$0")"/update_query_protocol.sh
-. "$BASEDIR"/dependencies.sh
-
-if [[ ! -d "$TEMPDIR" ]]; then
- mkdir -p "$TEMPDIR"
-else
- rm -rf "${TEMPDIR:?}"/*
-fi
-
-curl -sLo "$TEMPDIR"/collect-protocol.tgz https://github.com/apache/skywalking-data-collect-protocol/archive/"${COLLECT_PROTOCOL_SHA}".tar.gz
-
-if [[ ! -d "$TEMPDIR"/collect-protocol ]]; then
- mkdir "$TEMPDIR"/collect-protocol
-else
- rm -rf "$TEMPDIR"/collect-protocol/*
-fi
-
-tar -zxf "$TEMPDIR"/collect-protocol.tgz -C "$TEMPDIR"/collect-protocol --strip 1
-
-find "$TEMPDIR"/collect-protocol -name "*Compat.proto" -exec rm {} \;
-
-rm -rf "$BASEDIR"/collect
-
-go get -u google.golang.org/protobuf/cmd/protoc-gen-go@v1.26.0
-go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0
-
-"$BASEDIR"/scripts/protoc.sh \
- --proto_path="$TEMPDIR"/collect-protocol \
- --go_out="$BASEDIR" \
- --go-grpc_out="$BASEDIR" \
- "$TEMPDIR"/collect-protocol/*/*.proto
-
-mv "$BASEDIR"/skywalking.apache.org/repo/goapi/collect "$BASEDIR"/ && rm -rf "$BASEDIR"/skywalking.apache.org
-
-go mod tidy
+rm -rf temp
diff --git a/scripts/update.sh b/scripts/update_collect_protocol.sh
similarity index 100%
copy from scripts/update.sh
copy to scripts/update_collect_protocol.sh
diff --git a/scripts/update.sh b/scripts/update_query_protocol.sh
similarity index 54%
copy from scripts/update.sh
copy to scripts/update_query_protocol.sh
index ec6b480..536bfd0 100644
--- a/scripts/update.sh
+++ b/scripts/update_query_protocol.sh
@@ -30,29 +30,23 @@ else
rm -rf "${TEMPDIR:?}"/*
fi
-curl -sLo "$TEMPDIR"/collect-protocol.tgz https://github.com/apache/skywalking-data-collect-protocol/archive/"${COLLECT_PROTOCOL_SHA}".tar.gz
+curl -sLo "$TEMPDIR"/query-protocol.tgz https://github.com/apache/skywalking-query-protocol/archive/"${QUERY_PROTOCOL_SHA}".tar.gz
-if [[ ! -d "$TEMPDIR"/collect-protocol ]]; then
- mkdir "$TEMPDIR"/collect-protocol
+if [[ ! -d "$TEMPDIR"/query-protocol ]]; then
+ mkdir "$TEMPDIR"/query-protocol
else
- rm -rf "$TEMPDIR"/collect-protocol/*
+ rm -rf "$TEMPDIR"/query-protocol/*
fi
-tar -zxf "$TEMPDIR"/collect-protocol.tgz -C "$TEMPDIR"/collect-protocol --strip 1
+tar -zxf "$TEMPDIR"/query-protocol.tgz -C "$TEMPDIR"/query-protocol --strip 1
-find "$TEMPDIR"/collect-protocol -name "*Compat.proto" -exec rm {} \;
+rm -rf "$TEMPDIR"/query-protocol.tgz
-rm -rf "$BASEDIR"/collect
+go get github.com/99designs/gqlgen
-go get -u google.golang.org/protobuf/cmd/protoc-gen-go@v1.26.0
-go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0
+"$(go env GOPATH)"/bin/gqlgen -h > /dev/null 2>&1 || GO111MODULE=off go get github.com/99designs/gqlgen
+"$(go env GOPATH)"/bin/gqlgen generate
-"$BASEDIR"/scripts/protoc.sh \
- --proto_path="$TEMPDIR"/collect-protocol \
- --go_out="$BASEDIR" \
- --go-grpc_out="$BASEDIR" \
- "$TEMPDIR"/collect-protocol/*/*.proto
-
-mv "$BASEDIR"/skywalking.apache.org/repo/goapi/collect "$BASEDIR"/ && rm -rf "$BASEDIR"/skywalking.apache.org
+rm -rf "$TEMPDIR"/query-protocol
go mod tidy