From a0e5902c8f3e7b866649c62f58c3638029f53273 Mon Sep 17 00:00:00 2001 From: Adam Traeger Date: Fri, 14 Jul 2023 20:11:22 -0500 Subject: [PATCH 01/44] Initial backend support. Allowed for query error propagation to frontend. --- Magefile.go | 12 + go.mod | 73 ++ go.sum | 690 +++++++++++++++++ pkg/main.go | 24 + pkg/plugin/datasource.go | 173 +++++ pkg/plugin/fixme-todo.txt | 94 +++ pkg/plugin/helpers.go | 378 ++++++++++ pkg/plugin/models.go | 24 + pkg/plugin/query.go | 482 ++++++++++++ pkg/plugin/queryModels.go | 114 +++ pkg/plugin/steam.go | 260 +++++++ pkg/plugin/valueModels.go | 48 ++ pkg/plugin/webidcache.go | 183 +++++ src/datasource.ts | 1478 ++++++++++++++++++------------------- src/plugin.json | 4 +- 15 files changed, 3282 insertions(+), 755 deletions(-) create mode 100644 Magefile.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 pkg/main.go create mode 100644 pkg/plugin/datasource.go create mode 100644 pkg/plugin/fixme-todo.txt create mode 100644 pkg/plugin/helpers.go create mode 100644 pkg/plugin/models.go create mode 100644 pkg/plugin/query.go create mode 100644 pkg/plugin/queryModels.go create mode 100644 pkg/plugin/steam.go create mode 100644 pkg/plugin/valueModels.go create mode 100644 pkg/plugin/webidcache.go diff --git a/Magefile.go b/Magefile.go new file mode 100644 index 0000000..4710a8a --- /dev/null +++ b/Magefile.go @@ -0,0 +1,12 @@ +//go:build mage +// +build mage + +package main + +import ( + // mage:import + build "github.com/grafana/grafana-plugin-sdk-go/build" +) + +// Default configures the default target. +var Default = build.BuildAll diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..0178eeb --- /dev/null +++ b/go.mod @@ -0,0 +1,73 @@ +module github.com/GridProtectionAlliance/osisoftpi-grafana + +go 1.20 + +require ( + github.com/go-co-op/gocron v1.18.0 + github.com/google/uuid v1.3.0 + github.com/gorilla/websocket v1.5.0 + github.com/grafana/grafana-plugin-sdk-go v0.147.0 +) + +require ( + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cheekybits/genny v1.0.0 // indirect + github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect + github.com/elazarl/goproxy v0.0.0-20220115173737-adb46da277ac // indirect + github.com/fatih/color v1.7.0 // indirect + github.com/getkin/kin-openapi v0.94.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/swag v0.19.15 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.3 // indirect + github.com/google/flatbuffers v2.0.0+incompatible // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect + github.com/hashicorp/go-hclog v0.14.1 // indirect + github.com/hashicorp/go-plugin v1.4.3 // indirect + github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.13.1 // indirect + github.com/magefile/mage v1.14.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattetti/filebuffer v1.0.1 // indirect + github.com/mattn/go-colorable v0.1.4 // indirect + github.com/mattn/go-isatty v0.0.10 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pierrec/lz4/v4 v4.1.8 // indirect + github.com/prometheus/client_golang v1.12.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect + github.com/unknwon/com v1.0.1 // indirect + github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 // indirect + github.com/urfave/cli v1.22.1 // indirect + golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect + golang.org/x/text v0.3.6 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 // indirect + google.golang.org/grpc v1.41.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..f23c540 --- /dev/null +++ b/go.sum @@ -0,0 +1,690 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 h1:q4dksr6ICHXqG5hm0ZW5IHyeEJXoIJSOZeBLmWPNeIQ= +github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= +github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 h1:XCdvHbz3LhewBHN7+mQPx0sg/Hxil/1USnBmxkjHcmY= +github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= +github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +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/elazarl/goproxy v0.0.0-20220115173737-adb46da277ac h1:XDAn206aIqKPdF5YczuuJXSQPx+WOen0Pxbxp5Fq8Pg= +github.com/elazarl/goproxy v0.0.0-20220115173737-adb46da277ac/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= +github.com/elazarl/goproxy/ext v0.0.0-20220115173737-adb46da277ac h1:9yrT5tmn9Zc0ytWPASlaPwQfQMQYnRf0RSDe1XvHw0Q= +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.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/getkin/kin-openapi v0.94.0 h1:bAxg2vxgnHHHoeefVdmGbR+oxtJlcv5HsJJa3qmAHuo= +github.com/getkin/kin-openapi v0.94.0/go.mod h1:LWZfzOd7PRy8GJ1dJ6mCU6tNdSfOwRac1BUPam4aw6Q= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-co-op/gocron v1.18.0 h1:SxTyJ5xnSN4byCq7b10LmmszFdxQlSQJod8s3gbnXxA= +github.com/go-co-op/gocron v1.18.0/go.mod h1:sD/a0Aadtw5CpflUJ/lpP9Vfdk979Wl1Sg33HPHg0FY= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v2.0.0+incompatible h1:dicJ2oXwypfwUGnB2/TYWYEKiuk9eYQlQO/AnOHl5mI= +github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= +github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/grafana-plugin-sdk-go v0.147.0 h1:VavvJOa/Ubs+wzalzWIl+FQmdaD4vEK8KVYU0a8rf+E= +github.com/grafana/grafana-plugin-sdk-go v0.147.0/go.mod h1:NMgO3t2gR5wyLx8bWZ9CTmpDk5Txp4wYFccFLHdYn3Q= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM= +github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= +github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ= +github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +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/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo= +github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattetti/filebuffer v1.0.1 h1:gG7pyfnSIZCxdoKq+cPa8T0hhYtD9NxCdI4D7PTjRLM= +github.com/mattetti/filebuffer v1.0.1/go.mod h1:YdMURNDOttIiruleeVr6f56OrMc+MydEnTcXwtkxNVs= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +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.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4= +github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 h1:Jpy1PXuP99tXNrhbq2BaPz9B+jNAvH1JPQQpG/9GCXY= +github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= +github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 h1:aVGB3YnaS/JNfOW3tiHIlmNmTDg618va+eT0mVomgyI= +github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8/go.mod h1:fVle4kNr08ydeohzYafr20oZzbAkhQT39gKK/pFQ5M4= +github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs= +github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= +github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 h1:4EYQaWAatQokdji3zqZloVIW/Ke1RQjYw2zHULyrHJg= +github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3/go.mod h1:1xEUf2abjfP92w2GZTV+GgaRxXErwRXcClbUwrNJffU= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191020152052-9984515f0562/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3 h1:DnoIG+QAMaF5NvxnGe/oKsgKcAc6PcUyl8q0VetfQ8s= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= +google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify/fsnotify.v1 v1.4.7 h1:XNNYLJHt73EyYiCZi6+xjupS9CpvmiDgjPTAjrBlQbo= +gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/pkg/main.go b/pkg/main.go new file mode 100644 index 0000000..966ec30 --- /dev/null +++ b/pkg/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + + "github.com/GridProtectionAlliance/osisoftpi-grafana/pkg/plugin" + "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" + "github.com/grafana/grafana-plugin-sdk-go/backend/log" +) + +func main() { + // Start listening to requests sent from Grafana. This call is blocking so + // it won't finish until Grafana shuts down the process or the plugin choose + // to exit by itself using os.Exit. Manage automatically manages life cycle + // of datasource instances. It accepts datasource instance factory as first + // argument. This factory will be automatically called on incoming request + // from Grafana to create different instances of SampleDatasource (per datasource + // ID). When datasource configuration changed Dispose method will be called and + // new datasource instance created using NewSampleDatasource factory. + if err := datasource.Manage("GridProtectionAlliance-osipiwebapi-datasource", plugin.NewPIWebAPIDatasource, datasource.ManageOpts{}); err != nil { + log.DefaultLogger.Error(err.Error()) + os.Exit(1) + } +} diff --git a/pkg/plugin/datasource.go b/pkg/plugin/datasource.go new file mode 100644 index 0000000..97170b5 --- /dev/null +++ b/pkg/plugin/datasource.go @@ -0,0 +1,173 @@ +package plugin + +import ( + "context" + "fmt" + "net/http" + "strings" + "sync" + "time" + + "github.com/go-co-op/gocron" + "github.com/gorilla/websocket" + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" + "github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt" + "github.com/grafana/grafana-plugin-sdk-go/backend/log" +) + +// Make sure Datasource implements required interfaces. This is important to do +// since otherwise we will only get a not implemented error response from plugin in +// runtime. In this example datasource instance implements backend.QueryDataHandler, +// backend.CheckHealthHandler interfaces. Plugin should not implement all these +// interfaces- only those which are required for a particular task. +var ( + _ backend.QueryDataHandler = (*Datasource)(nil) + _ backend.CheckHealthHandler = (*Datasource)(nil) + _ instancemgmt.InstanceDisposer = (*Datasource)(nil) + _ backend.CallResourceHandler = (*Datasource)(nil) + +// _ backend.StreamHandler = (*Datasource)(nil) +) + +// NewDatasource creates a new PIWebAPI datasource instance. +func NewPIWebAPIDatasource(settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) { + opts, err := settings.HTTPClientOptions() + if err != nil { + return nil, fmt.Errorf("http client options: %w", err) + } + + cl, err := httpclient.New(opts) + if err != nil { + return nil, fmt.Errorf("httpclient new: %w", err) + } + var webIDCache = map[string]WebIDCacheEntry{} + // TODO: Re-add streaming + // var channelConstruct = map[string]StreamChannelConstruct{} + + scheduler := gocron.NewScheduler(time.UTC) + scheduler.Every(5).Minute().Do(cleanWebIDCache, webIDCache) + scheduler.StartAsync() + + return &Datasource{ + settings: settings, + httpClient: cl, + webIDCache: webIDCache, + // channelConstruct: channelConstruct, + scheduler: scheduler, + websocketConnectionsMutex: &sync.Mutex{}, + sendersByWebIDMutex: &sync.Mutex{}, + websocketConnections: make(map[string]*websocket.Conn), + sendersByWebID: make(map[string]map[*backend.StreamSender]bool), + streamChannels: make(map[string]chan []byte), + }, nil +} + +// Dispose here tells plugin SDK that plugin wants to clean up resources when a new instance +// created. As soon as datasource settings change detected by SDK old datasource instance will +// be disposed and a new one will be created using NewSampleDatasource factory function. +func (d *Datasource) Dispose() { + d.httpClient.CloseIdleConnections() +} + +// Main entry point for a query. Called by Grafana when a query is executed. +// QueryData handles multiple queries and returns multiple responses. +// req contains the queries []DataQuery (where each query contains RefID as a unique identifier). +// The QueryDataResponse contains a map of RefID to the response for each query, and each response +// contains Frames ([]*Frame). + +// TODO: Add support for regex replace of frame names +// TODO: Missing functionality: Fix summaries +func (d *Datasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { + + backend.Logger.Info("Query Recieved. Processing...") + processedPIWebAPIQueries := make(map[string][]PiProcessedQuery) + datasourceUID := req.PluginContext.DataSourceInstanceSettings.UID + + // Process queries generic query objects and turn them into a suitable format for the PI Web API + for _, q := range req.Queries { + backend.Logger.Info("Processing Query", "RefID", q.RefID) + processedPIWebAPIQueries[q.RefID] = d.processQuery(ctx, q, datasourceUID) + } + + // Send the queries to the PI Web API + backend.Logger.Error("Sending Queries to PI Web API") + processedQueries_temp := d.batchRequest(ctx, processedPIWebAPIQueries) + + // Convert the PI Web API response into Grafana frames + backend.Logger.Error("Processing PI Web API Responses into data frames") + response := d.processBatchtoFrames(processedQueries_temp) + + return response, nil +} + +// This function provides a way to proxy requests to the PI Web API. It is used to limit access fromt he frontend to the PI Web API. +// These endpoints are called by the front end while configuring the datasource, query, and annotations. +func (d *Datasource) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error { + var isAllowed = true + var allowedBasePaths = []string{ + "/assetdatabases", + "/elements", + "/assetservers", + "/points", + "/attributes", + "/dataservers", + "/annotations", + } + for _, path := range allowedBasePaths { + if strings.HasPrefix(req.Path, path) { + isAllowed = true + break + } + } + + if !isAllowed { + return sender.Send(&backend.CallResourceResponse{ + Status: http.StatusForbidden, + Body: nil, + }) + } + + r, err := d.apiGet(ctx, req.URL) + if err != nil { + return err + } + return sender.Send(&backend.CallResourceResponse{ + Status: http.StatusOK, + Body: r, + }) +} + +// CheckHealth performs a request to the specified data source and returns an error if the HTTP handler did not return +// a 200 OK response. +func (d *Datasource) CheckHealth(ctx context.Context, _ *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) { + r, err := http.NewRequestWithContext(ctx, http.MethodGet, d.settings.URL, nil) + if err != nil { + return newHealthCheckErrorf("could not create request"), nil + } + if d.settings.BasicAuthEnabled { + r.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) + } + resp, err := d.httpClient.Do(r) + if err != nil { + return newHealthCheckErrorf("request error"), nil + } + defer func() { + if err := resp.Body.Close(); err != nil { + log.DefaultLogger.Error("check health: failed to close response body", "err", err.Error()) + } + }() + if resp.StatusCode != http.StatusOK { + return newHealthCheckErrorf("got response code %d", resp.StatusCode), nil + } + return &backend.CheckHealthResult{ + Status: backend.HealthStatusOk, + Message: "Data source is working", + }, nil +} + +// newHealthCheckErrorf returns a new *backend.CheckHealthResult with its status set to backend.HealthStatusError +// and the specified message, which is formatted with Sprintf. +func newHealthCheckErrorf(format string, args ...interface{}) *backend.CheckHealthResult { + return &backend.CheckHealthResult{Status: backend.HealthStatusError, Message: fmt.Sprintf(format, args...)} +} diff --git a/pkg/plugin/fixme-todo.txt b/pkg/plugin/fixme-todo.txt new file mode 100644 index 0000000..d22f3cc --- /dev/null +++ b/pkg/plugin/fixme-todo.txt @@ -0,0 +1,94 @@ +// TODO impliment handling of summary data frames whith specific types. +// This will require a new response type. +// Summary data cannot be streamed. +Fix json unmarshaling + "summary": { + "basis": "EventWeightedIncludeBothEnds", + "interval": "30s", + "nodata": "Null", + "types": [ + { + "label": "Total", + "value": { + "expandable": true, + "value": "Total" + } + }, + { + "label": "Minimum", + "value": { + "expandable": true, + "value": "Minimum" + } + } + ] + }, +// Error should create a error notice to front F1DPZenJDV_uEUWKAhnXfXVYUAmQAAAAV0lOLVY3SjRCMjYxMjFBXFRFU1RESUdJVEFM +// WORKING RESPONSE" +// I think the frame should be shaped like Name.Type + +//"https://piapi.complacentsee.com/piwebapi/streamsets/summary?startTime=2023-02-18T18:49:43.008Z&endTime=2023-02-25T18:49:43.008Z&intervals=1008&summaryType=Total&summaryType=Minimum&calculationBasis=EventWeighted&summaryDuration=10000s&webid=F1DPZenJDV_uEUWKAhnXfXVYUAkwAAAAV0lOLVY3SjRCMjYxMjFBXEZBU1RTSU5FOTA"} + +{ + "Links": {}, + "Items": [ + { + "WebId": "F1DPZenJDV_uEUWKAhnXfXVYUAkQAAAAV0lOLVY3SjRCMjYxMjFBXEZBU1RTSU5F", + "Name": "fastsine", + "Path": "\\\\WIN-V7J4B26121A\\fastsine", + "Links": { + "Source": "https://piapi.complacentsee.com/piwebapi/points/F1DPZenJDV_uEUWKAhnXfXVYUAkQAAAAV0lOLVY3SjRCMjYxMjFBXEZBU1RTSU5F" + }, + "Items": [ + { + "Type": "Total", + "Value": { + "Timestamp": "2023-02-25T18:40:08Z", + "Value": 0.003319847500986523, + "UnitsAbbreviation": "", + "Good": true, + "Questionable": false, + "Substituted": false, + "Annotated": false + } + } + ] + } + ] +} +// ERROR RESPONSE +{ + "Links": {}, + "Items": [ + { + "WebId": "F1DPZenJDV_uEUWKAhnXfXVYUAmQAAAAV0lOLVY3SjRCMjYxMjFBXFRFU1RESUdJVEFM", + "Name": "testDigital", + "Path": "\\\\WIN-V7J4B26121A\\testDigital", + "Links": { + "Source": "https://piapi.complacentsee.com/piwebapi/points/F1DPZenJDV_uEUWKAhnXfXVYUAmQAAAAV0lOLVY3SjRCMjYxMjFBXFRFU1RESUdJVEFM" + }, + "Items": [ + { + "Type": "Total", + "Value": { + "Timestamp": "2023-02-25T18:37:31Z", + "Value": null, + "UnitsAbbreviation": "", + "Good": false, + "Questionable": false, + "Substituted": false, + "Annotated": false, + "Errors": [ + { + "FieldName": "Value", + "Message": [ + "Cannot do summary calculation on non-numeric data." + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/pkg/plugin/helpers.go b/pkg/plugin/helpers.go new file mode 100644 index 0000000..3555851 --- /dev/null +++ b/pkg/plugin/helpers.go @@ -0,0 +1,378 @@ +package plugin + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "reflect" + "time" + + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/data" +) + +// apiGet performs a GET request against the PI Web API. It returns the response body as a byte slice. +// If the request fails, an error is returned. +func (d *Datasource) apiGet(ctx context.Context, path string) ([]byte, error) { + uri := d.settings.URL + path + req, err := http.NewRequest(http.MethodGet, uri, nil) + if err != nil { + return nil, err + } + if d.settings.BasicAuthEnabled { + req.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) + } + resp, err := d.httpClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + return body, nil +} + +// apiBatchRequest performs a batch request against the PI Web API. It returns the response body as a byte slice. +// If the request fails, an error is returned. +func (d *Datasource) apiBatchRequest(ctx context.Context, BatchSubRequests map[string]BatchSubRequest) ([]byte, error) { + uri := d.settings.URL + "/batch" + jsonValue, err := json.Marshal(BatchSubRequests) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodPost, uri, bytes.NewBuffer(jsonValue)) + if err != nil { + return nil, err + } + + if d.settings.BasicAuthEnabled { + req.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("X-Requested-With", "message/http") + req.Header.Set("X-PIWEBAPI-HTTP-METHOD", "GET") + req.Header.Set("X-PIWEBAPI-RESOURCE-ADDRESS", uri) + + resp, err := d.httpClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + backend.Logger.Debug("Batch request response", "body", string(body)) + + return body, nil +} + +// convertSliceToPointers converts a slice of values to a slice of +// pointers to those values. This is used to create point values that are nullable. +func convertSliceToPointers(slice interface{}, badValues []int) interface{} { + s := reflect.ValueOf(slice) + t := reflect.TypeOf(slice).Elem() + + switch t.Kind() { + case reflect.Int: + pointers := make([]*int, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*int) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Int8: + pointers := make([]*int8, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*int8) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Int16: + pointers := make([]*int16, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*int16) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Int32: + pointers := make([]*int32, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*int32) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Int64: + pointers := make([]*int64, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*int64) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Uint8: + pointers := make([]*uint8, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*uint8) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Uint16: + pointers := make([]*uint16, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*uint16) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Uint32: + pointers := make([]*uint32, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*uint32) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Uint64: + pointers := make([]*uint64, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*uint64) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Float32: + pointers := make([]*float32, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*float32) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Float64: + pointers := make([]*float64, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*float64) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.String: + pointers := make([]*string, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*string) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Bool: + pointers := make([]*bool, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*bool) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + case reflect.Struct: + if t == reflect.TypeOf(time.Time{}) { + // Handle time.Time + pointers := make([]*time.Time, s.Len()) + for i := 0; i < s.Len(); i++ { + pointers[i] = s.Index(i).Addr().Interface().(*time.Time) + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + } + return nil + default: + pointers := make([]interface{}, s.Len()) + for i := 0; i < s.Len(); i++ { + v := s.Index(i) + pointers[i] = v.Addr().Interface() + } + for _, badValue := range badValues { + pointers[badValue] = nil + } + return pointers + } +} + +func handleTimestampValue(val reflect.Value) (reflect.Value, error) { + if val.Kind() != reflect.String { + return reflect.Value{}, fmt.Errorf("timestamp value must be a string") + } + + ts := getTimeStamp(val) + if ts.Kind() == reflect.Interface && ts.Interface() != nil { + return reflect.Value{}, fmt.Errorf("error parsing timestamp value: %v", ts.Interface()) + } + + return ts, nil +} + +// TODO: Code simplification: Determine if we should create metadata here. +// if we passed in the entire query we could do that. +// if we pass a pointer to the webid cache and the webid that might simplify things + +// TODO: Code cleanup: handle this directly using slices of pointers. +// TODO: Missing functionality: Add support for summary queries. +// TODO: Missing functionality: Add support for replacing bad data. +func convertItemsToDataFrame(frameName string, items []PiBatchContentItem, SliceType reflect.Type, digitalState bool, summaryQuery bool) (*data.Frame, error) { + frame := data.NewFrame(frameName) + + //FIXME: Remove this once we have a better way to handle this + if len(items) < 10 { + itemsJSON, err := json.Marshal(items) + if err != nil { + backend.Logger.Warn("convertItemsToDataFrame", "Error marshalling items to JSON: ", err) + } else { + backend.Logger.Warn("convertItemsToDataFrame", "Items: ", string(itemsJSON)) + } + } + + var timestamps []time.Time + badValues := make([]int, 0) + var values any + values = reflect.MakeSlice(reflect.SliceOf(SliceType.Elem()), 0, 0).Interface() + digitalStateValues := make([]int32, 0) + + for i, item := range items { + var val reflect.Value + val = reflect.ValueOf(item.Value) + + //handle value being a timestamp, the PIWab API returns a timestamp as a string + // we need to convert it to a time.Time + if SliceType == reflect.TypeOf([]time.Time{}) { + var err error + val, err = handleTimestampValue(val) + if err != nil { + continue + } + } + + // if the value is valid, get the underlying value + // we need to complete both checks to prevent a panic on a null value + if val.IsValid() && val.Kind() == reflect.Ptr { + val = val.Elem() + } + + if !val.IsValid() { + timestamps = append(timestamps, item.getTimeStamp()) + badValues = append(badValues, i) + zeroVal := reflect.Zero(SliceType.Elem()) + valuesValue := reflect.ValueOf(values) + values = reflect.Append(valuesValue, zeroVal).Interface() + continue + } + + // if the value isn't good, or is not the same type as the slice, + // add it to the list of bad values and nullify later + //TODO we should make this pattern match the query options + if val.Type().Kind() != SliceType.Elem().Kind() || digitalState || !item.isGood() { + + timestamps = append(timestamps, item.getTimeStamp()) + if digitalState { + var pds PointDigitalState + if b, err := json.Marshal(item.Value); err == nil { + if err := json.Unmarshal(b, &pds); err != nil { + backend.Logger.Info("Error unmarshalling digital state", err) + badValues = append(badValues, i) + zeroVal := reflect.Zero(SliceType.Elem()) + valuesValue := reflect.ValueOf(values) + values = reflect.Append(valuesValue, zeroVal).Interface() + continue + } + pdsValue := reflect.ValueOf(pds.Name) + values = reflect.Append(reflect.ValueOf(values), pdsValue).Interface() + digitalStateValues = append(digitalStateValues, int32(pds.Value)) + continue + } else { + backend.Logger.Info("Error unmarshalling digital state", err) + badValues = append(badValues, i) + zeroVal := reflect.Zero(SliceType.Elem()) + valuesValue := reflect.ValueOf(values) + values = reflect.Append(valuesValue, zeroVal).Interface() + continue + } + } + + badValues = append(badValues, i) + zeroVal := reflect.Zero(SliceType.Elem()) + valuesValue := reflect.ValueOf(values) + values = reflect.Append(valuesValue, zeroVal).Interface() + continue + } + + timestamps = append(timestamps, item.getTimeStamp()) + values = reflect.Append(reflect.ValueOf(values), val).Interface() + } + + backend.Logger.Info("Converting slice to pointers") + + // Convert the slice of values to a slice of pointers to the values + // This is so that we can nullify the values that are "bad" + // "Bad" values are values such as system type values that cannot be represented + // in the slice type, or values that are not "good" + valuepointers := convertSliceToPointers(values, badValues) + + frame.Fields = append(frame.Fields, + data.NewField("time", nil, timestamps), + data.NewField(frameName, nil, valuepointers), + ) + + if digitalState { + frame.Fields = append(frame.Fields, + data.NewField(frameName+".Value", nil, digitalStateValues), + ) + } + + frame.Meta = &data.FrameMeta{} + return frame, nil +} + +func getTimeStamp(input reflect.Value) reflect.Value { + if input.Kind() != reflect.String { + // return an error value if the input is not a string + return reflect.ValueOf(errors.New("input is not a string")) + } + + // parse the timestamp string + timeLayout := "2006-01-02T15:04:05.999999999Z07:00" + timestamp, err := time.Parse(timeLayout, input.String()) + if err != nil { + // return an error value if the timestamp string is invalid + return reflect.ValueOf(err) + } + + // return a reflect.Value of type time.Time + return reflect.ValueOf(timestamp) +} diff --git a/pkg/plugin/models.go b/pkg/plugin/models.go new file mode 100644 index 0000000..03cb0b1 --- /dev/null +++ b/pkg/plugin/models.go @@ -0,0 +1,24 @@ +package plugin + +import ( + "net/http" + "sync" + + "github.com/go-co-op/gocron" + "github.com/gorilla/websocket" + "github.com/grafana/grafana-plugin-sdk-go/backend" +) + +type Datasource struct { + settings backend.DataSourceInstanceSettings + StreamHandler backend.StreamHandler + httpClient *http.Client + webIDCache map[string]WebIDCacheEntry + // channelConstruct map[string]StreamChannelConstruct + scheduler *gocron.Scheduler + websocketConnectionsMutex *sync.Mutex + sendersByWebIDMutex *sync.Mutex + websocketConnections map[string]*websocket.Conn + sendersByWebID map[string]map[*backend.StreamSender]bool + streamChannels map[string]chan []byte +} diff --git a/pkg/plugin/query.go b/pkg/plugin/query.go new file mode 100644 index 0000000..887202f --- /dev/null +++ b/pkg/plugin/query.go @@ -0,0 +1,482 @@ +package plugin + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + "strings" + + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/log" +) + +type BatchSubRequest struct { + Method string `json:"Method"` + Resource string `json:"Resource"` +} + +// processQuery is the main function for processing queries. It takes a query and returns a slice of PiProcessedQuery +// that contains batched queries that are ready to be sent to the PI Web API. +// If there is an error, the error is set in the PiProcessedQuery and the slice is returned, the error propogates through +// the rest of the processing chain such that a dataframe with metadata is returned to the user to provide feedback to the user. +func (d Datasource) processQuery(ctx context.Context, query backend.DataQuery, datasourceUID string) []PiProcessedQuery { + var ProcessedQuery []PiProcessedQuery + var PiQuery Query + + // Unmarshal the query into a PiQuery struct, and then unmarshal the PiQuery into a PiProcessedQuery + // if there are errors we'll set the error and return the PiProcessedQuery with an error set. + tempJson, err := json.Marshal(query) + if err != nil { + log.DefaultLogger.Error("Error marshalling query", "error", err) + + piQuery := PiProcessedQuery{ + Error: err, + } + ProcessedQuery = append(ProcessedQuery, piQuery) + return ProcessedQuery + } + + err = json.Unmarshal(tempJson, &PiQuery) + if err != nil { + log.DefaultLogger.Error("Error unmarshalling query", "error", err) + + piQuery := PiProcessedQuery{ + Error: err, + } + ProcessedQuery = append(ProcessedQuery, piQuery) + return ProcessedQuery + } + + // the queries are may contain multiple targets, so we need to loop through them + for _, target := range PiQuery.Pi.getTargets() { + fullTargetPath := PiQuery.Pi.getBasePath() + + //TODO: I think this would be cleaner in separate function. + //set the full path for the query based on the type of the target + if PiQuery.Pi.IsPiPoint { + fullTargetPath += "\\" + target + } else { + fullTargetPath += "|" + target + } + + //create a processed query for the target + piQuery := PiProcessedQuery{ + Label: target, + UID: datasourceUID, + IntervalNanoSeconds: PiQuery.Interval, + IsPIPoint: PiQuery.Pi.IsPiPoint, + //Streamable: PiQuery.isStreamable(), //TODO: Implement this + FullTargetPath: fullTargetPath, + } + + WebID, err := d.getWebID(ctx, fullTargetPath, PiQuery.Pi.IsPiPoint) + if err != nil { + log.DefaultLogger.Error("Error getting WebID", "error", err) + piQuery.Error = err + } + + piQuery.WebID = WebID.WebID + + //Create the subrequest for the overall batch request + batchSubRequest := BatchSubRequest{ + Method: "GET", + Resource: d.settings.URL + PiQuery.getQueryBaseURL() + "&webid=" + WebID.WebID, + } + + piQuery.BatchRequest = batchSubRequest + + ProcessedQuery = append(ProcessedQuery, piQuery) + } + return ProcessedQuery +} + +func (d Datasource) batchRequest(ctx context.Context, PIWebAPIQueries map[string][]PiProcessedQuery) map[string][]PiProcessedQuery { + for RefID, processed := range PIWebAPIQueries { + batchRequest := make(map[string]BatchSubRequest) + backend.Logger.Info("Processing batch request", "RefID", RefID) + + // create a map of the batch requests. This allows us to map the response back to the original query + for i, p := range processed { + batchRequest[fmt.Sprint(i)] = p.BatchRequest + } + + // request the data from the PI Web API + r, err := d.apiBatchRequest(ctx, batchRequest) + + // if we get an error back from the PI Web API, we set the error in the PiProcessedQuery and break out of the loop + if err != nil { + log.DefaultLogger.Error("Error in batch request", "RefID", RefID, "error", err) + // TODO: Create a user friendly error message + for i := range processed { + PIWebAPIQueries[RefID][i].Error = err + } + continue + } + + tempresponse := make(map[int]PIBatchResponse) + err = json.Unmarshal(r, &tempresponse) + if err != nil { + log.DefaultLogger.Error("Error unmarshaling batch response", "RefID", RefID, "error", err) + for i := range processed { + PIWebAPIQueries[RefID][i].Error = err + } + continue + } + + // map the response back to the original query + for i := range processed { + PIWebAPIQueries[RefID][i].Response = tempresponse[i].Content + } + } + return PIWebAPIQueries +} + +func (d Datasource) processBatchtoFrames(processedQuery map[string][]PiProcessedQuery) *backend.QueryDataResponse { + response := backend.NewQueryDataResponse() + + for RefID, query := range processedQuery { + + var subResponse backend.DataResponse + for i, q := range query { + backend.Logger.Info("Processing query", "RefID", RefID, "QueryIndex", i) + + // if there is an error in the query, we set the error in the subresponse and break out of the loop returning the error. + if q.Error != nil { + backend.Logger.Error("Error processing query", "RefID", RefID, "QueryIndex", i, "error", q.Error) + subResponse.Error = q.Error + break + } + + PointType := d.getTypeForWebID(q.WebID) + IsPointDigitalState := d.getDigitalStateforWebID(q.WebID) + frame, err := convertItemsToDataFrame(q.Label, *q.Response.getItems(), PointType, IsPointDigitalState, false) + + // if there is an error on a single frame we set metadata and continue to the next frame + if err != nil { + backend.Logger.Error("Error processing query", "RefID", RefID, "QueryIndex", i, "error", err.Error) + continue + } + + frame.RefID = RefID + frame.Meta.ExecutedQueryString = q.BatchRequest.Resource + + // TODO: enable streaming + // If the query is streamable, then we need to set the channel URI + // and the executed query string. + // if q.Streamable { + // // Create a new channel for this frame request. + // // Creating a new channel for each frame request is not ideal, + // // but it is the only way to ensure that the frame data is refreshed + // // on a time interval update. + // channeluuid := uuid.New() + // channelURI := "ds/" + q.UID + "/" + channeluuid.String() + // channel := StreamChannelConstruct{ + // WebID: q.WebID, + // IntervalNanoSeconds: q.IntervalNanoSeconds, + // } + // d.channelConstruct[channeluuid.String()] = channel + // frame.Meta.Channel = channelURI + // } + + subResponse.Frames = append(subResponse.Frames, frame) + } + response.Responses[RefID] = subResponse + } + return response +} + +func (q *PIWebAPIQuery) isSummary() bool { + return q.Summary.Basis != "" && len(q.Summary.Types) > 0 +} + +func (q *PIWebAPIQuery) getSummaryDuration() string { + if q.Summary.Interval == "" { + return "30s" + } + return q.Summary.Interval +} + +func (q *PIWebAPIQuery) getSummaryURIComponent() string { + uri := "" + // FIXME: Validate that we cannot have a summary for a calculation + if !q.isExpression() { + for _, t := range q.Summary.Types { + uri += "&summaryType=" + t.Value.Value + } + uri += "&summaryBasis=" + q.Summary.Basis + uri += "&summaryDuration=" + q.getSummaryDuration() + } + return uri +} + +func (q *PIWebAPIQuery) isRecordedValues() bool { + return q.RecordedValues.Enable +} + +func (q *PIWebAPIQuery) isInterpolated() bool { + return q.Interpolate.Enable +} + +func (q *PIWebAPIQuery) isRegex() bool { + return q.Regex.Enable +} + +func (q *PIWebAPIQuery) isExpression() bool { + return q.Expression != "" +} + +func (q *PIWebAPIQuery) getBasePath() string { + semiIndex := strings.Index(q.Target, ";") + return q.Target[:semiIndex] +} + +func (q *PIWebAPIQuery) getTargets() []string { + semiIndex := strings.Index(q.Target, ";") + return strings.Split(q.Target[semiIndex+1:], ";") +} + +func (q *Query) getMaxDataPoints() int { + maxDataPoints := q.Pi.MaxDataPoints + if maxDataPoints == 0 { + maxDataPoints = q.MaxDataPoints + } + return maxDataPoints +} + +func (q Query) getQueryBaseURL() string { + // TODO: validate all of the options. + // Clean up this mess + // Valid list: + // - plot + // - calulcation w/ interval + // - recorded with no default max count override + // - recorded with override max count + // FIXME: Missing functionality + // - summary + // - regex replacement + // - display name updates + // - replace bad data + + var uri string + if q.Pi.isExpression() { + uri += "/calculation" + if q.Pi.isSummary() { + uri += "/summary" + q.getTimeRangeURIComponent() + if q.Pi.isInterpolated() { + uri += fmt.Sprintf("&sampleType=Interval&sampleInterval=%dms", q.getIntervalTime()) + } + } else { + uri += "/intervals" + q.getTimeRangeURIComponent() + uri += fmt.Sprintf("&sampleInterval=%dms", q.getIntervalTime()) + } + uri += "&expression=" + url.QueryEscape(q.Pi.Expression) + } else { + uri += "/streamsets" + if q.Pi.isSummary() { + uri += "/summary" + q.getTimeRangeURIComponent() + fmt.Sprintf("&intervals=%d", q.getMaxDataPoints()) + uri += q.Pi.getSummaryURIComponent() + } else if q.Pi.isInterpolated() { + uri += "/interpolated" + q.getTimeRangeURIComponent() + fmt.Sprintf("&interval=%d", q.getIntervalTime()) + } else if q.Pi.isRecordedValues() { + uri += "/recorded" + q.getTimeRangeURIComponent() + fmt.Sprintf("&maxCount=%d", q.getMaxDataPoints()) + } else { + uri += "/plot" + q.getTimeRangeURIComponent() + fmt.Sprintf("&intervals=%d", q.getMaxDataPoints()) + } + } + return uri +} + +type ErrorResponse struct { + Errors []string `json:"Errors"` +} + +type PIBatchResponse struct { + Status int `json:"Status"` + Headers map[string]string `json:"Headers"` + Content PiBatchData `json:"Content"` +} + +type PIBatchResponseBase struct { + Status int `json:"Status"` + Headers map[string]string `json:"Headers"` +} + +type PiBatchData interface { + getUnits() string + getItems() *[]PiBatchContentItem +} + +type PiBatchDataError struct { + Error *ErrorResponse +} + +func (p PiBatchDataError) getUnits() string { + return "" +} + +func (p PiBatchDataError) getItems() *[]PiBatchContentItem { + var items []PiBatchContentItem + return &items +} + +// func (p PiBatchDataError) getDataFrame(frameName string, isStreamable bool) (*data.Frame, error) { +// frame := data.NewFrame(frameName) +// frame.AppendNotices(data.Notice{ +// Severity: data.NoticeSeverityError, +// Text: p.Error.Errors[0], +// }) +// return frame, fmt.Errorf(p.Error.Errors[0]) +// } + +type PiBatchDataWithSubItems struct { + Links map[string]interface{} `json:"Links"` + Items []struct { + WebId string `json:"WebId"` + Name string `json:"Name"` + Path string `json:"Path"` + Links PiBatchContentLinks `json:"Links"` + Items []PiBatchContentItem `json:"Items"` + UnitsAbbreviation string `json:"UnitsAbbreviation"` + } `json:"Items"` + Error *string +} + +func (p PiBatchDataWithSubItems) getUnits() string { + return p.Items[0].UnitsAbbreviation +} + +func (p PiBatchDataWithSubItems) getItems() *[]PiBatchContentItem { + return &p.Items[0].Items +} + +type PiBatchDataWithoutSubItems struct { + Links map[string]interface{} `json:"Links"` + Items []PiBatchContentItem `json:"Items"` + UnitsAbbreviation string `json:"UnitsAbbreviation"` +} + +func (p PiBatchDataWithoutSubItems) getUnits() string { + return p.UnitsAbbreviation +} + +func (p PiBatchDataWithoutSubItems) getItems() *[]PiBatchContentItem { + return &p.Items +} + +// Custom unmarshaler to unmarshal PIBatchResponse to the correct struct type. +// If the first item in the Items array has a WebId, then we have a PiBatchDataWithSubItems +// If the first item in the Items array does not have a WebId, then we have a PiBatchDataWithoutSubItems +// All other formations will return an PiBatchDataError +func (p *PIBatchResponse) UnmarshalJSON(data []byte) error { + var PIBatchResponseBase PIBatchResponseBase + json.Unmarshal(data, &PIBatchResponseBase) + p.Status = PIBatchResponseBase.Status + p.Headers = PIBatchResponseBase.Headers + + // // Unmarshal into a generic map to get the "Items" key + // // Determine if Items[0].WebId is valid. If it is, + // // then we have a PiBatchDataWithSubItems + var rawData map[string]interface{} + err := json.Unmarshal(data, &rawData) + if err != nil { + backend.Logger.Info("Error unmarshalling batch response", err) + return err + } + + Content, ok := rawData["Content"].(map[string]interface{}) + if !ok { + backend.Logger.Error("key 'Content' not found in raw JSON", "rawData", rawData) + return fmt.Errorf("key 'Content' not found in raw JSON") + } + + rawContent, _ := json.Marshal(Content) + + if p.Status != http.StatusOK { + temp_error := &ErrorResponse{} + err = json.Unmarshal(rawContent, temp_error) + if err != nil { + backend.Logger.Error("Error Batch Error Response", "Error", err) + return err + } + p.Content = createPiBatchDataError(&temp_error.Errors) + return nil + } + + items, ok := Content["Items"].([]interface{}) + if !ok { + backend.Logger.Error("key 'Items' not found in 'Content'", "Content", Content) + //Return an error Batch Data Response to the user is notified + errMessages := &[]string{"Could not process response from PI Web API"} + p.Content = createPiBatchDataError(errMessages) + return nil + } + + item, ok := items[0].(map[string]interface{}) + if !ok { + backend.Logger.Error("key '0' not found in 'Items'", "Items", items) + //Return an error Batch Data Response to the user is notified + errMessages := &[]string{"Could not process response from PI Web API"} + p.Content = createPiBatchDataError(errMessages) + return nil + } + + // Check if the response contained a WebId, if the response did contain a WebID + // then it is a PiBatchDataWithSubItems, otherwise it is a PiBatchDataWithoutSubItems + _, ok = item["WebId"].(string) + + if !ok { + ResContent := PiBatchDataWithoutSubItems{} + err = json.Unmarshal(rawContent, &ResContent) + if err != nil { + backend.Logger.Info("Error unmarshalling batch response", err) + //Return an error Batch Data Response so the user is notified + errMessages := &[]string{"Could not process response from PI Web API"} + p.Content = createPiBatchDataError(errMessages) + return nil + } + p.Content = ResContent + return nil + } + ResContent := PiBatchDataWithSubItems{} + err = json.Unmarshal(rawContent, &ResContent) + if err != nil { + backend.Logger.Info("Error unmarshalling batch response", err) + //Return an error Batch Data Response to the user is notified + errMessages := &[]string{"Could not process response from PI Web API"} + p.Content = createPiBatchDataError(errMessages) + return nil + } + p.Content = ResContent + return nil +} + +func createPiBatchDataError(errorMessage *[]string) *PiBatchDataError { + errorResponse := &ErrorResponse{Errors: *errorMessage} + resContent := &PiBatchDataError{Error: errorResponse} + return resContent +} + +type PiBatchContentLinks struct { + Source string `json:"Source"` +} + +type PiBatchContentItems struct { + WebId string `json:"WebId"` + Name string `json:"Name"` + Path string `json:"Path"` + Links PiBatchContentLinks `json:"Links"` + Items []PiBatchContentItem `json:"Items"` + UnitsAbbreviation string `json:"UnitsAbbreviation"` +} + +type PiBatchContentItem struct { + Timestamp string `json:"Timestamp"` + Value interface{} `json:"Value"` + UnitsAbbreviation string `json:"UnitsAbbreviation"` + Good bool `json:"Good"` + Questionable bool `json:"Questionable"` + Substituted bool `json:"Substituted"` + Annotated bool `json:"Annotated"` +} diff --git a/pkg/plugin/queryModels.go b/pkg/plugin/queryModels.go new file mode 100644 index 0000000..ff2fe93 --- /dev/null +++ b/pkg/plugin/queryModels.go @@ -0,0 +1,114 @@ +package plugin + +import "time" + +type Query struct { + RefID string `json:"RefID"` + QueryType string `json:"QueryType"` + MaxDataPoints int `json:"MaxDataPoints"` + Interval int64 `json:"Interval"` + TimeRange struct { + From time.Time `json:"From"` + To time.Time `json:"To"` + } `json:"TimeRange"` + Pi PIWebAPIQuery `json:"JSON"` +} + +func (q *Query) getIntervalTime() int { + intervalTime := q.Pi.IntervalMs + if intervalTime == 0 { + intervalTime = int(q.Interval) + } + return intervalTime +} + +func (q *Query) getTimeRangeURIComponent() string { + return "?startTime=" + q.TimeRange.From.UTC().Format(time.RFC3339) + "&endTime=" + q.TimeRange.To.UTC().Format(time.RFC3339) +} + +func (q *Query) streamingEnabled() bool { + return q.Pi.EnableStreaming.Enable +} + +func (q *Query) isStreamable() bool { + return !q.Pi.isExpression() && q.streamingEnabled() +} + +type PIWebAPIQuery struct { + Attributes []struct { + Label string `json:"label"` + Value struct { + Expandable bool `json:"expandable"` + Value string `json:"value"` + } `json:"value"` + } `json:"attributes"` + Datasource struct { + Type string `json:"type"` + UID string `json:"uid"` + } `json:"datasource"` + DatasourceID int `json:"datasourceId"` + DigitalStates struct { + Enable bool `json:"enable"` + } `json:"digitalStates"` + EnableStreaming struct { + Enable bool `json:"enable"` + } `json:"EnableStreaming"` + ElementPath string `json:"elementPath"` + Expression string `json:"expression"` + Hide bool `json:"hide"` + Interpolate struct { + Enable bool `json:"enable"` + } `json:"interpolate"` + IntervalMs int `json:"intervalMs"` + IsPiPoint bool `json:"isPiPoint"` + MaxDataPoints int `json:"maxDataPoints"` + RecordedValues struct { + Enable bool `json:"enable"` + MaxNumber int `json:"maxNumber"` + } `json:"recordedValues"` + RefID string `json:"refId"` + Regex struct { + Enable bool `json:"enable"` + } `json:"regex"` + Segments []struct { + Label string `json:"label"` + Value struct { + Expandable bool `json:"expandable"` + Value string `json:"value"` + WebID string `json:"webId"` + } `json:"value"` + } `json:"segments"` + Summary QuerySummary `json:"summary"` + Target string `json:"target"` +} + +type QuerySummary struct { + Basis string `json:"basis"` + Interval string `json:"interval"` + Nodata string `json:"nodata"` + Types []SummaryType `json:"types"` +} + +type SummaryType struct { + Label string `json:"label"` + Value SummaryTYpeValue `json:"value"` +} + +type SummaryTYpeValue struct { + Expandable bool `json:"expandable"` + Value string `json:"value"` +} + +type PiProcessedQuery struct { + Label string `json:"Label"` + WebID string `json:"WebID"` + UID string `json:"-"` + IntervalNanoSeconds int64 `json:"IntervalNanoSeconds"` + IsPIPoint bool `json:"IsPiPoint"` + Streamable bool `json:"isStreamable"` + FullTargetPath string `json:"FullTargetPath"` + ResponseUnits string + BatchRequest BatchSubRequest `json:"BatchRequest"` + Response PiBatchData `json:"ResponseData"` + Error error +} diff --git a/pkg/plugin/steam.go b/pkg/plugin/steam.go new file mode 100644 index 0000000..b5a935a --- /dev/null +++ b/pkg/plugin/steam.go @@ -0,0 +1,260 @@ +package plugin + +// import ( +// "context" +// "encoding/base64" +// "encoding/json" +// "errors" +// "fmt" +// "net/http" +// "strings" + +// "github.com/grafana/grafana-plugin-sdk-go/backend" +// "github.com/grafana/grafana-plugin-sdk-go/data" + +// "github.com/gorilla/websocket" +// ) + +// type StreamChannelConstruct struct { +// WebID string +// IntervalNanoSeconds int64 +// } + +// type StreamingResponse struct { +// Links map[string]interface{} `json:"Links"` +// Items []StreamData `json:"Items"` +// } + +// func (sr *StreamingResponse) getItems() *[]PiBatchContentItem { +// return &sr.Items[0].Items +// } + +// type StreamData struct { +// WebId string `json:"WebId"` +// Name string `json:"Name"` +// Path string `json:"Path"` +// Links map[string]interface{} `json:"Links"` +// Items []PiBatchContentItem `json:"Items"` +// UnitsAbbreviation string `json:"UnitsAbbreviation"` +// } + +// // TODO: Improvement: Should the user have the option to limit the streaming rate? +// // to impliment the setting should be added to the StreamChannelConstruct. This +// // would let each query have a different streaming rate, while still using a single stream +// // connection for a given WebID. +// // func (d *Datasource) getStreamInterval(path string) (int64, error) { +// // config, ok := d.streamConfigCache[path] +// // if ok { +// // return config.Interval, nil +// // } +// // return 20000, fmt.Errorf("stream interval not found") +// // } + +// func (d *Datasource) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error) { +// status := backend.SubscribeStreamStatusPermissionDenied +// _, ok := d.channelConstruct[req.Path] +// if ok { +// status = backend.SubscribeStreamStatusOK +// } + +// return &backend.SubscribeStreamResponse{ +// Status: status, +// }, nil +// } + +// func (d *Datasource) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error) { +// return &backend.PublishStreamResponse{ +// Status: backend.PublishStreamStatusPermissionDenied, +// }, nil +// } + +// func (d *Datasource) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error { +// errChan := make(chan error) +// backend.Logger.Info("Streaming: RunStream called", "Path", req.Path) +// // run each channel subscription in a goroutine. +// go d.subscribeToWebsocketChannel(ctx, req.Path, sender, errChan) +// return <-errChan +// } + +// func (d *Datasource) subscribeToWebsocketChannel(ctx context.Context, Path string, sender *backend.StreamSender, errchan chan error) { +// // Get the WebID for the channel construct associated with the given path +// WebID := d.channelConstruct[Path].WebID + +// // Get or create a websocket connection for the given WebID +// err := d.getOrCreateWebsocketConnection(ctx, WebID) +// if err != nil { +// errchan <- fmt.Errorf("error connecting to WebSocket: %v", err) +// return +// } + +// // Add the sender to the list of senders for the given WebID +// d.addSender(WebID, sender) + +// // run the send stream messages as a routine, use the context so that the routine +// // will be cancelled when the context is cancelled +// go d.sendStreamMessagesToSender(ctx, WebID, sender, Path, errchan, d.streamChannels[WebID]) +// } + +// func (d *Datasource) getOrCreateWebsocketConnection(ctx context.Context, WebID string) error { +// // Lock the mutex for the websocket connections by WebID map +// d.websocketConnectionsMutex.Lock() +// defer d.websocketConnectionsMutex.Unlock() + +// // Check if a websocket connection already exists for the given WebID +// _, ok := d.websocketConnections[WebID] +// if !ok { +// // If a connection doesn't exist, create a new one +// var err error +// conn, err := d.createWebsocketConnection(WebID) +// if err != nil { +// return err +// } +// d.websocketConnections[WebID] = conn +// // Start reading and sending messages for the given WebID +// streamChannel := make(chan []byte, 100) +// d.streamChannels[WebID] = streamChannel +// // run the read websocket messages as a routine, ignore context so that one websocket +// // connection can be used for multiple channels provided their WebIDs are the same +// go d.readWebsocketMessages(conn, WebID, streamChannel) + +// } else { +// backend.Logger.Info("Streaming: Reusing existing websocket connection", "WebID", WebID) +// } +// return nil +// } + +// func (d *Datasource) createWebsocketConnection(WebID string) (*websocket.Conn, error) { +// backend.Logger.Info("Streaming: Creating new websocket connection", "WebID", WebID) +// if WebID == "" { +// backend.Logger.Error("Streaming: WebID is empty") +// return nil, errors.New("WebID is empty") +// } + +// // Construct the URI for the websocket connection +// uri := strings.Replace(d.settings.URL, "https://", "wss://", 1) +// uri = uri + "/streams/" + WebID + "/channel?includeInitialValues=true" + +// // Set the headers for the websocket connection +// header := http.Header{} +// userpass := d.settings.BasicAuthUser + ":" + d.settings.DecryptedSecureJSONData["basicAuthPassword"] +// header.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(userpass))) + +// // Dial the websocket connection +// conn, _, err := websocket.DefaultDialer.Dial(uri, header) +// if err != nil { +// return nil, err +// } +// return conn, nil +// } + +// func (d *Datasource) readWebsocketMessages(conn *websocket.Conn, WebID string, streamChannel chan []byte) { +// for { +// _, message, err := conn.ReadMessage() +// if err != nil { +// _, ok := d.websocketConnections[WebID] +// if !ok { +// return +// } +// backend.Logger.Info("Error reading websocket message, closing all associated streams:", "err", err) +// d.sendersByWebIDMutex.Lock() +// delete(d.websocketConnections, WebID) +// for s := range d.sendersByWebID[WebID] { +// delete(d.sendersByWebID[WebID], s) +// } +// d.sendersByWebIDMutex.Unlock() +// conn.Close() +// return +// } +// streamChannel <- message +// } +// } + +// // FIXME there is a bug here that causes the stream sender to not pick up all events +// func (d *Datasource) sendStreamMessagesToSender(ctx context.Context, WebID string, senders *backend.StreamSender, Path string, errchan chan error, streamChannel chan []byte) { +// for { +// select { +// case <-ctx.Done(): +// backend.Logger.Info("Streaming: sendStreamMessagesToSenders: Context done, checking for orphaned web sockets", "Path", Path) +// d.removeSender(WebID, senders) +// d.checkForOrphanedWebSockets(WebID) +// // FIXME: this needs to be re-added. Removed for testing other bug fixes. +// //delete(d.channelConstruct, Path) +// errchan <- errors.New("context done") +// return +// case message, ok := <-streamChannel: +// if !ok { +// backend.Logger.Info("Streaming: Channel closed, checking for orphaned web sockets") +// errchan <- errors.New("streaming: Channel closed") +// d.removeSender(WebID, senders) +// d.checkForOrphanedWebSockets(WebID) +// return +// } +// frame := StreamingResponse{} +// err := json.Unmarshal(message, &frame) +// if err != nil { +// backend.Logger.Info("Error unmarshalling message:", err) +// continue +// } +// items := frame.getItems() +// Type := d.getTypeForWebID(WebID) +// DigitalState := d.getDigitalStateforWebID(WebID) +// framedata, _ := convertItemsToDataFrame(frame.Items[0].Name, *items, Type, DigitalState, false) +// d.sendersByWebIDMutex.Lock() +// specsender := d.sendersByWebID[WebID] +// for s := range specsender { +// err := s.SendFrame(framedata, data.IncludeDataOnly) +// if err != nil { +// backend.Logger.Info("Error sending frame:", err) +// backend.Logger.Info("Streaming: Removing sender for closed channel") +// d.removeSender(WebID, senders) +// remainingSenders := d.hasSendersForWebID(WebID) +// backend.Logger.Info("Streaming: Checking if there are additional senders for WebID", "WebID", WebID, "remainingSenders", remainingSenders) +// if !remainingSenders { +// backend.Logger.Info("Streaming: Closing websocket connection for WebID", "WebID", WebID) +// d.checkForOrphanedWebSockets(WebID) +// } +// errchan <- errors.New("streaming: Channel closed") +// return +// } +// } +// d.sendersByWebIDMutex.Unlock() +// } +// } +// } + +// func (d *Datasource) checkForOrphanedWebSockets(WebID string) { +// d.sendersByWebIDMutex.Lock() +// d.websocketConnectionsMutex.Lock() +// // Check if the WebID has any senders +// if len(d.sendersByWebID[WebID]) == 0 { +// backend.Logger.Info("Streaming: Closing orphaned web socket for WebID", "WebID", WebID) +// // we remove the websocket connection and then close it +// // this allows us to gracefully handle the error in the readWebsocketMessages function +// ws := d.websocketConnections[WebID] +// delete(d.websocketConnections, WebID) +// delete(d.streamChannels, WebID) +// ws.Close() +// } +// d.sendersByWebIDMutex.Unlock() +// d.websocketConnectionsMutex.Unlock() +// } + +// func (d *Datasource) addSender(WebID string, sender *backend.StreamSender) { +// d.sendersByWebIDMutex.Lock() +// if _, ok := d.sendersByWebID[WebID]; !ok { +// d.sendersByWebID[WebID] = make(map[*backend.StreamSender]bool) +// } +// d.sendersByWebID[WebID][sender] = true +// d.sendersByWebIDMutex.Unlock() +// } + +// func (d *Datasource) removeSender(WebID string, sender *backend.StreamSender) { +// d.sendersByWebIDMutex.Lock() +// delete(d.sendersByWebID[WebID], sender) +// d.sendersByWebIDMutex.Unlock() +// } + +// func (d *Datasource) hasSendersForWebID(WebID string) bool { +// _, ok := d.sendersByWebID[WebID] +// return ok && len(d.sendersByWebID[WebID]) > 0 +// } diff --git a/pkg/plugin/valueModels.go b/pkg/plugin/valueModels.go new file mode 100644 index 0000000..d386e8e --- /dev/null +++ b/pkg/plugin/valueModels.go @@ -0,0 +1,48 @@ +package plugin + +import ( + "time" + + "github.com/grafana/grafana-plugin-sdk-go/backend" +) + +type PointDigitalState struct { + IsSystem bool `json:"IsSystem"` + Name string `json:"Name"` + Value int `json:"Value"` +} + +type PointSummaryValue struct { + Timestamp string `json:"Timestamp"` + Value interface{} `json:"Value"` + UnitsAbbreviation string `json:"UnitsAbbreviation"` + Good bool `json:"Good"` + Questionable bool `json:"Questionable"` + Substituted bool `json:"Substituted"` + Annotated bool `json:"Annotated"` +} + +func (p PiBatchContentItem) isAnnotated() bool { + return p.Annotated +} + +func (p PiBatchContentItem) isGood() bool { + return p.Good +} + +func (p PiBatchContentItem) isQuestionable() bool { + return p.Questionable +} + +func (p PiBatchContentItem) isSubstituted() bool { + return p.Substituted +} + +func (p PiBatchContentItem) getTimeStamp() time.Time { + timeLayout := "2006-01-02T15:04:05.999999999Z07:00" + timestamp, err := time.Parse(timeLayout, p.Timestamp) + if err != nil { + backend.Logger.Error("Error parsing timestamp", "error", err) + } + return timestamp +} diff --git a/pkg/plugin/webidcache.go b/pkg/plugin/webidcache.go new file mode 100644 index 0000000..ce328fe --- /dev/null +++ b/pkg/plugin/webidcache.go @@ -0,0 +1,183 @@ +package plugin + +import ( + "context" + "encoding/json" + "reflect" + "strings" + "time" + + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/log" +) + +type WebIDCacheEntry struct { + Path string + WebID string + Type reflect.Type + DigitalState bool + ExpTime time.Time +} + +type WebIDResponsePiPoint struct { + WebID string `json:"WebId"` + Name string `json:"Name"` + Path string `json:"Path"` + Type string `json:"PointType"` + DigitalSetName string `json:"DigitalSetName"` +} + +func (w *WebIDResponsePiPoint) getType() string { + return w.Type +} + +func (w *WebIDResponsePiPoint) getWebID() string { + return w.WebID +} + +func (w *WebIDResponsePiPoint) getDigitalSetName() string { + return w.DigitalSetName +} + +type WebIDResponseAttribute struct { + WebID string `json:"WebId"` + Name string `json:"Name"` + Path string `json:"Path"` + Type string `json:"Type"` + DigitalSetName string `json:"DigitalSetName"` +} + +func (w *WebIDResponseAttribute) getType() string { + return w.Type +} + +func (w *WebIDResponseAttribute) getWebID() string { + return w.WebID +} + +func (w *WebIDResponseAttribute) getDigitalSetName() string { + return w.DigitalSetName +} + +type WebIDResponse interface { + getType() string + getWebID() string + getDigitalSetName() string +} + +func (d *Datasource) getWebID(ctx context.Context, path string, isPiPoint bool) (WebIDCacheEntry, error) { + WebIDCache, ok := d.webIDCache[path] + + if ok && time.Now().Before(WebIDCache.ExpTime) { + log.DefaultLogger.Debug("WebID cache hit", "path", path) + return WebIDCache, nil + } + WebIDCache = WebIDCacheEntry{} + c, err := d.requestWebID(ctx, path, isPiPoint) + if err != nil { + log.DefaultLogger.Error("WebID cache error", "path", path, "error", err) + return WebIDCache, err + } + log.DefaultLogger.Debug("WebID cache added", "path", path) + d.webIDCache[path] = c + backend.Logger.Info("WebID cache", "entry", c) + return c, nil +} + +// Fixme: missing point type +func (d *Datasource) requestWebID(ctx context.Context, path string, isPiPoint bool) (WebIDCacheEntry, error) { + uri := "" + if isPiPoint { + uri = "/points?selectedFields=WebId%3BName%3BPath%3BPointType%3BDigitalSetName&path=\\\\" + uri += strings.Replace(strings.Replace(path, "|", "\\", -1), ";", "\\", -1) + } else { + uri = "/attributes?selectedFields=WebId%3BName%3BPath%3BType%3BDigitalSetName&path=\\\\" + uri += path + } + log.DefaultLogger.Info("WebID request", "uri", uri) + + r, e := d.apiGet(ctx, uri) + if e != nil { + return WebIDCacheEntry{}, e + } + + var response WebIDResponse + if isPiPoint { + response = &WebIDResponsePiPoint{} + } else { + response = &WebIDResponseAttribute{} + } + json.Unmarshal(r, &response) + + dataType := getValueType(response.getType()) + + return WebIDCacheEntry{ + Path: path, + WebID: response.getWebID(), + Type: dataType, + DigitalState: response.getDigitalSetName() != "", + ExpTime: time.Now().Add(5 * time.Minute), + }, nil +} + +func getValueType(Type string) reflect.Type { + var dataType reflect.Type + switch Type { + case "Boolean": + dataType = reflect.TypeOf([]bool{}) + case "Byte": + dataType = reflect.TypeOf([]byte{}) + case "DateTime": + dataType = reflect.TypeOf(time.Time{}) + case "Single", "Double", "Float16", "Float32", "Float64": + dataType = reflect.TypeOf([]float64{}) + case "GUID": + dataType = reflect.TypeOf([]string{}) + case "Int16", "Int32": + dataType = reflect.TypeOf([]int32{}) + case "Int64": + dataType = reflect.TypeOf([]int64{}) + case "String": + dataType = reflect.TypeOf([]string{}) + case "Timestamp": + dataType = reflect.TypeOf([]time.Time{}) + case "Digital": + dataType = reflect.TypeOf([]string{}) + case "Blob": + dataType = reflect.TypeOf([]byte{}) + default: + dataType = reflect.TypeOf([]string{}) + } + return dataType +} + +func cleanWebIDCache(webIDCache map[string]WebIDCacheEntry) { + now := time.Now() + log.DefaultLogger.Debug("Scanning WebID cache...") + for key, entry := range webIDCache { + if now.Sub(entry.ExpTime) > 0*time.Minute { + log.DefaultLogger.Debug("Removing aged WebID: ", entry.Path) + delete(webIDCache, key) + } + } +} + +func (d *Datasource) getTypeForWebID(webID string) reflect.Type { + for _, entry := range d.webIDCache { + if entry.WebID == webID { + return entry.Type + } + } + // If the specified webID is not found in the webIDCache, return type of string. + return reflect.TypeOf([]string{}) +} + +func (d *Datasource) getDigitalStateforWebID(webID string) bool { + for _, entry := range d.webIDCache { + if entry.WebID == webID { + return entry.DigitalState + } + } + // If the specified webID is not found in the webIDCache, return false + return false +} diff --git a/src/datasource.ts b/src/datasource.ts index 44d9130..9c28d86 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -1,46 +1,57 @@ -import { each, filter, flatten, forOwn, groupBy, keys, map, uniq, omitBy } from 'lodash'; +import { + each, + filter, + //flatten, + //forOwn, + //groupBy, + //keys, + map, + //uniq, + //omitBy +} from 'lodash'; + import { Observable, of } from 'rxjs'; import { - DataQueryRequest, - DataQueryResponse, - DataSourceApi, + //DataQueryRequest, + //DataQueryResponse, + //DataSourceApi, DataSourceInstanceSettings, AnnotationEvent, MetricFindValue, - Labels, + //Labels, AnnotationQuery, DataFrame, - toDataFrame, + //toDataFrame, } from '@grafana/data'; -import { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime'; +import { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv, DataSourceWithBackend} from '@grafana/runtime'; import { PIWebAPIQuery, PIWebAPIDataSourceJsonData, PiDataServer, - PiwebapTargetRsp, - PiwebapiElementPath, + //PiwebapTargetRsp, + //PiwebapiElementPath, PiwebapiInternalRsp, PiwebapiRsp, } from './types'; import { - checkNumber, - convertTimeSeriesToDataFrame, - convertToTableData, - getFinalUrl, - getLastPath, - getPath, - isAllSelected, - lowerCaseFirstLetter, + //checkNumber, + //convertTimeSeriesToDataFrame, + //convertToTableData, + //getFinalUrl, + //getLastPath, + //getPath, + //isAllSelected, + //lowerCaseFirstLetter, metricQueryTransform, - noDataReplace, - parseRawQuery, + //noDataReplace, + //parseRawQuery, } from 'helper'; import { PiWebAPIAnnotationsQueryEditor } from 'query/AnnotationsQueryEditor'; -export class PiWebAPIDatasource extends DataSourceApi { +export class PiWebAPIDatasource extends DataSourceWithBackend { piserver: PiDataServer; afserver: PiDataServer; afdatabase: PiDataServer; @@ -102,47 +113,6 @@ export class PiWebAPIDatasource extends DataSourceApi): Promise { - if (options.targets.length === 1 && !!options.targets[0].isAnnotation) { - return this.processAnnotationQuery(options); - } - - const query = this.buildQueryParameters(options); - - if (query.targets.length <= 0) { - return Promise.resolve({ data: [] }); - } else { - return Promise.all(this.getStream(query)).then((targetResponses) => { - let flattened: PiwebapTargetRsp[] = []; - each(targetResponses, (tr) => { - each(tr, (item) => flattened.push(item)); - }); - flattened = flattened.filter((v) => v.datapoints.length > 0); - // handle no data properly - if (flattened.length === 0) { - return { data: [] }; - } - const response: DataQueryResponse = { - data: flattened - .sort((a, b) => { - return +(a.target > b.target) || +(a.target === b.target) - 1; - }) - .map((d) => convertTimeSeriesToDataFrame(d)), - }; - return response; - }); - } - } - /** * Datasource Implementation. * Used for testing datasource in datasource configuration pange @@ -279,93 +249,93 @@ export class PiWebAPIDatasource extends DataSourceApi): Promise { - const annotationQuery = options.targets[0]; - - const categoryName = annotationQuery.categoryName - ? this.templateSrv.replace(annotationQuery.categoryName, options.scopedVars, 'glob') - : null; - const nameFilter = annotationQuery.nameFilter - ? this.templateSrv.replace(annotationQuery.nameFilter, options.scopedVars, 'glob') - : null; - const templateName = annotationQuery.template ? annotationQuery.template.Name : null; - const annotationOptions = { - datasource: annotationQuery.datasource, - showEndTime: annotationQuery.showEndTime, - regex: annotationQuery.regex, - attribute: annotationQuery.attribute, - categoryName: categoryName, - templateName: templateName, - nameFilter: nameFilter, - }; - - const filter = []; - if (!!annotationOptions.categoryName) { - filter.push('categoryName=' + annotationOptions.categoryName); - } - if (!!annotationOptions.nameFilter) { - filter.push('nameFilter=' + annotationOptions.nameFilter); - } - if (!!annotationOptions.templateName) { - filter.push('templateName=' + annotationOptions.templateName); - } - if (!filter.length) { - return Promise.resolve({ data: [] }); - } - filter.push('startTime=' + options.range.from.toISOString()); - filter.push('endTime=' + options.range.to.toISOString()); - - if (annotationOptions.attribute && annotationOptions.attribute.enable) { - let resourceUrl = - this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name'; - if (annotationOptions.attribute.name && annotationOptions.attribute.name.trim().length > 0) { - resourceUrl += '&nameFilter=' + annotationOptions.attribute.name.trim(); - } - const query: any = { - '1': { - Method: 'GET', - Resource: - this.piwebapiurl + - '/assetdatabases/' + - annotationQuery.database?.WebId + - '/eventframes?' + - filter.join('&'), - }, - '2': { - Method: 'GET', - RequestTemplate: { - Resource: resourceUrl, - }, - Parameters: ['$.1.Content.Items[*].WebId'], - ParentIds: ['1'], - }, - }; - return this.restBatch(query).then((result) => { - const data = result.data['1'].Content; - const valueData = result.data['2'].Content; - return { - data: convertToTableData(data.Items!, valueData.Items).map((r) => toDataFrame(r)), - }; - }); - } else { - return this.restGet( - '/assetdatabases/' + annotationQuery.database?.WebId + '/eventframes?' + filter.join('&') - ).then((result) => { - return { - data: convertToTableData(result.data.Items!).map((r) => toDataFrame(r)), - }; - }); - } - } + // /** + // * Datasource Implementation. + // * This queries PI Web API for Event Frames and converts them into annotations. + // * + // * @param {any} options - Annotation options, usually the Event Frame Category. + // * @returns - A Grafana annotation. + // * + // * @memberOf PiWebApiDatasource + // */ + // private processAnnotationQuery(options: DataQueryRequest): Promise { + // const annotationQuery = options.targets[0]; + + // const categoryName = annotationQuery.categoryName + // ? this.templateSrv.replace(annotationQuery.categoryName, options.scopedVars, 'glob') + // : null; + // const nameFilter = annotationQuery.nameFilter + // ? this.templateSrv.replace(annotationQuery.nameFilter, options.scopedVars, 'glob') + // : null; + // const templateName = annotationQuery.template ? annotationQuery.template.Name : null; + // const annotationOptions = { + // datasource: annotationQuery.datasource, + // showEndTime: annotationQuery.showEndTime, + // regex: annotationQuery.regex, + // attribute: annotationQuery.attribute, + // categoryName: categoryName, + // templateName: templateName, + // nameFilter: nameFilter, + // }; + + // const filter = []; + // if (!!annotationOptions.categoryName) { + // filter.push('categoryName=' + annotationOptions.categoryName); + // } + // if (!!annotationOptions.nameFilter) { + // filter.push('nameFilter=' + annotationOptions.nameFilter); + // } + // if (!!annotationOptions.templateName) { + // filter.push('templateName=' + annotationOptions.templateName); + // } + // if (!filter.length) { + // return Promise.resolve({ data: [] }); + // } + // filter.push('startTime=' + options.range.from.toISOString()); + // filter.push('endTime=' + options.range.to.toISOString()); + + // if (annotationOptions.attribute && annotationOptions.attribute.enable) { + // let resourceUrl = + // this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name'; + // if (annotationOptions.attribute.name && annotationOptions.attribute.name.trim().length > 0) { + // resourceUrl += '&nameFilter=' + annotationOptions.attribute.name.trim(); + // } + // const query: any = { + // '1': { + // Method: 'GET', + // Resource: + // this.piwebapiurl + + // '/assetdatabases/' + + // annotationQuery.database?.WebId + + // '/eventframes?' + + // filter.join('&'), + // }, + // '2': { + // Method: 'GET', + // RequestTemplate: { + // Resource: resourceUrl, + // }, + // Parameters: ['$.1.Content.Items[*].WebId'], + // ParentIds: ['1'], + // }, + // }; + // return this.restBatch(query).then((result) => { + // const data = result.data['1'].Content; + // const valueData = result.data['2'].Content; + // return { + // data: convertToTableData(data.Items!, valueData.Items).map((r) => toDataFrame(r)), + // }; + // }); + // } else { + // return this.restGet( + // '/assetdatabases/' + annotationQuery.database?.WebId + '/eventframes?' + filter.join('&') + // ).then((result) => { + // return { + // data: convertToTableData(result.data.Items!).map((r) => toDataFrame(r)), + // }; + // }); + // } + // } /** * Converts a PIWebAPI Event Frame response to a Grafana Annotation @@ -415,517 +385,517 @@ export class PiWebAPIDatasource extends DataSourceApi) { - options.targets = filter(options.targets, (target) => { - if (!target || !target.target || !!target.hide) { - return false; - } - return !target.target.startsWith('Select AF'); - }); - - options.targets = map(options.targets, (target) => { - if (!!target.rawQuery && !!target.target) { - const { attributes, elementPath } = parseRawQuery(this.templateSrv.replace(target.target, options.scopedVars)); - target.attributes = attributes; - target.elementPath = elementPath; - } - const ds = this; - const tar = { - target: this.templateSrv.replace(target.elementPath, options.scopedVars), - elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars), - elementPathArray: [ - { - path: this.templateSrv.replace(target.elementPath, options.scopedVars), - variable: '', - } as PiwebapiElementPath, - ], - attributes: map(target.attributes, (att) => - this.templateSrv.replace(att.value?.value || att, options.scopedVars) - ), - isAnnotation: !!target.isAnnotation, - segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)), - display: target.display, - refId: target.refId, - hide: target.hide, - interpolate: target.interpolate || { enable: false }, - useLastValue: target.useLastValue || { enable: false }, - useUnit: target.useUnit || { enable: false }, - recordedValues: target.recordedValues || { enable: false }, - digitalStates: target.digitalStates || { enable: false }, - webid: target.webid ?? '', - webids: target.webids || [], - regex: target.regex || { enable: false }, - expression: target.expression || '', - summary: target.summary || { types: [] }, - startTime: options.range.from, - endTime: options.range.to, - isPiPoint: !!target.isPiPoint, - scopedVars: options.scopedVars, - }; - - if (tar.expression) { - tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars); - } - - if (tar.summary.types !== undefined) { - tar.summary.types = filter(tar.summary.types, (item) => { - return item !== undefined && item !== null && item !== ''; - }); - } - - // explode All or Multi-selection - const varsKeys = keys(options.scopedVars); - this.templateSrv.getVariables().forEach((v: any) => { - if (isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) { - // All selection - const variables = v.options.filter((o: any) => !o.selected); - // attributes - tar.attributes = tar.attributes.map((attr: string) => - variables.map((vv: any) => - !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-z 0-9,-_]+}/gi, vv.value) - ) - ); - tar.attributes = uniq(flatten(tar.attributes)); - // elementPath - tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue); - } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) { - // Multi-selection - const variables = v.options.filter((o: any) => o.selected); - // attributes - const query = v.current.value.join(','); - tar.attributes = tar.attributes.map((attr: string) => - variables.map((vv: any) => attr.replace(`{${query}}`, vv.value)) - ); - tar.attributes = uniq(flatten(tar.attributes)); - // elementPath - tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`); - } - }); - - return tar; - }); - - return options; - } - - /** - * Resolve PIWebAPI response 'value' data to value - timestamp pairs. - * - * @param {any} value - A list of PIWebAPI values. - * @param {any} target - The target Grafana metric. - * @param {boolean} isSummary - Boolean for tracking if data is of summary class. - * @returns - An array of Grafana value, timestamp pairs. - * - */ - private parsePiPointValueData(value: any, target: any, isSummary: boolean) { - const datapoints: any[] = []; - if (Array.isArray(value)) { - each(value, (item) => { - this.piPointValue(isSummary ? item.Value : item, target, isSummary, datapoints); - }); - } else { - this.piPointValue(value, target, isSummary, datapoints); - } - return datapoints; - } - - /** - * Resolve PIWebAPI response 'value' data to value - timestamp pairs. - * - * @param {any} value - PI Point value. - * @param {any} target - The target grafana metric. - * @param {boolean} isSummary - Boolean for tracking if data is of summary class. - * @param {any[]} datapoints - Array with Grafana datapoints. - * - */ - private piPointValue(value: any, target: any, isSummary: boolean, datapoints: any[]) { - // @ts-ignore - const { grafanaDataPoint, previousValue, drop } = noDataReplace( - value, - target.summary.nodata, - this.parsePiPointValue(value, target, isSummary) - ); - if (!drop) { - datapoints.push(grafanaDataPoint); - } - } - - /** - * Convert a PI Point value to use Grafana value/timestamp. - * - * @param {any} value - PI Point value. - * @param {any} target - The target grafana metric. - * @param {boolean} isSummary - Boolean for tracking if data is of summary class. - * @returns - Grafana value pair. - * - */ - private parsePiPointValue(value: any, target: any, isSummary: boolean) { - let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value; - - if (!value.Good || !!target.digitalStates?.enable) { - num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? ''; - return [checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; - } - - return [checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; - } - - /** - * Convert the Pi web api response object to the Grafana Labels object. - * - * @param {PiwebapiRsp} webid - Pi web api response object. - * @returns The converted Labels object. - */ - private toTags(webid: PiwebapiRsp, isPiPoint: boolean): Labels { - const omitArray = ['Path', 'WebId', 'Id', 'ServerTime', 'ServerVersion']; - const obj = omitBy(webid, (value: any, key: string) => !value || !value.length || omitArray.indexOf(key) >= 0); - obj.Element = isPiPoint ? this.piserver.name : getLastPath(webid.Path ?? ''); - const sorted = Object.keys(obj) - .sort() - .reduce((accumulator: any, key: string) => { - accumulator[lowerCaseFirstLetter(key)] = obj[key]; - return accumulator; - }, {}); - return sorted as Labels; - } - - /** - * Process the response from PI Web API for a single item. - * - * @param {any} content - Web response data. - * @param {any} target - The target grafana metric. - * @param {any} name - The target metric name. - * @returns - Parsed metric in target/datapoint json format. - * - * @memberOf PiWebApiDatasource - */ - private processResults( - content: any, - target: any, - name: any, - noTemplate: boolean, - webid: PiwebapiRsp - ): PiwebapTargetRsp[] { - const api = this; - const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0; - if (!target.isPiPoint && !target.display && content.Path) { - if (api.newFormatConfig) { - name = (noTemplate ? getLastPath(content.Path) : getPath(target.elementPathArray, content.Path)) + '|' + name; - } else { - name = noTemplate ? name : getPath(target.elementPathArray, content.Path) + '|' + name; - } - } - if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) { - name = name.replace(new RegExp(target.regex.search), target.regex.replace); - } - if (isSummary) { - const innerResults: PiwebapTargetRsp[] = []; - const groups = groupBy(content.Items, (item: any) => item.Type); - forOwn(groups, (value, key) => { - innerResults.push({ - refId: target.refId, - target: name + '[' + key + ']', - meta: { - path: webid.Path, - pathSeparator: '\\', - }, - tags: api.newFormatConfig ? api.toTags(webid, target.isPiPoint) : {}, - datapoints: api.parsePiPointValueData(value, target, isSummary), - path: webid.Path, - unit: api.useUnitConfig && target.useUnit.enable ? webid.DefaultUnitsName : undefined, - }); - }); - return innerResults; - } - const results: PiwebapTargetRsp[] = [ - { - refId: target.refId, - target: name, - meta: { - path: webid.Path, - pathSeparator: '\\', - }, - tags: api.newFormatConfig ? api.toTags(webid, target.isPiPoint) : {}, - datapoints: api.parsePiPointValueData(content.Items || content.Value, target, isSummary), - path: webid.Path, - unit: api.useUnitConfig && target.useUnit.enable ? webid.DefaultUnitsName : undefined, - }, - ]; - return results; - } - - /** - * Returns a new element path list based on the panel variables. - * - * @param {string} elementPathArray array of element paths - * @param {string} variables the list of variable values - * @param {string} allValue the all value value for the variable - * @returns {PiwebapiElementPath[]} new element path list - */ - private getElementPath( - elementPathArray: PiwebapiElementPath[], - variables: any[], - allValue: string - ): PiwebapiElementPath[] { - // elementPath - let newElementPathArray: PiwebapiElementPath[] = []; - elementPathArray.forEach((elem: PiwebapiElementPath) => { - if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-z 0-9,-_]+}/gi))) { - const temp: PiwebapiElementPath[] = variables.map((vv: any) => { - return { - path: !!allValue - ? elem.path.replace(allValue, vv.value) - : elem.path.replace(/{[a-z 0-9,-_]+}/gi, vv.value), - variable: vv.value, - } as PiwebapiElementPath; - }); - newElementPathArray = newElementPathArray.concat(temp); - } - }); - if (newElementPathArray.length) { - return uniq(flatten(newElementPathArray)); - } - return elementPathArray; - } - - /** - * Gets historical data from a PI Web API stream source. - * - * @param {any} query - Grafana query. - * @returns - Metric data. - * - * @memberOf PiWebApiDatasource - */ - private getStream(query: any): Array> { - const ds = this; - const results: Array> = []; - - each(query.targets, (target) => { - // pi point config disabled - if (target.isPiPoint && !ds.piPointConfig) { - console.error('Trying to call Pi Point server with Pi Point config disabled'); - return; - } - target.attributes = filter(target.attributes || [], (attribute) => { - return 1 && attribute; - }); - let url = ''; - const isSummary = target.summary && target.summary.types && target.summary.types.length > 0; - const isInterpolated = target.interpolate && target.interpolate.enable; - const isRecorded = target.recordedValues && target.recordedValues.enable; - // perhaps add a check to see if interpolate override time < query.interval - const intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval; - const timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON(); - const targetName = target.expression || target.elementPath; - const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null; - if (target.expression) { - url += '/calculation'; - if (target.useLastValue?.enable) { - url += '/times?&time=' + query.range.to.toJSON(); - } else if (isSummary) { - url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : ''); - } else if (isInterpolated) { - url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime; - } else if (isRecorded) { - url += '/recorded' + timeRange; - } else { - const windowWidth = 40; - const diff = Math.floor((query.range.to.valueOf() - query.range.from.valueOf()) / windowWidth); - let timeQuery = 'time=' + query.range.from.toJSON(); - for (let i = 1; i < windowWidth; i ++) { - const newTime = query.range.from.valueOf() + i * diff; - timeQuery += '&time=' + new Date(newTime).toISOString(); - } - timeQuery += '&time=' + query.range.to.toJSON(); - url += '/times?' + timeQuery; - } - url += '&expression=' + encodeURIComponent(target.expression.replace(/\${intervalTime}/g, intervalTime)); - if (target.attributes.length > 0) { - results.push(ds.createBatchGetWebId(target, url, displayName)); - } else { - results.push( - ds.restGetWebId(target.elementPath, false).then((webidresponse: PiwebapiRsp) => { - return ds - .restPost(url + '&webId=' + webidresponse.WebId) - .then((response: any) => - ds.processResults(response.data, target, displayName || targetName, false, webidresponse) - ) - .catch((err: any) => (ds.error = err)); - }) - ); - } - } else { - url += '/streamsets'; - if (target.useLastValue?.enable) { - url += '/value?time=' + query.range.to.toJSON(); - } else if (isSummary) { - url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary); - } else if (isInterpolated) { - url += '/interpolated' + timeRange + '&interval=' + intervalTime; - } else if (isRecorded) { - const maxNumber = - target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber) - ? target.recordedValues.maxNumber - : query.maxDataPoints; - url += '/recorded' + timeRange + '&maxCount=' + maxNumber; - } else { - url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints; - } - results.push(ds.createBatchGetWebId(target, url, displayName)); - } - }); - - return results; - } - - /** - * Process batch response to metric data. - * - * @param {any} response - The batch response. - * @param {any} target - Grafana query target. - * @param {string} displayName - The display name. - * @returns - Process metric data. - */ - private handleBatchResponse(response: any, target: any, displayName: string | null): Promise { - const targetName = target.expression || target.elementPath; - const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path; - const totalSize = noTemplate ? target.attributes.length : target.elementPathArray.length; - const targetResults: PiwebapTargetRsp[] = []; - for (let index = 1; index <= totalSize; index++) { - const dataKey = `Req${index + 1000}`; - const path = response.config.data[dataKey].Headers ? response.config.data[dataKey].Headers['Asset-Path'] : null; - const data = response.data[dataKey]; - if (data.Status >= 400) { - continue; - } - - let webid: PiwebapiRsp; - if (!!path) { - webid = this.webidCache.get(path); - } else { - const respData = response.data[`Req${index}`].Content; - webid = { - Path: respData.Path!, - Type: respData.Type || respData.PointType, - DefaultUnitsName: respData.DefaultUnitsName || respData.EngineeringUnits, - Description: respData.Description || respData.Descriptor, - WebId: respData.WebId, - Name: respData.Name, - }; - this.webidCache.set(webid.Path!, webid); - } - - if (target.expression) { - each( - this.processResults(data.Content, target, displayName || webid.Name || targetName, noTemplate, webid), - (targetResult) => targetResults.push(targetResult) - ); - } else { - each(data.Content.Items, (item) => { - each( - this.processResults(item, target, displayName || item.Name || targetName, noTemplate, webid), - (targetResult) => targetResults.push(targetResult) - ); - }); - } - } - return Promise.resolve(targetResults); - } - - /** - * Creates a batch query pair. - * - * @param {boolean} isPiPoint - is Pi point flag. - * @param {string} elementPath - the PI element path or PI Data server name. - * @param {string} attribute - the attribute or PI point name. - * @param {any} query - the batch query to build. - * @param {number} index - the current query index. - * @param {boolean} replace - is pi point and calculation. - * @param {string} url - the base url to call. - */ - private createQueryPair( - isPiPoint: boolean, - elementPath: string, - attribute: string, - query: any, - index: number, - replace: boolean, - url: string - ) { - let path = ''; - let assetPath = ''; - if (isPiPoint) { - assetPath = '\\\\' + elementPath + '\\' + attribute; - path = '/points?selectedFields=Descriptor%3BPointType%3BEngineeringUnits%3BWebId%3BName%3BPath&path=' + assetPath; - } else { - assetPath = '\\\\' + elementPath + '|' + attribute; - path = '/attributes?selectedFields=Type%3BDefaultUnitsName%3BDescription%3BWebId%3BName%3BPath&path=' + assetPath; - } - - const data = this.webidCache.get(assetPath); - if (!!data) { - query[`Req${index + 1000}`] = { - Method: 'GET', - Resource: - this.piwebapiurl + - getFinalUrl(replace, { Name: attribute }, url) + - '&webId=' + - (replace ? this.piserver.webid : data.WebId), - Headers: { - 'Asset-Path': assetPath, - }, - }; - } else { - query[`Req${index}`] = { - Method: 'GET', - Resource: this.piwebapiurl + path, - }; - query[`Req${index + 1000}`] = { - Method: 'GET', - ParentIds: [`Req${index}`], - Parameters: [`$.Req${index}.Content.WebId`], - Resource: - this.piwebapiurl + - getFinalUrl(replace, { Name: attribute }, url) + - (replace ? '&webId=' + this.piserver.webid : '&webId={0}'), - }; - } - } - - /** - * Get metric data using Batch. - * - * @param {any} target - Grafana query target. - * @param {string} url The base URL for the query. - * @param {string} displayName - The display name. - * @returns - Metric data. - */ - private createBatchGetWebId(target: any, url: string, displayName: string | null): Promise { - const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path; - const replace = target.isPiPoint && !!target.expression; - const query: any = {}; - let index = 1; - for (const attribute of target.attributes) { - if (noTemplate) { - this.createQueryPair(target.isPiPoint, target.elementPath, attribute, query, index, replace, url); - index++; - } else { - target.elementPathArray.forEach((elementPath: PiwebapiElementPath) => { - this.createQueryPair(target.isPiPoint, elementPath.path, attribute, query, index, replace, url); - index++; - }); - } - } - return this.restBatch(query).then((response: any) => this.handleBatchResponse(response, target, displayName)); - } + // /** + // * Builds the PIWebAPI query parameters. + // * + // * @param {any} options - Grafana query and panel options. + // * @returns - PIWebAPI query parameters. + // * + // * @memberOf PiWebApiDatasource + // */ + // private buildQueryParameters(options: DataQueryRequest) { + // options.targets = filter(options.targets, (target) => { + // if (!target || !target.target || !!target.hide) { + // return false; + // } + // return !target.target.startsWith('Select AF'); + // }); + + // options.targets = map(options.targets, (target) => { + // if (!!target.rawQuery && !!target.target) { + // const { attributes, elementPath } = parseRawQuery(this.templateSrv.replace(target.target, options.scopedVars)); + // target.attributes = attributes; + // target.elementPath = elementPath; + // } + // const ds = this; + // const tar = { + // target: this.templateSrv.replace(target.elementPath, options.scopedVars), + // elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars), + // elementPathArray: [ + // { + // path: this.templateSrv.replace(target.elementPath, options.scopedVars), + // variable: '', + // } as PiwebapiElementPath, + // ], + // attributes: map(target.attributes, (att) => + // this.templateSrv.replace(att.value?.value || att, options.scopedVars) + // ), + // isAnnotation: !!target.isAnnotation, + // segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)), + // display: target.display, + // refId: target.refId, + // hide: target.hide, + // interpolate: target.interpolate || { enable: false }, + // useLastValue: target.useLastValue || { enable: false }, + // useUnit: target.useUnit || { enable: false }, + // recordedValues: target.recordedValues || { enable: false }, + // digitalStates: target.digitalStates || { enable: false }, + // webid: target.webid ?? '', + // webids: target.webids || [], + // regex: target.regex || { enable: false }, + // expression: target.expression || '', + // summary: target.summary || { types: [] }, + // startTime: options.range.from, + // endTime: options.range.to, + // isPiPoint: !!target.isPiPoint, + // scopedVars: options.scopedVars, + // }; + + // if (tar.expression) { + // tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars); + // } + + // if (tar.summary.types !== undefined) { + // tar.summary.types = filter(tar.summary.types, (item) => { + // return item !== undefined && item !== null && item !== ''; + // }); + // } + + // // explode All or Multi-selection + // const varsKeys = keys(options.scopedVars); + // this.templateSrv.getVariables().forEach((v: any) => { + // if (isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) { + // // All selection + // const variables = v.options.filter((o: any) => !o.selected); + // // attributes + // tar.attributes = tar.attributes.map((attr: string) => + // variables.map((vv: any) => + // !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-z 0-9,-_]+}/gi, vv.value) + // ) + // ); + // tar.attributes = uniq(flatten(tar.attributes)); + // // elementPath + // tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue); + // } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) { + // // Multi-selection + // const variables = v.options.filter((o: any) => o.selected); + // // attributes + // const query = v.current.value.join(','); + // tar.attributes = tar.attributes.map((attr: string) => + // variables.map((vv: any) => attr.replace(`{${query}}`, vv.value)) + // ); + // tar.attributes = uniq(flatten(tar.attributes)); + // // elementPath + // tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`); + // } + // }); + + // return tar; + // }); + + // return options; + // } + + // /** + // * Resolve PIWebAPI response 'value' data to value - timestamp pairs. + // * + // * @param {any} value - A list of PIWebAPI values. + // * @param {any} target - The target Grafana metric. + // * @param {boolean} isSummary - Boolean for tracking if data is of summary class. + // * @returns - An array of Grafana value, timestamp pairs. + // * + // */ + // private parsePiPointValueData(value: any, target: any, isSummary: boolean) { + // const datapoints: any[] = []; + // if (Array.isArray(value)) { + // each(value, (item) => { + // this.piPointValue(isSummary ? item.Value : item, target, isSummary, datapoints); + // }); + // } else { + // this.piPointValue(value, target, isSummary, datapoints); + // } + // return datapoints; + // } + + // /** + // * Resolve PIWebAPI response 'value' data to value - timestamp pairs. + // * + // * @param {any} value - PI Point value. + // * @param {any} target - The target grafana metric. + // * @param {boolean} isSummary - Boolean for tracking if data is of summary class. + // * @param {any[]} datapoints - Array with Grafana datapoints. + // * + // */ + // private piPointValue(value: any, target: any, isSummary: boolean, datapoints: any[]) { + // // @ts-ignore + // const { grafanaDataPoint, previousValue, drop } = noDataReplace( + // value, + // target.summary.nodata, + // this.parsePiPointValue(value, target, isSummary) + // ); + // if (!drop) { + // datapoints.push(grafanaDataPoint); + // } + // } + + // /** + // * Convert a PI Point value to use Grafana value/timestamp. + // * + // * @param {any} value - PI Point value. + // * @param {any} target - The target grafana metric. + // * @param {boolean} isSummary - Boolean for tracking if data is of summary class. + // * @returns - Grafana value pair. + // * + // */ + // private parsePiPointValue(value: any, target: any, isSummary: boolean) { + // let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value; + + // if (!value.Good || !!target.digitalStates?.enable) { + // num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? ''; + // return [checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; + // } + + // return [checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; + // } + + // /** + // * Convert the Pi web api response object to the Grafana Labels object. + // * + // * @param {PiwebapiRsp} webid - Pi web api response object. + // * @returns The converted Labels object. + // */ + // private toTags(webid: PiwebapiRsp, isPiPoint: boolean): Labels { + // const omitArray = ['Path', 'WebId', 'Id', 'ServerTime', 'ServerVersion']; + // const obj = omitBy(webid, (value: any, key: string) => !value || !value.length || omitArray.indexOf(key) >= 0); + // obj.Element = isPiPoint ? this.piserver.name : getLastPath(webid.Path ?? ''); + // const sorted = Object.keys(obj) + // .sort() + // .reduce((accumulator: any, key: string) => { + // accumulator[lowerCaseFirstLetter(key)] = obj[key]; + // return accumulator; + // }, {}); + // return sorted as Labels; + // } + + // /** + // * Process the response from PI Web API for a single item. + // * + // * @param {any} content - Web response data. + // * @param {any} target - The target grafana metric. + // * @param {any} name - The target metric name. + // * @returns - Parsed metric in target/datapoint json format. + // * + // * @memberOf PiWebApiDatasource + // */ + // private processResults( + // content: any, + // target: any, + // name: any, + // noTemplate: boolean, + // webid: PiwebapiRsp + // ): PiwebapTargetRsp[] { + // const api = this; + // const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0; + // if (!target.isPiPoint && !target.display && content.Path) { + // if (api.newFormatConfig) { + // name = (noTemplate ? getLastPath(content.Path) : getPath(target.elementPathArray, content.Path)) + '|' + name; + // } else { + // name = noTemplate ? name : getPath(target.elementPathArray, content.Path) + '|' + name; + // } + // } + // if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) { + // name = name.replace(new RegExp(target.regex.search), target.regex.replace); + // } + // if (isSummary) { + // const innerResults: PiwebapTargetRsp[] = []; + // const groups = groupBy(content.Items, (item: any) => item.Type); + // forOwn(groups, (value, key) => { + // innerResults.push({ + // refId: target.refId, + // target: name + '[' + key + ']', + // meta: { + // path: webid.Path, + // pathSeparator: '\\', + // }, + // tags: api.newFormatConfig ? api.toTags(webid, target.isPiPoint) : {}, + // datapoints: api.parsePiPointValueData(value, target, isSummary), + // path: webid.Path, + // unit: api.useUnitConfig && target.useUnit.enable ? webid.DefaultUnitsName : undefined, + // }); + // }); + // return innerResults; + // } + // const results: PiwebapTargetRsp[] = [ + // { + // refId: target.refId, + // target: name, + // meta: { + // path: webid.Path, + // pathSeparator: '\\', + // }, + // tags: api.newFormatConfig ? api.toTags(webid, target.isPiPoint) : {}, + // datapoints: api.parsePiPointValueData(content.Items || content.Value, target, isSummary), + // path: webid.Path, + // unit: api.useUnitConfig && target.useUnit.enable ? webid.DefaultUnitsName : undefined, + // }, + // ]; + // return results; + // } + + // /** + // * Returns a new element path list based on the panel variables. + // * + // * @param {string} elementPathArray array of element paths + // * @param {string} variables the list of variable values + // * @param {string} allValue the all value value for the variable + // * @returns {PiwebapiElementPath[]} new element path list + // */ + // private getElementPath( + // elementPathArray: PiwebapiElementPath[], + // variables: any[], + // allValue: string + // ): PiwebapiElementPath[] { + // // elementPath + // let newElementPathArray: PiwebapiElementPath[] = []; + // elementPathArray.forEach((elem: PiwebapiElementPath) => { + // if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-z 0-9,-_]+}/gi))) { + // const temp: PiwebapiElementPath[] = variables.map((vv: any) => { + // return { + // path: !!allValue + // ? elem.path.replace(allValue, vv.value) + // : elem.path.replace(/{[a-z 0-9,-_]+}/gi, vv.value), + // variable: vv.value, + // } as PiwebapiElementPath; + // }); + // newElementPathArray = newElementPathArray.concat(temp); + // } + // }); + // if (newElementPathArray.length) { + // return uniq(flatten(newElementPathArray)); + // } + // return elementPathArray; + // } + + // /** + // * Gets historical data from a PI Web API stream source. + // * + // * @param {any} query - Grafana query. + // * @returns - Metric data. + // * + // * @memberOf PiWebApiDatasource + // */ + // private getStream(query: any): Array> { + // const ds = this; + // const results: Array> = []; + + // each(query.targets, (target) => { + // // pi point config disabled + // if (target.isPiPoint && !ds.piPointConfig) { + // console.error('Trying to call Pi Point server with Pi Point config disabled'); + // return; + // } + // target.attributes = filter(target.attributes || [], (attribute) => { + // return 1 && attribute; + // }); + // let url = ''; + // const isSummary = target.summary && target.summary.types && target.summary.types.length > 0; + // const isInterpolated = target.interpolate && target.interpolate.enable; + // const isRecorded = target.recordedValues && target.recordedValues.enable; + // // perhaps add a check to see if interpolate override time < query.interval + // const intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval; + // const timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON(); + // const targetName = target.expression || target.elementPath; + // const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null; + // if (target.expression) { + // url += '/calculation'; + // if (target.useLastValue?.enable) { + // url += '/times?&time=' + query.range.to.toJSON(); + // } else if (isSummary) { + // url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : ''); + // } else if (isInterpolated) { + // url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime; + // } else if (isRecorded) { + // url += '/recorded' + timeRange; + // } else { + // const windowWidth = 40; + // const diff = Math.floor((query.range.to.valueOf() - query.range.from.valueOf()) / windowWidth); + // let timeQuery = 'time=' + query.range.from.toJSON(); + // for (let i = 1; i < windowWidth; i ++) { + // const newTime = query.range.from.valueOf() + i * diff; + // timeQuery += '&time=' + new Date(newTime).toISOString(); + // } + // timeQuery += '&time=' + query.range.to.toJSON(); + // url += '/times?' + timeQuery; + // } + // url += '&expression=' + encodeURIComponent(target.expression.replace(/\${intervalTime}/g, intervalTime)); + // if (target.attributes.length > 0) { + // results.push(ds.createBatchGetWebId(target, url, displayName)); + // } else { + // results.push( + // ds.restGetWebId(target.elementPath, false).then((webidresponse: PiwebapiRsp) => { + // return ds + // .restPost(url + '&webId=' + webidresponse.WebId) + // .then((response: any) => + // ds.processResults(response.data, target, displayName || targetName, false, webidresponse) + // ) + // .catch((err: any) => (ds.error = err)); + // }) + // ); + // } + // } else { + // url += '/streamsets'; + // if (target.useLastValue?.enable) { + // url += '/value?time=' + query.range.to.toJSON(); + // } else if (isSummary) { + // url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary); + // } else if (isInterpolated) { + // url += '/interpolated' + timeRange + '&interval=' + intervalTime; + // } else if (isRecorded) { + // const maxNumber = + // target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber) + // ? target.recordedValues.maxNumber + // : query.maxDataPoints; + // url += '/recorded' + timeRange + '&maxCount=' + maxNumber; + // } else { + // url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints; + // } + // results.push(ds.createBatchGetWebId(target, url, displayName)); + // } + // }); + + // return results; + // } + + // /** + // * Process batch response to metric data. + // * + // * @param {any} response - The batch response. + // * @param {any} target - Grafana query target. + // * @param {string} displayName - The display name. + // * @returns - Process metric data. + // */ + // private handleBatchResponse(response: any, target: any, displayName: string | null): Promise { + // const targetName = target.expression || target.elementPath; + // const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path; + // const totalSize = noTemplate ? target.attributes.length : target.elementPathArray.length; + // const targetResults: PiwebapTargetRsp[] = []; + // for (let index = 1; index <= totalSize; index++) { + // const dataKey = `Req${index + 1000}`; + // const path = response.config.data[dataKey].Headers ? response.config.data[dataKey].Headers['Asset-Path'] : null; + // const data = response.data[dataKey]; + // if (data.Status >= 400) { + // continue; + // } + + // let webid: PiwebapiRsp; + // if (!!path) { + // webid = this.webidCache.get(path); + // } else { + // const respData = response.data[`Req${index}`].Content; + // webid = { + // Path: respData.Path!, + // Type: respData.Type || respData.PointType, + // DefaultUnitsName: respData.DefaultUnitsName || respData.EngineeringUnits, + // Description: respData.Description || respData.Descriptor, + // WebId: respData.WebId, + // Name: respData.Name, + // }; + // this.webidCache.set(webid.Path!, webid); + // } + + // if (target.expression) { + // each( + // this.processResults(data.Content, target, displayName || webid.Name || targetName, noTemplate, webid), + // (targetResult) => targetResults.push(targetResult) + // ); + // } else { + // each(data.Content.Items, (item) => { + // each( + // this.processResults(item, target, displayName || item.Name || targetName, noTemplate, webid), + // (targetResult) => targetResults.push(targetResult) + // ); + // }); + // } + // } + // return Promise.resolve(targetResults); + // } + + // /** + // * Creates a batch query pair. + // * + // * @param {boolean} isPiPoint - is Pi point flag. + // * @param {string} elementPath - the PI element path or PI Data server name. + // * @param {string} attribute - the attribute or PI point name. + // * @param {any} query - the batch query to build. + // * @param {number} index - the current query index. + // * @param {boolean} replace - is pi point and calculation. + // * @param {string} url - the base url to call. + // */ + // private createQueryPair( + // isPiPoint: boolean, + // elementPath: string, + // attribute: string, + // query: any, + // index: number, + // replace: boolean, + // url: string + // ) { + // let path = ''; + // let assetPath = ''; + // if (isPiPoint) { + // assetPath = '\\\\' + elementPath + '\\' + attribute; + // path = '/points?selectedFields=Descriptor%3BPointType%3BEngineeringUnits%3BWebId%3BName%3BPath&path=' + assetPath; + // } else { + // assetPath = '\\\\' + elementPath + '|' + attribute; + // path = '/attributes?selectedFields=Type%3BDefaultUnitsName%3BDescription%3BWebId%3BName%3BPath&path=' + assetPath; + // } + + // const data = this.webidCache.get(assetPath); + // if (!!data) { + // query[`Req${index + 1000}`] = { + // Method: 'GET', + // Resource: + // this.piwebapiurl + + // getFinalUrl(replace, { Name: attribute }, url) + + // '&webId=' + + // (replace ? this.piserver.webid : data.WebId), + // Headers: { + // 'Asset-Path': assetPath, + // }, + // }; + // } else { + // query[`Req${index}`] = { + // Method: 'GET', + // Resource: this.piwebapiurl + path, + // }; + // query[`Req${index + 1000}`] = { + // Method: 'GET', + // ParentIds: [`Req${index}`], + // Parameters: [`$.Req${index}.Content.WebId`], + // Resource: + // this.piwebapiurl + + // getFinalUrl(replace, { Name: attribute }, url) + + // (replace ? '&webId=' + this.piserver.webid : '&webId={0}'), + // }; + // } + // } + + // /** + // * Get metric data using Batch. + // * + // * @param {any} target - Grafana query target. + // * @param {string} url The base URL for the query. + // * @param {string} displayName - The display name. + // * @returns - Metric data. + // */ + // private createBatchGetWebId(target: any, url: string, displayName: string | null): Promise { + // const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path; + // const replace = target.isPiPoint && !!target.expression; + // const query: any = {}; + // let index = 1; + // for (const attribute of target.attributes) { + // if (noTemplate) { + // this.createQueryPair(target.isPiPoint, target.elementPath, attribute, query, index, replace, url); + // index++; + // } else { + // target.elementPathArray.forEach((elementPath: PiwebapiElementPath) => { + // this.createQueryPair(target.isPiPoint, elementPath.path, attribute, query, index, replace, url); + // index++; + // }); + // } + // } + // return this.restBatch(query).then((response: any) => this.handleBatchResponse(response, target, displayName)); + // } /** * Abstraction for calling the PI Web API REST endpoint @@ -947,101 +917,101 @@ export class PiWebAPIDatasource extends DataSourceApi { - const ds = this; - - // check cache - const cachedWebId = ds.webidCache.get(assetPath); - if (cachedWebId) { - return Promise.resolve({ - ...cachedWebId, - }); - } - - // no cache hit, query server - let path = ''; - if (isPiPoint) { - path = - '/points?selectedFields=Descriptor%3BPointType%3BEngineeringUnits%3BWebId%3BName%3BPath&path=\\\\' + - assetPath.replace('|', '\\'); - } else { - path = - (assetPath.indexOf('|') >= 0 - ? '/attributes?selectedFields=Type%3BDefaultUnitsName%3BDescription%3BWebId%3BName%3BPath&path=\\\\' - : '/elements?selectedFields=Description%3BWebId%3BName%3BPath&path=\\\\') + assetPath; - } - - return this.backendSrv - .datasourceRequest({ - url: this.url + path, - method: 'GET', - headers: { 'Content-Type': 'application/json' }, - }) - .then((response: any) => { - const data = { - Path: assetPath, - Type: response.data.Type || response.data.PointType, - DefaultUnitsName: response.data.DefaultUnitsName || response.data.EngineeringUnits, - Description: response.data.Description || response.data.Descriptor, - WebId: response.data.WebId, - Name: response.data.Name, - }; - ds.webidCache.set(assetPath, data); - return { - ...data, - }; - }); - } - - /** - * Execute a batch query on the PI Web API. - * - * @param {any} batch - Batch JSON query data. - * @returns - Batch response. - * - * @memberOf PiWebApiDatasource - */ - private restBatch(batch: any) { - return this.backendSrv.datasourceRequest({ - url: this.url + '/batch', - data: batch, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'X-Requested-With': 'message/http', - }, - }); - } - - /** - * Execute a POST on the PI Web API. - * - * @param {string} path - The full url of the POST. - * @returns - POST response data. - * - * @memberOf PiWebApiDatasource - */ - private restPost(path: string) { - return this.backendSrv.datasourceRequest({ - url: this.url, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'X-Requested-With': 'message/http', - 'X-PIWEBAPI-HTTP-METHOD': 'GET', - 'X-PIWEBAPI-RESOURCE-ADDRESS': path, - }, - }); - } + // /** + // * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups. + // * + // * @param {string} assetPath - The AF Path or the Pi Point Path (\\ServerName\piPointName) to the asset. + // * @param {boolean} isPiPoint - Flag indicating it's a PI Point + // * @returns - URL query parameters. + // * + // * @memberOf PiWebApiDatasource + // */ + // private restGetWebId(assetPath: string, isPiPoint: boolean): Promise { + // const ds = this; + + // // check cache + // const cachedWebId = ds.webidCache.get(assetPath); + // if (cachedWebId) { + // return Promise.resolve({ + // ...cachedWebId, + // }); + // } + + // // no cache hit, query server + // let path = ''; + // if (isPiPoint) { + // path = + // '/points?selectedFields=Descriptor%3BPointType%3BEngineeringUnits%3BWebId%3BName%3BPath&path=\\\\' + + // assetPath.replace('|', '\\'); + // } else { + // path = + // (assetPath.indexOf('|') >= 0 + // ? '/attributes?selectedFields=Type%3BDefaultUnitsName%3BDescription%3BWebId%3BName%3BPath&path=\\\\' + // : '/elements?selectedFields=Description%3BWebId%3BName%3BPath&path=\\\\') + assetPath; + // } + + // return this.backendSrv + // .datasourceRequest({ + // url: this.url + path, + // method: 'GET', + // headers: { 'Content-Type': 'application/json' }, + // }) + // .then((response: any) => { + // const data = { + // Path: assetPath, + // Type: response.data.Type || response.data.PointType, + // DefaultUnitsName: response.data.DefaultUnitsName || response.data.EngineeringUnits, + // Description: response.data.Description || response.data.Descriptor, + // WebId: response.data.WebId, + // Name: response.data.Name, + // }; + // ds.webidCache.set(assetPath, data); + // return { + // ...data, + // }; + // }); + // } + + // /** + // * Execute a batch query on the PI Web API. + // * + // * @param {any} batch - Batch JSON query data. + // * @returns - Batch response. + // * + // * @memberOf PiWebApiDatasource + // */ + // private restBatch(batch: any) { + // return this.backendSrv.datasourceRequest({ + // url: this.url + '/batch', + // data: batch, + // method: 'POST', + // headers: { + // 'Content-Type': 'application/json', + // 'X-Requested-With': 'message/http', + // }, + // }); + // } + + // /** + // * Execute a POST on the PI Web API. + // * + // * @param {string} path - The full url of the POST. + // * @returns - POST response data. + // * + // * @memberOf PiWebApiDatasource + // */ + // private restPost(path: string) { + // return this.backendSrv.datasourceRequest({ + // url: this.url, + // method: 'POST', + // headers: { + // 'Content-Type': 'application/json', + // 'X-Requested-With': 'message/http', + // 'X-PIWEBAPI-HTTP-METHOD': 'GET', + // 'X-PIWEBAPI-RESOURCE-ADDRESS': path, + // }, + // }); + // } // Get a list of all data (PI) servers private getDataServers(): Promise { diff --git a/src/plugin.json b/src/plugin.json index 7ad4b1a..62486e5 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -3,9 +3,11 @@ "name": "OSIsoft-PI", "type": "datasource", "id": "gridprotectionalliance-osisoftpi-datasource", + "backend": true, + "executable": "gpx_osipiwebapistreaming", "metrics": true, "annotations": true, - "alerting": false, + "alerting": true, "info": { "description": "Datasource plugin for OSIsoft PI Web API", "author": { From 61d98f3623aa138db496f3624041ce9c3113bf88 Mon Sep 17 00:00:00 2001 From: Adam Traeger Date: Sun, 16 Jul 2023 16:10:00 -0500 Subject: [PATCH 02/44] Initial annotation support. This has a hardcoded event frame for testing purposes. --- go.mod | 80 +++++++----- go.sum | 267 ++++++++++++++++++++------------------ pkg/plugin/datasource.go | 95 ++++++++++++-- pkg/plugin/helpers.go | 38 +++++- pkg/plugin/models.go | 2 + pkg/plugin/queryModels.go | 104 +++++++++++++++ src/datasource.ts | 74 ++++++----- src/plugin.json | 2 +- src/types.ts | 62 +++++++++ 9 files changed, 517 insertions(+), 207 deletions(-) diff --git a/go.mod b/go.mod index 0178eeb..de5749b 100644 --- a/go.mod +++ b/go.mod @@ -4,70 +4,86 @@ go 1.20 require ( github.com/go-co-op/gocron v1.18.0 - github.com/google/uuid v1.3.0 github.com/gorilla/websocket v1.5.0 - github.com/grafana/grafana-plugin-sdk-go v0.147.0 + github.com/grafana/grafana-plugin-sdk-go v0.169.0 ) require ( - github.com/BurntSushi/toml v0.3.1 // indirect + github.com/BurntSushi/toml v1.2.1 // indirect github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cheekybits/genny v1.0.0 // indirect github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/elazarl/goproxy v0.0.0-20220115173737-adb46da277ac // indirect - github.com/fatih/color v1.7.0 // indirect - github.com/getkin/kin-openapi v0.94.0 // indirect - github.com/ghodss/yaml v1.0.0 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/getkin/kin-openapi v0.112.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/swag v0.19.15 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/flatbuffers v2.0.0+incompatible // indirect github.com/google/go-cmp v0.5.9 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/hashicorp/go-hclog v0.14.1 // indirect - github.com/hashicorp/go-plugin v1.4.3 // indirect - github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-plugin v1.4.9 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect + github.com/invopop/yaml v0.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.13.1 // indirect github.com/magefile/mage v1.14.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattetti/filebuffer v1.0.1 // indirect - github.com/mattn/go-colorable v0.1.4 // indirect - github.com/mattn/go-isatty v0.0.10 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/oklog/run v1.0.0 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pierrec/lz4/v4 v4.1.8 // indirect - github.com/prometheus/client_golang v1.12.1 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.40.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect - github.com/russross/blackfriday/v2 v2.0.1 // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect github.com/unknwon/com v1.0.1 // indirect github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 // indirect - github.com/urfave/cli v1.22.1 // indirect - golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect - golang.org/x/text v0.3.6 // indirect + github.com/urfave/cli v1.22.12 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.37.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.15.0 // indirect + go.opentelemetry.io/otel v1.14.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 // indirect + go.opentelemetry.io/otel/metric v0.37.0 // indirect + go.opentelemetry.io/otel/sdk v1.14.0 // indirect + go.opentelemetry.io/otel/trace v1.14.0 // indirect + go.opentelemetry.io/proto/otlp v0.19.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 // indirect - google.golang.org/grpc v1.41.0 // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + google.golang.org/grpc v1.54.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f23c540..681f138 100644 --- a/go.sum +++ b/go.sum @@ -13,12 +13,15 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -32,27 +35,26 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 h1:q4dksr6ICHXqG5hm0ZW5IHyeEJXoIJSOZeBLmWPNeIQ= github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 h1:XCdvHbz3LhewBHN7+mQPx0sg/Hxil/1USnBmxkjHcmY= @@ -64,10 +66,14 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -84,15 +90,15 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/getkin/kin-openapi v0.94.0 h1:bAxg2vxgnHHHoeefVdmGbR+oxtJlcv5HsJJa3qmAHuo= -github.com/getkin/kin-openapi v0.94.0/go.mod h1:LWZfzOd7PRy8GJ1dJ6mCU6tNdSfOwRac1BUPam4aw6Q= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/getkin/kin-openapi v0.112.0 h1:lnLXx3bAG53EJVI4E/w0N8i1Y/vUZUEsnrXkgnfn7/Y= +github.com/getkin/kin-openapi v0.112.0/go.mod h1:QtwUNt0PAAgIIBEvFWYfB7dfngxtAaqCX1zYHMZDeK8= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-co-op/gocron v1.18.0 h1:SxTyJ5xnSN4byCq7b10LmmszFdxQlSQJod8s3gbnXxA= github.com/go-co-op/gocron v1.18.0/go.mod h1:sD/a0Aadtw5CpflUJ/lpP9Vfdk979Wl1Sg33HPHg0FY= @@ -103,23 +109,25 @@ github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmn github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -145,8 +153,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -160,7 +169,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= @@ -187,39 +195,35 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grafana/grafana-plugin-sdk-go v0.147.0 h1:VavvJOa/Ubs+wzalzWIl+FQmdaD4vEK8KVYU0a8rf+E= -github.com/grafana/grafana-plugin-sdk-go v0.147.0/go.mod h1:NMgO3t2gR5wyLx8bWZ9CTmpDk5Txp4wYFccFLHdYn3Q= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grafana/grafana-plugin-sdk-go v0.169.0 h1:xCOyQF+pMRGeZ2WghnB3OUiwmtNLtdq4/Re4WAqaz6U= +github.com/grafana/grafana-plugin-sdk-go v0.169.0/go.mod h1:4jbsFzZvseLhsEmsPhI18fZG40mkJ2xIKPj9UopNz/8= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM= -github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU= +github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/invopop/yaml v0.1.0 h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc= +github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -227,8 +231,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ= github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 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= @@ -243,32 +246,32 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattetti/filebuffer v1.0.1 h1:gG7pyfnSIZCxdoKq+cPa8T0hhYtD9NxCdI4D7PTjRLM= github.com/mattetti/filebuffer v1.0.1/go.mod h1:YdMURNDOttIiruleeVr6f56OrMc+MydEnTcXwtkxNVs= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -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.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -276,67 +279,59 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2 github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4= github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.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_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q= +github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 h1:Jpy1PXuP99tXNrhbq2BaPz9B+jNAvH1JPQQpG/9GCXY= github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 h1:aVGB3YnaS/JNfOW3tiHIlmNmTDg618va+eT0mVomgyI= github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8/go.mod h1:fVle4kNr08ydeohzYafr20oZzbAkhQT39gKK/pFQ5M4= github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs= github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 h1:4EYQaWAatQokdji3zqZloVIW/Ke1RQjYw2zHULyrHJg= github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3/go.mod h1:1xEUf2abjfP92w2GZTV+GgaRxXErwRXcClbUwrNJffU= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= +github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -347,11 +342,34 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 h1:5jD3teb4Qh7mx/nfzq4jO2WFFpvXD0vYWFDrdvNWmXk= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0/go.mod h1:UMklln0+MRhZC4e3PwmN3pCtq4DyIadWw4yikh6bNrw= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.37.0 h1:H0wsFGpY3uD/zB/5UubZgkgnd378/ogV9BH2itqEFbc= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.37.0/go.mod h1:xXATK4LOREcHuSE4sWsK1VO7FUxa6L58rAORHFTdhAI= +go.opentelemetry.io/contrib/propagators/jaeger v1.15.0 h1:xdJjwy5t/8I+TZehMMQ+r2h50HREihH2oMUhimQ+jug= +go.opentelemetry.io/contrib/propagators/jaeger v1.15.0/go.mod h1:tU0nwW4QTvKceNUP60/PQm0FI8zDSwey7gIFt3RR/yw= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= +go.opentelemetry.io/otel/metric v0.37.0 h1:pHDQuLQOZwYD+Km0eb657A25NaRzy0a+eLyKfDXedEs= +go.opentelemetry.io/otel/metric v0.37.0/go.mod h1:DmdaHfGt54iV6UKxsV9slj2bBRJcKC1B1uvDLIioc1s= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -401,10 +419,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -412,7 +428,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -432,15 +447,16 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -450,14 +466,11 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -467,12 +480,11 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191020152052-9984515f0562/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -484,20 +496,21 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -505,8 +518,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -528,6 +542,7 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -590,7 +605,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -622,9 +637,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 h1:s1jFTXJryg4a1mew7xv03VZD8N9XjxFhk1o4Js4WvPQ= google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -641,8 +657,10 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -655,28 +673,27 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify/fsnotify.v1 v1.4.7 h1:XNNYLJHt73EyYiCZi6+xjupS9CpvmiDgjPTAjrBlQbo= gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/plugin/datasource.go b/pkg/plugin/datasource.go index 97170b5..57cdbe8 100644 --- a/pkg/plugin/datasource.go +++ b/pkg/plugin/datasource.go @@ -2,6 +2,7 @@ package plugin import ( "context" + "encoding/json" "fmt" "net/http" "strings" @@ -11,9 +12,13 @@ import ( "github.com/go-co-op/gocron" "github.com/gorilla/websocket" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" "github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt" "github.com/grafana/grafana-plugin-sdk-go/backend/log" + "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" ) // Make sure Datasource implements required interfaces. This is important to do @@ -37,30 +42,30 @@ func NewPIWebAPIDatasource(settings backend.DataSourceInstanceSettings) (instanc return nil, fmt.Errorf("http client options: %w", err) } - cl, err := httpclient.New(opts) + httpClient, err := httpclient.New(opts) if err != nil { return nil, fmt.Errorf("httpclient new: %w", err) } - var webIDCache = map[string]WebIDCacheEntry{} - // TODO: Re-add streaming - // var channelConstruct = map[string]StreamChannelConstruct{} + + webIDCache := make(map[string]WebIDCacheEntry) scheduler := gocron.NewScheduler(time.UTC) scheduler.Every(5).Minute().Do(cleanWebIDCache, webIDCache) scheduler.StartAsync() - return &Datasource{ - settings: settings, - httpClient: cl, - webIDCache: webIDCache, - // channelConstruct: channelConstruct, + ds := &Datasource{ + settings: settings, + httpClient: httpClient, + webIDCache: webIDCache, scheduler: scheduler, websocketConnectionsMutex: &sync.Mutex{}, sendersByWebIDMutex: &sync.Mutex{}, websocketConnections: make(map[string]*websocket.Conn), sendersByWebID: make(map[string]map[*backend.StreamSender]bool), streamChannels: make(map[string]chan []byte), - }, nil + } + ds.queryMux = ds.newQueryMux() + return ds, nil } // Dispose here tells plugin SDK that plugin wants to clean up resources when a new instance @@ -76,9 +81,22 @@ func (d *Datasource) Dispose() { // The QueryDataResponse contains a map of RefID to the response for each query, and each response // contains Frames ([]*Frame). +func (d *Datasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { + + return d.queryMux.QueryData(ctx, req) +} + // TODO: Add support for regex replace of frame names // TODO: Missing functionality: Fix summaries -func (d *Datasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { +func (d *Datasource) QueryTSData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { + + //TODO: Remove this debug information + jsonReq, err := json.Marshal(req) + if err != nil { + return nil, fmt.Errorf("error marshaling QueryDataRequest: %v", err) + } + + backend.Logger.Info("QueryDataRequest: ", string(jsonReq)) backend.Logger.Info("Query Recieved. Processing...") processedPIWebAPIQueries := make(map[string][]PiProcessedQuery) @@ -101,9 +119,55 @@ func (d *Datasource) QueryData(ctx context.Context, req *backend.QueryDataReques return response, nil } +// QueryAnnotations recevies annotation queries from the frontend and returns dataframes that contain json raw messages containing the annotations. +func (d *Datasource) QueryAnnotations(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { + response := &backend.QueryDataResponse{} + response.Responses = make(map[string]backend.DataResponse) + + //TODO: Remove this temporary testing information + var fakeresponses []AnnotationQueryResponse + fakeresponse := getFakeQueryResponse() + fakeresponses = append(fakeresponses, fakeresponse) + + annotationFrame, _ := convertAnnotationResponsetoFrame(fakeresponses) + + backend.Logger.Info("Annotation query received. Processing.!..") + + //TODO: Remove this debug information + jsonReq, err := json.Marshal(req) + if err != nil { + return nil, fmt.Errorf("error marshaling QueryDataRequest: %v", err) + } + + backend.Logger.Info("QueryDataRequest: ", string(jsonReq)) + + for _, q := range req.Queries { + backend.Logger.Info("Processing Query", "RefID", q.RefID) + var subResponse backend.DataResponse + subResponse.Frames = append(subResponse.Frames, annotationFrame) + response.Responses[q.RefID] = subResponse + } + + return response, nil +} + // This function provides a way to proxy requests to the PI Web API. It is used to limit access fromt he frontend to the PI Web API. // These endpoints are called by the front end while configuring the datasource, query, and annotations. func (d *Datasource) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error { + // Create spans for this function. + // tracing.DefaultTracer() returns the tracer initialized when calling Manage(). + // Refer to OpenTelemetry's Go SDK to know how to customize your spans. + ctx, span := tracing.DefaultTracer().Start( + ctx, + "call resource processing", + trace.WithAttributes( + attribute.String("resource.URL", req.URL), + attribute.String("resource.Path", req.Path), + attribute.String("resource.Method", req.Method), + ), + ) + defer span.End() + var isAllowed = true var allowedBasePaths = []string{ "/assetdatabases", @@ -171,3 +235,12 @@ func (d *Datasource) CheckHealth(ctx context.Context, _ *backend.CheckHealthRequ func newHealthCheckErrorf(format string, args ...interface{}) *backend.CheckHealthResult { return &backend.CheckHealthResult{Status: backend.HealthStatusError, Message: fmt.Sprintf(format, args...)} } + +func (d *Datasource) newQueryMux() *datasource.QueryTypeMux { + mux := datasource.NewQueryTypeMux() + + // Register query handlers + mux.HandleFunc("Annotation", d.QueryAnnotations) + mux.HandleFunc("", d.QueryTSData) + return mux +} diff --git a/pkg/plugin/helpers.go b/pkg/plugin/helpers.go index 3555851..6e2e6af 100644 --- a/pkg/plugin/helpers.go +++ b/pkg/plugin/helpers.go @@ -23,9 +23,10 @@ func (d *Datasource) apiGet(ctx context.Context, path string) ([]byte, error) { if err != nil { return nil, err } - if d.settings.BasicAuthEnabled { - req.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) - } + //TODO: grafana http client automatically adds basic auth, remove once confirmed + // if d.settings.BasicAuthEnabled { + // req.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) + // } resp, err := d.httpClient.Do(req) if err != nil { return nil, err @@ -51,10 +52,10 @@ func (d *Datasource) apiBatchRequest(ctx context.Context, BatchSubRequests map[s if err != nil { return nil, err } - - if d.settings.BasicAuthEnabled { - req.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) - } + //TODO: grafana http client automatically adds basic auth, remove once confirmed + // if d.settings.BasicAuthEnabled { + // req.SetBasicAuth(d.settings.BasicAuthUser, d.settings.DecryptedSecureJSONData["basicAuthPassword"]) + // } req.Header.Set("Content-Type", "application/json") req.Header.Set("X-Requested-With", "message/http") req.Header.Set("X-PIWEBAPI-HTTP-METHOD", "GET") @@ -239,6 +240,29 @@ func handleTimestampValue(val reflect.Value) (reflect.Value, error) { return ts, nil } +func convertAnnotationResponsetoFrame(annotations []AnnotationQueryResponse) (*data.Frame, error) { + frame := data.NewFrame("Anno") + + var annotationData []*json.RawMessage + + for _, annotation := range annotations { + for _, annotationValue := range annotation.Items { + rawMsg, err := json.Marshal(annotationValue) + if err != nil { + return nil, fmt.Errorf("error marshalling annotationValue: %w", err) + } + rm := json.RawMessage(rawMsg) + annotationData = append(annotationData, &rm) + } + } + + frame.Fields = append(frame.Fields, data.NewField("annotation", nil, annotationData)) + + frame.Meta = &data.FrameMeta{} + + return frame, nil +} + // TODO: Code simplification: Determine if we should create metadata here. // if we passed in the entire query we could do that. // if we pass a pointer to the webid cache and the webid that might simplify things diff --git a/pkg/plugin/models.go b/pkg/plugin/models.go index 03cb0b1..e554c9e 100644 --- a/pkg/plugin/models.go +++ b/pkg/plugin/models.go @@ -7,10 +7,12 @@ import ( "github.com/go-co-op/gocron" "github.com/gorilla/websocket" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" ) type Datasource struct { settings backend.DataSourceInstanceSettings + queryMux *datasource.QueryTypeMux StreamHandler backend.StreamHandler httpClient *http.Client webIDCache map[string]WebIDCacheEntry diff --git a/pkg/plugin/queryModels.go b/pkg/plugin/queryModels.go index ff2fe93..5fe9d06 100644 --- a/pkg/plugin/queryModels.go +++ b/pkg/plugin/queryModels.go @@ -112,3 +112,107 @@ type PiProcessedQuery struct { Response PiBatchData `json:"ResponseData"` Error error } + +// AnnotationQueryResponse is the response from the PI Web API for an annotation query +type Links struct { + First string `json:"First"` + Last string `json:"Last"` +} + +// AnnotationItemSecurity is only needed for generating a new struct. In practice this can be ignored, by the frontend. +type AnnotationItemSecurity struct { + CanAnnotate bool `json:"CanAnnotate"` + CanDelete bool `json:"CanDelete"` + CanExecute bool `json:"CanExecute"` + CanRead bool `json:"CanRead"` + CanReadData bool `json:"CanReadData"` + CanSubscribe bool `json:"CanSubscribe"` + CanSubscribeOthers bool `json:"CanSubscribeOthers"` + CanWrite bool `json:"CanWrite"` + CanWriteData bool `json:"CanWriteData"` + HasAdmin bool `json:"HasAdmin"` + Rights []string `json:"Rights"` +} + +// AnnotationItemLinks is only needed for generating a new struct. In practice this can be ignored, by the frontend. +type AnnotationItemLinks struct { + Self string `json:"Self"` + Attributes string `json:"Attributes"` + EventFrames string `json:"EventFrames"` + Database string `json:"Database"` + ReferencedElements string `json:"ReferencedElements"` + Template string `json:"Template"` + Categories string `json:"Categories"` + InterpolatedData string `json:"InterpolatedData"` + RecordedData string `json:"RecordedData"` + PlotData string `json:"PlotData"` + SummaryData string `json:"SummaryData"` + Value string `json:"Value"` + EndValue string `json:"EndValue"` + Security string `json:"Security"` + SecurityEntries string `json:"SecurityEntries"` +} + +type AnnotationItem struct { + WebID string `json:"WebId"` + ID string `json:"Id"` + Name string `json:"Name"` + Description string `json:"Description"` + Path string `json:"Path"` + TemplateName string `json:"TemplateName"` + HasChildren bool `json:"HasChildren"` + CategoryNames []string `json:"CategoryNames"` + ExtendedProperties struct{} `json:"ExtendedProperties"` + StartTime string `json:"StartTime"` + EndTime string `json:"EndTime"` + Severity string `json:"Severity"` + AcknowledgedBy string `json:"AcknowledgedBy"` + AcknowledgedDate string `json:"AcknowledgedDate"` + CanBeAcknowledged bool `json:"CanBeAcknowledged"` + IsAcknowledged bool `json:"IsAcknowledged"` + IsAnnotated bool `json:"IsAnnotated"` + IsLocked bool `json:"IsLocked"` + AreValuesCaptured bool `json:"AreValuesCaptured"` + RefElementWebIds []string `json:"RefElementWebIds"` + Security AnnotationItemSecurity `json:"Security"` + Links AnnotationItemLinks `json:"Links"` +} + +type AnnotationQueryResponse struct { + Links Links `json:"Links"` + Items []AnnotationItem `json:"Items"` +} + +func getFakeQueryResponse() AnnotationQueryResponse { + fiveMinAgo := time.Now().Add(-5 * time.Minute).Format(time.RFC3339) + threeMinAgo := time.Now().Add(-3 * time.Minute).Format(time.RFC3339) + + return AnnotationQueryResponse{ + Links: Links{ + First: "https://piapi.complacentsee.com/piwebapi/assetdatabases/F1RDBy9ucRRb8ESE6SOe4ZuJsQYi78vFbGkU6ZIT2mvbKH4gV0lOLVY3SjRCMjYxMjFBXFRFU1RBRg/eventframes?templateName=TestAlert1&startTime=" + fiveMinAgo + "&endTime=" + threeMinAgo + "&startIndex=0", + Last: "https://piapi.complacentsee.com/piwebapi/assetdatabases/F1RDBy9ucRRb8ESE6SOe4ZuJsQYi78vFbGkU6ZIT2mvbKH4gV0lOLVY3SjRCMjYxMjFBXFRFU1RBRg/eventframes?templateName=TestAlert1&startTime=" + fiveMinAgo + "&endTime=" + threeMinAgo + "&startIndex=0", + }, + Items: []AnnotationItem{ + { + WebID: "F1FmBy9ucRRb8ESE6SOe4ZuJsQfD80tSQj7hGlv_84a1Sq4AV0lOLVY3SjRCMjYxMjFBXFRFU1RBRlxFVkVOVEZSQU1FU1tURVNUQUxFUlQxXzIwMjMwNzE1LTAwMV0", + ID: "b5343f7c-2324-11ee-a5bf-ff386b54aae0", + Name: "TestAlert1_20230715-001", + StartTime: fiveMinAgo, + EndTime: threeMinAgo, + Description: "", + Path: "\\\\WIN-V7J4B26121A\\TestAF\\EventFrames[TestAlert1_20230715-001]", + TemplateName: "TestAlert1", + HasChildren: false, + CategoryNames: []string{"Fake1", "Alert"}, + Severity: "None", + AcknowledgedBy: "", + AcknowledgedDate: "1970-01-01T00:00:00Z", + CanBeAcknowledged: false, + IsAcknowledged: false, + IsAnnotated: false, + IsLocked: false, + AreValuesCaptured: false, + }, + }, + } +} diff --git a/src/datasource.ts b/src/datasource.ts index 9c28d86..8a2251c 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -1,5 +1,5 @@ import { - each, + //each, filter, //flatten, //forOwn, @@ -22,6 +22,7 @@ import { //Labels, AnnotationQuery, DataFrame, + Field, //toDataFrame, } from '@grafana/data'; import { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv, DataSourceWithBackend} from '@grafana/runtime'; @@ -34,6 +35,7 @@ import { //PiwebapiElementPath, PiwebapiInternalRsp, PiwebapiRsp, + AnnotationItem, } from './types'; import { //checkNumber, @@ -92,6 +94,7 @@ export class PiWebAPIDatasource extends DataSourceWithBackend): PIWebAPIQuery | undefined { if (anno.target) { + anno.target.queryType = 'Annotation'; anno.target.isAnnotation = true; } return anno.target; @@ -350,38 +353,47 @@ export class PiWebAPIDatasource extends DataSourceWithBackend { - let attributeText = ''; - let name = d.name!; - const endTime = d.fields.find((f) => f.name === 'EndTime')?.values.get(0); - const startTime = d.fields.find((f) => f.name === 'StartTime')?.values.get(0); - // check if we have more attributes in the table data - const attributeDataItems = d.fields.filter((f) => ['StartTime', 'EndTime'].indexOf(f.name) < 0); - if (attributeDataItems) { - each(attributeDataItems, (attributeData) => { - attributeText += '
' + attributeData.name + ': ' + attributeData.values.get(0); + d.fields.forEach((f: Field) => { + // FIXME: Confirm that this is an annotation item, not an attribute frame. + const annotation = Array.isArray(f.values) ? f.values[0] : f.values as unknown as AnnotationItem; + let attributeText = ''; + let name = annotation.Name; + let startTime = annotation.StartTime; + let endTime = annotation.EndTime; + // check if we have more attributes in the table data + + //FIXME: Revise thise code to work on the new data structure + // const attributeDataItems = d.fields.filter((f) => ['StartTime', 'EndTime'].indexOf(f.name) < 0); + // if (attributeDataItems) { + // each(attributeDataItems, (attributeData) => { + // attributeText += '
' + attributeData.name + ': ' + attributeData.values.get(0); + // }); + // } + + // replace Dataframe name using Regex + if (annotationOptions.regex && annotationOptions.regex.enable) { + name = name.replace(new RegExp(annotationOptions.regex.search), annotationOptions.regex.replace); + } + // create the event + events.push({ + id: annotationOptions.database?.WebId, + annotation: annon, + title: `Name: ${annon.name}`, + time: new Date(startTime).getTime(), + timeEnd: !!annotationOptions.showEndTime ? new Date(endTime).getTime() : undefined, + text: + `Tag: ${name}` + + attributeText + + '
Start: ' + + new Date(startTime).toLocaleString('pt-BR') + + '
End: ' + + new Date(endTime).toLocaleString('pt-BR'), + tags: ['OSISoft PI'], }); - } - // replace Dataframe name using Regex - if (annotationOptions.regex && annotationOptions.regex.enable) { - name = name.replace(new RegExp(annotationOptions.regex.search), annotationOptions.regex.replace); - } - // create the event - events.push({ - id: annotationOptions.database?.WebId, - annotation: annon, - title: `Name: ${annon.name}`, - time: new Date(startTime).getTime(), - timeEnd: !!annotationOptions.showEndTime ? new Date(endTime).getTime() : undefined, - text: - `Tag: ${name}` + - attributeText + - '
Start: ' + - new Date(startTime).toLocaleString('pt-BR') + - '
End: ' + - new Date(endTime).toLocaleString('pt-BR'), - tags: ['OSISoft PI'], - }); + }) + }); + console.info('eventFrameToAnnotation: events:', events); return events; } diff --git a/src/plugin.json b/src/plugin.json index 62486e5..dea2aca 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -4,7 +4,7 @@ "type": "datasource", "id": "gridprotectionalliance-osisoftpi-datasource", "backend": true, - "executable": "gpx_osipiwebapistreaming", + "executable": "gpx_osipiwebapi", "metrics": true, "annotations": true, "alerting": true, diff --git a/src/types.ts b/src/types.ts index 7df9068..3b78dc5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -93,6 +93,68 @@ export const defaultQuery: Partial = { isPiPoint: false, }; + +// AnnotationItemSecurity is only needed for generating a new interface. In practice this can be ignored, by the frontend. +interface AnnotationItemSecurity { + CanAnnotate: boolean; + CanDelete: boolean; + CanExecute: boolean; + CanRead: boolean; + CanReadData: boolean; + CanSubscribe: boolean; + CanSubscribeOthers: boolean; + CanWrite: boolean; + CanWriteData: boolean; + HasAdmin: boolean; + Rights: string[]; +} + +// AnnotationItemLinks is only needed for generating a new interface. In practice this can be ignored, by the frontend. +interface AnnotationItemLinks { + Self: string; + Attributes: string; + EventFrames: string; + Database: string; + ReferencedElements: string; + Template: string; + Categories: string; + InterpolatedData: string; + RecordedData: string; + PlotData: string; + SummaryData: string; + Value: string; + EndValue: string; + Security: string; + SecurityEntries: string; +} + +export interface AnnotationItem { + WebID: string; + ID: string; + Name: string; + Description: string; + Path: string; + TemplateName: string; + HasChildren: boolean; + CategoryNames: string[]; + ExtendedProperties: object; + StartTime: string; + EndTime: string; + Severity: string; + AcknowledgedBy: string; + AcknowledgedDate: string; + CanBeAcknowledged: boolean; + IsAcknowledged: boolean; + IsAnnotated: boolean; + IsLocked: boolean; + AreValuesCaptured: boolean; + RefElementWebIds: string[]; + Security: AnnotationItemSecurity; + Links: AnnotationItemLinks; +} + + + /** * These are options configured for each DataSource instance */ From 579f9e3a5b04835e9d9d8e67ad0e9e519e56acae Mon Sep 17 00:00:00 2001 From: Adam Traeger Date: Sun, 16 Jul 2023 20:54:46 -0500 Subject: [PATCH 03/44] Added annotation query structures and url functions. --- pkg/plugin/annotationQuery.go | 213 ++++++++++++++++++++++++++++++++++ pkg/plugin/datasource.go | 17 ++- 2 files changed, 224 insertions(+), 6 deletions(-) create mode 100644 pkg/plugin/annotationQuery.go diff --git a/pkg/plugin/annotationQuery.go b/pkg/plugin/annotationQuery.go new file mode 100644 index 0000000..cf89617 --- /dev/null +++ b/pkg/plugin/annotationQuery.go @@ -0,0 +1,213 @@ +package plugin + +import ( + "context" + "encoding/json" + "errors" + "strings" + "time" + + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/backend/log" +) + +type PIAnnotationQuery struct { + RefID string `json:"RefID"` + QueryType string `json:"QueryType"` + MaxDataPoints int `json:"MaxDataPoints"` + Interval int64 `json:"Interval"` + TimeRange TimeRange `json:"TimeRange"` + JSON PIWebAPIAnnotationQuery `json:"JSON"` +} + +type TimeRange struct { + From time.Time `json:"From"` + To time.Time `json:"To"` +} + +//{\"attribute\":{\"name\":\"attribute, take\"}, + +type PIWebAPIAnnotationQuery struct { + CategoryName string `json:"categoryName"` + NameFilter string `json:"nameFilter"` + Attribute AnnotationAttribute `json:"attribute"` + Database AFDatabase `json:"database"` + Datasource Datasource `json:"datasource"` + DatasourceID int `json:"datasourceId"` + IntervalMs int `json:"intervalMs"` + IsAnnotation bool `json:"isAnnotation"` + MaxDataPoints int `json:"maxDataPoints"` + QueryType string `json:"queryType"` + RefID string `json:"refId"` + Template EventFrameTemplate `json:"template"` +} + +type AnnotationAttribute struct { + Name string `json:"name"` +} + +type AFDatabase struct { + Description string `json:"Description"` + ExtendedProperties ExtendedProperties `json:"ExtendedProperties"` + Id string `json:"Id"` + Links Links `json:"Links"` + Name string `json:"Name"` + Path string `json:"Path"` + WebId string `json:"WebId"` +} + +type ExtendedProperties struct { + DefaultPIServer ValueContainer `json:"DefaultPIServer"` + DefaultPIServerID ValueContainer `json:"DefaultPIServerID"` +} + +type ValueContainer struct { + Value string `json:"Value"` +} + +type AssetDatabaseLinks struct { + AnalysisCategories string `json:"AnalysisCategories"` + AnalysisTemplates string `json:"AnalysisTemplates"` + AssetServer string `json:"AssetServer"` + AttributeCategories string `json:"AttributeCategories"` + ElementCategories string `json:"ElementCategories"` + ElementTemplates string `json:"ElementTemplates"` + Elements string `json:"Elements"` + EnumerationSets string `json:"EnumerationSets"` + EventFrames string `json:"EventFrames"` + Security string `json:"Security"` + SecurityEntries string `json:"SecurityEntries"` + Self string `json:"Self"` + TableCategories string `json:"TableCategories"` + Tables string `json:"Tables"` +} + +type GrafanaDatasource struct { + Type string `json:"type"` + Uid string `json:"uid"` +} + +type EventFrameTemplate struct { + InstanceType string `json:"InstanceType"` + Name string `json:"Name"` + WebId string `json:"WebId"` +} + +type PiProcessedAnnotationQuery struct { + RefID string `json:"RefID"` + TimeRange TimeRange `json:"TimeRange"` + Database AFDatabase + Template EventFrameTemplate + CategoryName string `json:"categoryName"` + NameFilter string `json:"nameFilter"` + Attributes []string + Error error +} + +func (d Datasource) processAnnotationQuery(ctx context.Context, query backend.DataQuery) PiProcessedAnnotationQuery { + var ProcessedQuery PiProcessedAnnotationQuery + var PiAnnotationQuery PIAnnotationQuery + + // Unmarshal the query into a PiQuery struct, and then unmarshal the PiQuery into a PiProcessedQuery + // if there are errors we'll set the error and return the PiProcessedQuery with an error set. + tempJson, err := json.Marshal(query) + if err != nil { + log.DefaultLogger.Error("Error marshalling query", "error", err) + + // create a processed query with the error set + ProcessedQuery = PiProcessedAnnotationQuery{ + Error: err, + } + return ProcessedQuery + } + + err = json.Unmarshal(tempJson, &PiAnnotationQuery) + if err != nil { + log.DefaultLogger.Error("Error unmarshalling query", "error", err) + + // create a processed query with the error set + ProcessedQuery = PiProcessedAnnotationQuery{ + Error: err, + } + return ProcessedQuery + } + + var attributes []string + + if PiAnnotationQuery.JSON.Attribute.Name != "" { + // Splitting by comma + rawAttributes := strings.Split(PiAnnotationQuery.JSON.Attribute.Name, ",") + + // Iterating through each name, trimming the space, and then appending it to the slice + for _, name := range rawAttributes { + // strip out empty attribute names + if name == "" { + continue + } + attributes = append(attributes, strings.TrimSpace(name)) + } + } + + //create a processed query for the annotation query + ProcessedQuery = PiProcessedAnnotationQuery{ + RefID: PiAnnotationQuery.RefID, + TimeRange: PiAnnotationQuery.TimeRange, + Database: PiAnnotationQuery.JSON.Database, + Template: PiAnnotationQuery.JSON.Template, + CategoryName: PiAnnotationQuery.JSON.CategoryName, + NameFilter: PiAnnotationQuery.JSON.NameFilter, + Attributes: attributes, + } + + return ProcessedQuery +} + +func (q *PiProcessedAnnotationQuery) getTimeRangeURIComponent() string { + return "?startTime=" + q.TimeRange.From.UTC().Format(time.RFC3339) + "&endTime=" + q.TimeRange.To.UTC().Format(time.RFC3339) +} + +// getEventFrameQueryURL returns the URI for the event frame query +func (q PiProcessedAnnotationQuery) getEventFrameQueryURL() string { + //example uri: + //http(s):///apiendpoint/assetdatabases//eventframes?templateName=