deps: Update thema, use CUE fork (#60496)

* deps: Update thema, use CUE fork

* Remove superfluous openapi-codegen output

* Update thema again to catch cuetsy changes

* Rerun codegen with latest

* Latest thema, removes cuetsy update

* Latest of cuetsy

* Update type usage

* One last cuetsy rollback

* Update playlist summary tests

* More lint fixes

* Remove TS veneer changes for VariableHide

Co-authored-by: Clarity-89 <homes89@ukr.net>
This commit is contained in:
sam boyer 2022-12-22 07:20:02 -05:00 committed by GitHub
parent 9d64e7cedc
commit b8253ac3b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 695 additions and 937 deletions

15
go.mod
View File

@ -21,9 +21,12 @@ replace github.com/gomodule/redigo => github.com/gomodule/redigo v1.8.9
// github.com/docker/docker@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000
replace github.com/docker/docker => github.com/moby/moby v0.7.3-0.20190826074503-38ab9da00309
// contains openapi encoder fixes. remove ASAP
replace cuelang.org/go => github.com/sdboyer/cue v0.5.0-beta.2.0.20221218111347-341999f48bdb
require (
cloud.google.com/go/storage v1.22.1
cuelang.org/go v0.4.3
cuelang.org/go v0.5.0-beta.2
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.27
github.com/BurntSushi/toml v1.1.0
@ -61,7 +64,7 @@ require (
github.com/grafana/grafana-aws-sdk v0.11.0
github.com/grafana/grafana-azure-sdk-go v1.5.1
github.com/grafana/grafana-plugin-sdk-go v0.147.0
github.com/grafana/thema v0.0.0-20221113112305-b441ed85a1fd
github.com/grafana/thema v0.0.0-20221222001256-d3a8fa941a6b
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/hashicorp/go-hclog v1.0.0
github.com/hashicorp/go-plugin v1.4.3
@ -217,7 +220,7 @@ require (
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/segmentio/encoding v0.3.5
github.com/sercand/kuberesolver v2.4.0+incompatible // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
@ -269,7 +272,10 @@ require (
k8s.io/client-go v12.0.0+incompatible // gets replaced with v0.25.0
)
require k8s.io/apimachinery v0.25.0
require (
github.com/dave/dst v0.27.2
k8s.io/apimachinery v0.25.0
)
require (
cloud.google.com/go v0.102.0 // indirect
@ -360,7 +366,6 @@ require (
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/google/go-github v17.0.0+incompatible
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect
github.com/imdario/mergo v0.3.12 // indirect

63
go.sum
View File

@ -88,10 +88,7 @@ contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeS
contrib.go.opencensus.io/exporter/prometheus v0.3.0/go.mod h1:rpCPVQKhiyH8oomWgm34ZmgIdZa8OVYO5WAIygPbBBE=
contrib.go.opencensus.io/exporter/stackdriver v0.13.10/go.mod h1:I5htMbyta491eUxufwwZPQdcKvvgzMB4O9ni41YnIM8=
contrib.go.opencensus.io/integrations/ocsql v0.1.7/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
cuelang.org/go v0.4.3 h1:W3oBBjDTm7+IZfCKZAmC8uDG0eYfJL4Pp/xbbCMKaVo=
cuelang.org/go v0.4.3/go.mod h1:7805vR9H+VoBNdWFdI7jyDR3QLUPp4+naHfbcgp55HI=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
github.com/99designs/basicauth-go v0.0.0-20160802081356-2a93ba0f464d/go.mod h1:3cARGAK9CfW3HoxCy1a0G4TKrdiKke8ftOMEOHyySYs=
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY=
@ -120,29 +117,14 @@ github.com/Azure/azure-sdk-for-go v57.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo
github.com/Azure/azure-sdk-for-go v59.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.22.0 h1:zBJcBJwte0x6PcPK7XaWDMvK2o2ZM2f1sMaqNNavQ5g=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.22.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUXTtj12tQ6zE2GZUgVQw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2 h1:mM/yraAumqMMIYev6zX0oxHqX6hreUs5wXf76W47r38=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.4.0 h1:t10+CFWGK92HGTQaYZyXchiVetuEWfND3abV8inz6n8=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.4.0/go.mod h1:LxYa4KH5ni+OMT8DJBAP6FVYg3YFW3ACTJluqpnTDBg=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 h1:TOFrNxfjslms5nLLIMjW7N0+zSALX4KiGsptmpb16AA=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.2.1 h1:lirjIOHv5RrmDbZXw9lUz/fY68uU05qR4uIef58WMvQ=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.2.1/go.mod h1:j1J9XXIo/eXD7YSrr73sYZTEY/AQ0+/Q6Aa96z1e2j8=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 h1:Lg6BW0VPmCwcMlvOviL3ruHFO+H9tZNqscK0AeuFjGM=
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA=
github.com/Azure/azure-service-bus-go v0.11.5/go.mod h1:MI6ge2CuQWBVq+ly456MY7XqNLJip5LO1iSFodbNLbU=
@ -153,7 +135,6 @@ github.com/Azure/azure-storage-blob-go v0.15.0 h1:rXtgp8tN1p29GvpGgfJetavIG0V7Og
github.com/Azure/azure-storage-blob-go v0.15.0/go.mod h1:vbjsVbX0dlxnRc4FFMPsS9BsJWPcne7GB7onqlPvz58=
github.com/Azure/go-amqp v0.16.0/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg=
github.com/Azure/go-amqp v0.16.4/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
@ -225,8 +206,6 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM=
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@ -550,7 +529,6 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/apd/v2 v2.0.1/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=
github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk=
@ -709,7 +687,10 @@ github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1S
github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s=
github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8=
github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I=
github.com/dave/dst v0.27.2 h1:4Y5VFTkhGLC1oddtNwuxxe36pnyLxMFXT51FOzH8Ekc=
github.com/dave/dst v0.27.2/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc=
github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
github.com/dave/jennifer v1.5.0 h1:HmgPN93bVDpkQyYbqhCHj5QlgvUkvEOzMyEvKLgCRrg=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -762,7 +743,6 @@ github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/
github.com/dlmiddlecote/sqlstats v1.0.2 h1:gSU11YN23D/iY50A2zVYwgXgy072khatTsIW6UPjUtI=
github.com/dlmiddlecote/sqlstats v1.0.2/go.mod h1:0CWaIh/Th+z2aI6Q9Jpfg/o21zmGxWhbByHgQSCUQvY=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
@ -821,7 +801,6 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw=
github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emicklei/proto v1.6.15/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/emicklei/proto v1.10.0 h1:pDGyFRVV5RvV+nkBK9iy3q67FBy9Xa7vwrOTE+g5aGw=
github.com/emicklei/proto v1.10.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
@ -1172,8 +1151,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
@ -1382,10 +1359,6 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
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/alerting v0.0.0-20221215195045-4dd9b084e84d h1:2uPWbeBhkBfS5wpwU7wtZGLVn/XML2EqtiCdKGOBzDA=
github.com/grafana/alerting v0.0.0-20221215195045-4dd9b084e84d/go.mod h1:BO51roH8bMRpAqeWxvnGePyCQoqgk1TiNISYKfoyHzQ=
github.com/grafana/alerting v0.0.0-20221216210437-c818b1197cdd h1:EiSgiWT16KVktYkZxblUqXPfueLcyLQf1oF5mTDh4NY=
github.com/grafana/alerting v0.0.0-20221216210437-c818b1197cdd/go.mod h1:A+ko8Ui4Ojw9oTi1WMCPH937mFUozN8Y41cqrOfNuy8=
github.com/grafana/alerting v0.0.0-20221219210434-60ecaff51745 h1:6HIwDYa01WcVBdz7WXnidVXfGLRAzYFNKPPFFwg9OXE=
github.com/grafana/alerting v0.0.0-20221219210434-60ecaff51745/go.mod h1:A+ko8Ui4Ojw9oTi1WMCPH937mFUozN8Y41cqrOfNuy8=
github.com/grafana/codejen v0.0.3 h1:tAWxoTUuhgmEqxJPOLtJoxlPBbMULFwKFOcRsPRPXDw=
@ -1398,10 +1371,6 @@ github.com/grafana/go-mssqldb v0.0.0-20210326084033-d0ce3c521036 h1:GplhUk6Xes5J
github.com/grafana/go-mssqldb v0.0.0-20210326084033-d0ce3c521036/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/grafana/grafana-aws-sdk v0.11.0 h1:ncPD/UN0wNcKq3kEU90RdvrnK/6R4VW2Lo5dPcGk9t0=
github.com/grafana/grafana-aws-sdk v0.11.0/go.mod h1:5Iw3xY7iXJfNaYHrRHMXa/kaB2lWoyntg71PPLGvSs8=
github.com/grafana/grafana-azure-sdk-go v1.3.1 h1:xTgBmbDxUPj3X9Pl9vgIOgZoDdtxWl0fYDuHrHr79jM=
github.com/grafana/grafana-azure-sdk-go v1.3.1/go.mod h1:rgrnK9m6CgKlgx4rH3FFP/6dTdyRO6LYC2mVZov35yo=
github.com/grafana/grafana-azure-sdk-go v1.5.0 h1:rPZGXjJVzdr6VsBprAYf9kjzran71PmkQhedVhvLmRo=
github.com/grafana/grafana-azure-sdk-go v1.5.0/go.mod h1:OJJuBJ3MOoaq2mqD6xlPsArpL2R5j80TrDqPYr35Zak=
github.com/grafana/grafana-azure-sdk-go v1.5.1 h1:d+wwqvWLYvPeGltxU50LNjvCykyJjoyd5exMYJW4nLM=
github.com/grafana/grafana-azure-sdk-go v1.5.1/go.mod h1:OJJuBJ3MOoaq2mqD6xlPsArpL2R5j80TrDqPYr35Zak=
github.com/grafana/grafana-google-sdk-go v0.0.0-20211104130251-b190293eaf58 h1:2ud7NNM7LrGPO4x0NFR8qLq68CqI4SmB7I2yRN2w9oE=
@ -1413,8 +1382,8 @@ github.com/grafana/prometheus-alertmanager v0.24.1-0.20221012142027-823cd9150293
github.com/grafana/prometheus-alertmanager v0.24.1-0.20221012142027-823cd9150293/go.mod h1:HVHqK+BVPa/tmL8EMhLCCrPt2a1GdJpEyxr5hgur2UI=
github.com/grafana/saml v0.4.9-0.20220727151557-61cd9c9353fc h1:1PY8n+rXuBNr3r1JQhoytWDCpc+pq+BibxV0SZv+Cr4=
github.com/grafana/saml v0.4.9-0.20220727151557-61cd9c9353fc/go.mod h1:9Zh6dWPtB3MSzTRt8fIFH60Z351QQ+s7hCU3J/tTlA4=
github.com/grafana/thema v0.0.0-20221113112305-b441ed85a1fd h1:y6H9I5fy4sRKf2FJ7W94YWero4mXH50Ft8NAPZ9DapQ=
github.com/grafana/thema v0.0.0-20221113112305-b441ed85a1fd/go.mod h1:ZJHKwNE86ngdQ7edJIFHepCiIg9YP9x+YZPEm3dlkL4=
github.com/grafana/thema v0.0.0-20221222001256-d3a8fa941a6b h1:LBjw2NaMbTdx/etBbyZO0n0L2Lqj5PCDJAGwKk9TCII=
github.com/grafana/thema v0.0.0-20221222001256-d3a8fa941a6b/go.mod h1:8wmENx19kzNI+5De7889AVRJ3T4OnOb5I1bSJLcj1t4=
github.com/grafana/xorm v0.8.3-0.20220614223926-2fcda7565af6 h1:I9dh1MXGX0wGyxdV/Sl7+ugnki4Dfsy8lv2s5Yf887o=
github.com/grafana/xorm v0.8.3-0.20220614223926-2fcda7565af6/go.mod h1:ZkJLEYLoVyg7amJK/5r779bHyzs2AU8f8VMiP6BM7uY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
@ -1962,9 +1931,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
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/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
@ -2125,7 +2092,6 @@ github.com/pierrec/lz4/v4 v4.1.12 h1:44l88ehTZAUGW4VlO1QC4zkilL99M6Y9MXNwEs0uzP8
github.com/pierrec/lz4/v4 v4.1.12/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@ -2253,7 +2219,6 @@ github.com/prometheus/prometheus v1.8.2-0.20211011171444-354d8d2ecfac/go.mod h1:
github.com/prometheus/statsd_exporter v0.20.0/go.mod h1:YL3FWCG8JBBtaUSxAg4Gz2ZYu22bS84XM89ZQXXTWmQ=
github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc/go.mod h1:KbKfKPy2I6ecOIGA9apfheFv14+P3RSmmQvshofQyMY=
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b h1:zd/2RNzIRkoGGMjE+YIsZ85CnDIz672JK2F3Zl4vux4=
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b/go.mod h1:KjY0wibdYKc4DYkerHSbguaf3JeIPGhNJBp2BNiFH78=
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY=
@ -2275,8 +2240,9 @@ github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM=
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
@ -2304,6 +2270,8 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210223165440-c65ae3540d44/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9 h1:0roa6gXKgyta64uqh52AQG3wzZXH21unn+ltzQSXML0=
github.com/sdboyer/cue v0.5.0-beta.2.0.20221218111347-341999f48bdb h1:X6XJsprVDQnlG4vT5TVb+cRlGMU78L/IKej8Q6SDFGY=
github.com/sdboyer/cue v0.5.0-beta.2.0.20221218111347-341999f48bdb/go.mod h1:okjJBHFQFer+a41sAe2SaGm1glWS8oEb6CmJvn5Zdws=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
@ -2320,8 +2288,9 @@ github.com/sercand/kuberesolver v2.1.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJP
github.com/sercand/kuberesolver v2.4.0+incompatible h1:WE2OlRf6wjLxHwNkkFLQGaZcVLEXjMjBPjjEU5vksH8=
github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shirou/gopsutil v3.21.6+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
@ -2778,7 +2747,6 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL
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-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
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-20191029154019-8994fa331a53/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
@ -2790,7 +2758,6 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
golang.org/x/exp v0.0.0-20200821190819-94841d0725da/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20210126221216-84987778548c/go.mod h1:I6l2HNBLBZEcrOoCpyKLdY2lHoRZ8lI4x60KMCQDft4=
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d h1:vtUKgx8dahOomfFzLREU8nSv25YHnTgLBn4rDnWZdU0=
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
@ -2815,21 +2782,19 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhp
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/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
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.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
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.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.6.0-dev.0.20220818022119-ed83ed61efb9/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -2888,7 +2853,6 @@ 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-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@ -3172,6 +3136,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -3243,7 +3208,6 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/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=
@ -3266,7 +3230,6 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200603131246-cc40288be839/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200612220849-54c614fe050c/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-20200710042808-f1c4188a97a1/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=

View File

@ -21,7 +21,7 @@ lineage: seqs: [
// Description of dashboard.
description?: string
// Version of the current dashboard data
// Version of the current dashboard data
revision: int64 | *-1 @grafanamaturity(NeedsExpertReview)
gnetId?: string @grafanamaturity(NeedsExpertReview)
@ -124,26 +124,26 @@ lineage: seqs: [
// TODO what about what's in public/app/features/types.ts?
// TODO there appear to be a lot of different kinds of [template] vars here? if so need a disjunction
#VariableModel: {
id: string | *"00000000-0000-0000-0000-000000000000"
type: #VariableType
name: string
label?: string
id: string | *"00000000-0000-0000-0000-000000000000"
type: #VariableType
name: string
label?: string
rootStateKey?: string
global: bool | *false
hide: #VariableHide
skipUrlSync: bool | *false
index: int32 | *-1
state: #LoadingState
global: bool | *false
hide: #VariableHide
skipUrlSync: bool | *false
index: int32 | *-1
state: #LoadingState
error?: {...}
description?: string
// TODO: Move this into a separated QueryVariableModel type
query?: string | {...}
query?: string | {...}
datasource?: #DataSourceRef
...
} @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview)
// TODO: There is a bug generating the names, they are always title case
#VariableHide: 0 | 1 | 2 @cuetsy(kind="enum",memberNames="dontHide|hideLabel|hideVariable") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview)
#LoadingState: "NotStarted" | "Loading" | "Streaming" | "Done" | "Error" @cuetsy(kind="enum") @grafanamaturity(NeedsExpertReview)
#VariableHide: 0 | 1 | 2 @cuetsy(kind="enum",memberNames="dontHide|hideLabel|hideVariable") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview)
#LoadingState: "NotStarted" | "Loading" | "Streaming" | "Done" | "Error" @cuetsy(kind="enum") @grafanamaturity(NeedsExpertReview)
// Ref to a DataSource instance
#DataSourceRef: {
// The plugin type-id
@ -152,11 +152,12 @@ lineage: seqs: [
// Specific datasource instance
uid?: string @grafanamaturity(NeedsExpertReview)
} @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview)
// FROM public/app/features/dashboard/state/DashboardModels.ts - ish
// TODO docs
#DashboardLink: {
title: string @grafanamaturity(NeedsExpertReview)
type: #DashboardLinkType @grafanamaturity(NeedsExpertReview)
title: string @grafanamaturity(NeedsExpertReview)
type: #DashboardLinkType @grafanamaturity(NeedsExpertReview)
icon: string @grafanamaturity(NeedsExpertReview)
tooltip: string @grafanamaturity(NeedsExpertReview)
url: string @grafanamaturity(NeedsExpertReview)
@ -302,37 +303,26 @@ lineage: seqs: [
// TODO docs
#Snapshot: {
// TODO docs
created: string @grafanamaturity(NeedsExpertReview)
// TODO docs
expires: string @grafanamaturity(NeedsExpertReview)
// TODO docs
external: bool @grafanamaturity(NeedsExpertReview)
// TODO docs
externalUrl: string @grafanamaturity(NeedsExpertReview)
// TODO docs
id: uint32 @grafanamaturity(NeedsExpertReview)
// TODO docs
key: string @grafanamaturity(NeedsExpertReview)
// TODO docs
name: string @grafanamaturity(NeedsExpertReview)
// TODO docs
orgId: uint32 @grafanamaturity(NeedsExpertReview)
// TODO docs
updated: string @grafanamaturity(NeedsExpertReview)
// TODO docs
url?: string @grafanamaturity(NeedsExpertReview)
// TODO docs
userId: uint32 @grafanamaturity(NeedsExpertReview)
} @grafanamaturity(NeedsExpertReview)
@ -377,7 +367,7 @@ lineage: seqs: [
repeat?: string @grafanamaturity(NeedsExpertReview)
// Direction to repeat in if 'repeat' is set.
// "h" for horizontal, "v" for vertical.
// TODO this is probably optional
// TODO this is probably optional
repeatDirection: *"h" | "v" @grafanamaturity(NeedsExpertReview)
// Id of the repeating panel.
repeatPanelId?: int64 @grafanamaturity(NeedsExpertReview)
@ -509,11 +499,11 @@ lineage: seqs: [
#GraphPanel: {
type: "graph" @grafanamaturity(NeedsExpertReview)
// @deprecated this is part of deprecated graph panel
legend?: {
show: bool | *true
sort?: string
legend?: {
show: bool | *true
sort?: string
sortDesc?: bool
}
}
...
} @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview)
#HeatmapPanel: {

View File

@ -101,9 +101,6 @@ export const defaultVariableModel: Partial<VariableModel> = {
skipUrlSync: false,
};
/**
* TODO: There is a bug generating the names, they are always title case
*/
export enum VariableHide {
DontHide = 0,
HideLabel = 1,

View File

@ -1,6 +1,10 @@
package codegen
import (
"bytes"
"github.com/dave/dst/decorator"
"github.com/dave/dst/dstutil"
"github.com/grafana/codejen"
"github.com/grafana/thema/encoding/gocode"
"golang.org/x/tools/go/ast/astutil"
@ -8,7 +12,9 @@ import (
// GoTypesJenny creates a [OneToOne] that produces Go types for the provided
// [thema.Schema].
type GoTypesJenny struct{}
type GoTypesJenny struct {
ApplyFuncs []astutil.ApplyFunc
}
func (j GoTypesJenny) JennyName() string {
return "GoTypesJenny"
@ -19,7 +25,28 @@ func (j GoTypesJenny) Generate(sfg SchemaForGen) (*codejen.File, error) {
b, err := gocode.GenerateTypesOpenAPI(sfg.Schema, &gocode.TypeConfigOpenAPI{
// TODO will need to account for sanitizing e.g. dashes here at some point
PackageName: sfg.Schema.Lineage().Name(),
ApplyFuncs: []astutil.ApplyFunc{PrefixDropper(sfg.Name)},
ApplyFuncs: append(j.ApplyFuncs, PrefixDropper(sfg.Name)),
})
if err != nil {
return nil, err
}
// TODO switch to dst completely in thema so this can be made an ApplyFuncs element
fb, err := decorator.Parse(b)
if err != nil {
return nil, err
}
dstutil.Apply(fb, DecoderCompactor(), nil)
buf := new(bytes.Buffer)
err = decorator.Fprint(buf, fb)
if err != nil {
return nil, err
}
b, err = postprocessGoFile(genGoFile{
path: "",
walker: nil,
in: buf.Bytes(),
})
if err != nil {
return nil, err

View File

@ -12,6 +12,8 @@ import (
"regexp"
"strings"
"github.com/dave/dst"
"github.com/dave/dst/dstutil"
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/imports"
)
@ -163,3 +165,75 @@ func (d prefixmod) do(n *ast.Ident) {
n.Name = d.replace
}
}
func isSingleTypeDecl(gd *dst.GenDecl) bool {
if gd.Tok == token.TYPE && len(gd.Specs) == 1 {
_, is := gd.Specs[0].(*dst.TypeSpec)
return is
}
return false
}
func isAdditionalPropertiesStruct(tspec *dst.TypeSpec) (dst.Expr, bool) {
strct, is := tspec.Type.(*dst.StructType)
if is && len(strct.Fields.List) == 1 && strct.Fields.List[0].Names[0].Name == "AdditionalProperties" {
return strct.Fields.List[0].Type, true
}
return nil, false
}
func DecoderCompactor() dstutil.ApplyFunc {
return func(c *dstutil.Cursor) bool {
f, is := c.Node().(*dst.File)
if !is {
return false
}
compact := make(map[string]bool)
// walk the file decls
for _, decl := range f.Decls {
if fd, is := decl.(*dst.FuncDecl); is {
compact[ddepoint(fd.Recv.List[0].Type).(*dst.Ident).Name] = true
}
}
if len(compact) == 0 {
return false
}
replace := make(map[string]dst.Expr)
// Walk again, looking for types we found
for _, decl := range f.Decls {
if gd, is := decl.(*dst.GenDecl); is && isSingleTypeDecl(gd) {
if tspec := gd.Specs[0].(*dst.TypeSpec); compact[tspec.Name.Name] {
if expr, is := isAdditionalPropertiesStruct(tspec); is {
replace[tspec.Name.Name] = expr
}
}
}
}
dstutil.Apply(f, func(c *dstutil.Cursor) bool {
switch x := c.Node().(type) {
case *dst.FuncDecl:
c.Delete()
case *dst.GenDecl:
if isSingleTypeDecl(x) && compact[x.Specs[0].(*dst.TypeSpec).Name.Name] {
c.Delete()
}
case *dst.Field:
if id, is := x.Type.(*dst.Ident); is {
if expr, has := replace[id.Name]; has {
x.Type = expr
}
}
}
return true
}, nil)
return false
}
}
func ddepoint(e dst.Expr) dst.Expr {
if star, is := e.(*dst.StarExpr); is {
return star.X
}
return e
}

View File

@ -10,45 +10,20 @@
package dashboard
// Defines values for GraphTooltip.
// Defines values for CursorSync.
const (
GraphTooltipN0 GraphTooltip = 0
CursorSyncN0 CursorSync = 0
GraphTooltipN1 GraphTooltip = 1
CursorSyncN1 CursorSync = 1
GraphTooltipN2 GraphTooltip = 2
CursorSyncN2 CursorSync = 2
)
// Defines values for Style.
// Defines values for LinkType.
const (
StyleDark Style = "dark"
LinkTypeDashboards LinkType = "dashboards"
StyleLight Style = "light"
)
// Defines values for Timezone.
const (
TimezoneBrowser Timezone = "browser"
TimezoneEmpty Timezone = ""
TimezoneUtc Timezone = "utc"
)
// Defines values for DashboardCursorSync.
const (
DashboardCursorSyncN0 DashboardCursorSync = 0
DashboardCursorSyncN1 DashboardCursorSync = 1
DashboardCursorSyncN2 DashboardCursorSync = 2
)
// Defines values for DashboardLinkType.
const (
DashboardLinkTypeDashboards DashboardLinkType = "dashboards"
DashboardLinkTypeLink DashboardLinkType = "link"
LinkTypeLink LinkType = "link"
)
// Defines values for FieldColorModeId.
@ -114,16 +89,6 @@ const (
PanelRepeatDirectionV PanelRepeatDirection = "v"
)
// Defines values for RangeMapType.
const (
RangeMapTypeRange RangeMapType = "range"
)
// Defines values for RegexMapType.
const (
RegexMapTypeRegex RegexMapType = "regex"
)
// Defines values for RowPanelType.
const (
RowPanelTypeRow RowPanelType = "row"
@ -136,11 +101,6 @@ const (
SpecialValueMapOptionsMatchTrue SpecialValueMapOptionsMatch = "true"
)
// Defines values for SpecialValueMapType.
const (
SpecialValueMapTypeSpecial SpecialValueMapType = "special"
)
// Defines values for SpecialValueMatch.
const (
SpecialValueMatchEmpty SpecialValueMatch = "empty"
@ -156,13 +116,6 @@ const (
SpecialValueMatchTrue SpecialValueMatch = "true"
)
// Defines values for ThresholdsConfigMode.
const (
ThresholdsConfigModeAbsolute ThresholdsConfigMode = "absolute"
ThresholdsConfigModePercentage ThresholdsConfigMode = "percentage"
)
// Defines values for ThresholdsMode.
const (
ThresholdsModeAbsolute ThresholdsMode = "absolute"
@ -170,11 +123,6 @@ const (
ThresholdsModePercentage ThresholdsMode = "percentage"
)
// Defines values for ValueMapType.
const (
ValueMapTypeValue ValueMapType = "value"
)
// Defines values for VariableHide.
const (
VariableHideN0 VariableHide = 0
@ -184,47 +132,6 @@ const (
VariableHideN2 VariableHide = 2
)
// Defines values for VariableModelHide.
const (
VariableModelHideN0 VariableModelHide = 0
VariableModelHideN1 VariableModelHide = 1
VariableModelHideN2 VariableModelHide = 2
)
// Defines values for VariableModelState.
const (
VariableModelStateDone VariableModelState = "Done"
VariableModelStateError VariableModelState = "Error"
VariableModelStateLoading VariableModelState = "Loading"
VariableModelStateNotStarted VariableModelState = "NotStarted"
VariableModelStateStreaming VariableModelState = "Streaming"
)
// Defines values for VariableModelType.
const (
VariableModelTypeAdhoc VariableModelType = "adhoc"
VariableModelTypeConstant VariableModelType = "constant"
VariableModelTypeCustom VariableModelType = "custom"
VariableModelTypeDatasource VariableModelType = "datasource"
VariableModelTypeInterval VariableModelType = "interval"
VariableModelTypeQuery VariableModelType = "query"
VariableModelTypeSystem VariableModelType = "system"
VariableModelTypeTextbox VariableModelType = "textbox"
)
// Defines values for VariableType.
const (
VariableTypeAdhoc VariableType = "adhoc"
@ -244,108 +151,21 @@ const (
VariableTypeTextbox VariableType = "textbox"
)
// Dashboard defines model for dashboard.
type Dashboard struct {
Annotations *struct {
// TODO docs
List *[]AnnotationQuery `json:"list,omitempty"`
} `json:"annotations,omitempty"`
// Defines values for Style.
const (
StyleDark Style = "dark"
// Description of dashboard.
Description *string `json:"description,omitempty"`
StyleLight Style = "light"
)
// Whether a dashboard is editable or not.
Editable bool `json:"editable"`
// Defines values for Timezone.
const (
TimezoneBrowser Timezone = "browser"
// TODO docs
FiscalYearStartMonth *int `json:"fiscalYearStartMonth,omitempty"`
GnetId *string `json:"gnetId,omitempty"`
GraphTooltip GraphTooltip `json:"graphTooltip"`
TimezoneEmpty Timezone = ""
// Unique numeric identifier for the dashboard.
// TODO must isolate or remove identifiers local to a Grafana instance...?
Id *int64 `json:"id,omitempty"`
// TODO docs
Links *[]DashboardLink `json:"links,omitempty"`
// TODO docs
LiveNow *bool `json:"liveNow,omitempty"`
Panels *[]interface{} `json:"panels,omitempty"`
// TODO docs
Refresh *interface{} `json:"refresh,omitempty"`
// Version of the current dashboard data
Revision int `json:"revision"`
// Version of the JSON schema, incremented each time a Grafana update brings
// changes to said schema.
// TODO this is the existing schema numbering system. It will be replaced by Thema's themaVersion
SchemaVersion int `json:"schemaVersion"`
// TODO docs
Snapshot *Snapshot `json:"snapshot,omitempty"`
// Theme of dashboard.
Style Style `json:"style"`
// Tags associated with dashboard.
Tags *[]string `json:"tags,omitempty"`
Templating *struct {
// TODO docs
List *[]VariableModel `json:"list,omitempty"`
} `json:"templating,omitempty"`
// Time range for dashboard, e.g. last 6 hours, last 7 days, etc
Time *struct {
From string `json:"from"`
To string `json:"to"`
} `json:"time,omitempty"`
// TODO docs
// TODO this appears to be spread all over in the frontend. Concepts will likely need tidying in tandem with schema changes
Timepicker *struct {
// Whether timepicker is collapsed or not.
Collapse bool `json:"collapse"`
// Whether timepicker is enabled or not.
Enable bool `json:"enable"`
// Whether timepicker is visible or not.
Hidden bool `json:"hidden"`
// Selectable intervals for auto-refresh.
RefreshIntervals []string `json:"refresh_intervals"`
// TODO docs
TimeOptions []string `json:"time_options"`
} `json:"timepicker,omitempty"`
// Timezone of dashboard,
Timezone *Timezone `json:"timezone,omitempty"`
// Title of dashboard.
Title *string `json:"title,omitempty"`
// Unique dashboard identifier that can be generated by anyone. string (8-40)
Uid *string `json:"uid,omitempty"`
// Version of the dashboard, incremented each time the dashboard is updated.
Version *int `json:"version,omitempty"`
// TODO docs
WeekStart *string `json:"weekStart,omitempty"`
}
// GraphTooltip defines model for Dashboard.GraphTooltip.
type GraphTooltip int
// Theme of dashboard.
type Style string
// Timezone of dashboard,
type Timezone string
TimezoneUtc Timezone = "utc"
)
// TODO docs
// FROM: AnnotationQuery in grafana-data/src/types/annotations.ts
@ -390,25 +210,27 @@ type AnnotationTarget struct {
// 0 for no shared crosshair or tooltip (default).
// 1 for shared crosshair.
// 2 for shared crosshair AND shared tooltip.
type DashboardCursorSync int
type CursorSync int
// FROM public/app/features/dashboard/state/Models.ts - ish
// TODO docs
type DashboardLink struct {
AsDropdown bool `json:"asDropdown"`
Icon string `json:"icon"`
IncludeVars bool `json:"includeVars"`
KeepTime bool `json:"keepTime"`
Tags []string `json:"tags"`
TargetBlank bool `json:"targetBlank"`
Title string `json:"title"`
Tooltip string `json:"tooltip"`
Type DashboardLinkType `json:"type"`
Url string `json:"url"`
type Link struct {
AsDropdown bool `json:"asDropdown"`
Icon string `json:"icon"`
IncludeVars bool `json:"includeVars"`
KeepTime bool `json:"keepTime"`
Tags []string `json:"tags"`
TargetBlank bool `json:"targetBlank"`
Title string `json:"title"`
Tooltip string `json:"tooltip"`
// TODO docs
Type LinkType `json:"type"`
Url string `json:"url"`
}
// DashboardLinkType defines model for DashboardLink.Type.
type DashboardLinkType string
// TODO docs
type LinkType string
// Ref to a DataSource instance
type DataSourceRef struct {
@ -419,7 +241,7 @@ type DataSourceRef struct {
Uid *string `json:"uid,omitempty"`
}
// DynamicConfigValue defines model for dashboard.DynamicConfigValue.
// DynamicConfigValue defines model for DynamicConfigValue.
type DynamicConfigValue struct {
Id string `json:"id"`
Value *interface{} `json:"value,omitempty"`
@ -443,7 +265,7 @@ type FieldColorModeId string
// TODO docs
type FieldColorSeriesByMode string
// FieldConfig defines model for dashboard.FieldConfig.
// FieldConfig defines model for FieldConfig.
type FieldConfig struct {
// TODO docs
Color *FieldColor `json:"color,omitempty"`
@ -494,66 +316,12 @@ type FieldConfig struct {
Writeable *bool `json:"writeable,omitempty"`
}
// FieldConfigSource defines model for dashboard.FieldConfigSource.
// FieldConfigSource defines model for FieldConfigSource.
type FieldConfigSource struct {
Defaults struct {
// TODO docs
Color *FieldColor `json:"color,omitempty"`
// custom is specified by the PanelFieldConfig field
// in panel plugin schemas.
Custom *map[string]interface{} `json:"custom,omitempty"`
// Significant digits (for display)
Decimals *float32 `json:"decimals,omitempty"`
// Human readable field metadata
Description *string `json:"description,omitempty"`
// The display value for this field. This supports template variables blank is auto
DisplayName *string `json:"displayName,omitempty"`
// This can be used by data sources that return and explicit naming structure for values and labels
// When this property is configured, this value is used rather than the default naming strategy.
DisplayNameFromDS *string `json:"displayNameFromDS,omitempty"`
// True if data source field supports ad-hoc filters
Filterable *bool `json:"filterable,omitempty"`
// The behavior when clicking on a result
Links *[]interface{} `json:"links,omitempty"`
// Convert input values into a display string
Mappings *[]ValueMapping `json:"mappings,omitempty"`
Max *float32 `json:"max,omitempty"`
Min *float32 `json:"min,omitempty"`
// Alternative to empty string
NoValue *string `json:"noValue,omitempty"`
// An explicit path to the field in the datasource. When the frame meta includes a path,
// This will default to `${frame.meta.path}/${field.name}
//
// When defined, this value can be used as an identifier within the datasource scope, and
// may be used to update the results
Path *string `json:"path,omitempty"`
Thresholds *ThresholdsConfig `json:"thresholds,omitempty"`
// Numeric Options
Unit *string `json:"unit,omitempty"`
// True if data source can write a value to the path. Auth/authz are supported separately
Writeable *bool `json:"writeable,omitempty"`
} `json:"defaults"`
Defaults FieldConfig `json:"defaults"`
Overrides []struct {
Matcher struct {
Id string `json:"id"`
Options *interface{} `json:"options,omitempty"`
} `json:"matcher"`
Properties []struct {
Id string `json:"id"`
Value *interface{} `json:"value,omitempty"`
} `json:"properties"`
Matcher MatcherConfig `json:"matcher"`
Properties []DynamicConfigValue `json:"properties"`
} `json:"overrides"`
}
@ -571,7 +339,7 @@ type GraphPanel struct {
// GraphPanelType defines model for GraphPanel.Type.
type GraphPanelType string
// GridPos defines model for dashboard.GridPos.
// GridPos defines model for GridPos.
type GridPos struct {
// Panel
H int `json:"h"`
@ -589,7 +357,7 @@ type GridPos struct {
Y int `json:"y"`
}
// HeatmapPanel defines model for dashboard.HeatmapPanel.
// HeatmapPanel defines model for HeatmapPanel.
type HeatmapPanel struct {
Type HeatmapPanelType `json:"type"`
}
@ -597,13 +365,13 @@ type HeatmapPanel struct {
// HeatmapPanelType defines model for HeatmapPanel.Type.
type HeatmapPanelType string
// LoadingState defines model for dashboard.LoadingState.
// LoadingState defines model for LoadingState.
type LoadingState string
// TODO docs
type MappingType string
// MatcherConfig defines model for dashboard.MatcherConfig.
// MatcherConfig defines model for MatcherConfig.
type MatcherConfig struct {
Id string `json:"id"`
Options *interface{} `json:"options,omitempty"`
@ -620,69 +388,9 @@ type Panel struct {
} `json:"datasource,omitempty"`
// Description.
Description *string `json:"description,omitempty"`
FieldConfig struct {
Defaults struct {
// TODO docs
Color *FieldColor `json:"color,omitempty"`
// custom is specified by the PanelFieldConfig field
// in panel plugin schemas.
Custom *map[string]interface{} `json:"custom,omitempty"`
// Significant digits (for display)
Decimals *float32 `json:"decimals,omitempty"`
// Human readable field metadata
Description *string `json:"description,omitempty"`
// The display value for this field. This supports template variables blank is auto
DisplayName *string `json:"displayName,omitempty"`
// This can be used by data sources that return and explicit naming structure for values and labels
// When this property is configured, this value is used rather than the default naming strategy.
DisplayNameFromDS *string `json:"displayNameFromDS,omitempty"`
// True if data source field supports ad-hoc filters
Filterable *bool `json:"filterable,omitempty"`
// The behavior when clicking on a result
Links *[]interface{} `json:"links,omitempty"`
// Convert input values into a display string
Mappings *[]ValueMapping `json:"mappings,omitempty"`
Max *float32 `json:"max,omitempty"`
Min *float32 `json:"min,omitempty"`
// Alternative to empty string
NoValue *string `json:"noValue,omitempty"`
// An explicit path to the field in the datasource. When the frame meta includes a path,
// This will default to `${frame.meta.path}/${field.name}
//
// When defined, this value can be used as an identifier within the datasource scope, and
// may be used to update the results
Path *string `json:"path,omitempty"`
Thresholds *ThresholdsConfig `json:"thresholds,omitempty"`
// Numeric Options
Unit *string `json:"unit,omitempty"`
// True if data source can write a value to the path. Auth/authz are supported separately
Writeable *bool `json:"writeable,omitempty"`
} `json:"defaults"`
Overrides []struct {
Matcher struct {
Id string `json:"id"`
Options *interface{} `json:"options,omitempty"`
} `json:"matcher"`
Properties []struct {
Id string `json:"id"`
Value *interface{} `json:"value,omitempty"`
} `json:"properties"`
} `json:"overrides"`
} `json:"fieldConfig"`
GridPos *GridPos `json:"gridPos,omitempty"`
Description *string `json:"description,omitempty"`
FieldConfig FieldConfigSource `json:"fieldConfig"`
GridPos *GridPos `json:"gridPos,omitempty"`
// TODO docs
Id *int `json:"id,omitempty"`
@ -693,7 +401,7 @@ type Panel struct {
// Panel links.
// TODO fill this out - seems there are a couple variants?
Links *[]DashboardLink `json:"links,omitempty"`
Links *[]Link `json:"links,omitempty"`
// TODO docs
MaxDataPoints *float32 `json:"maxDataPoints,omitempty"`
@ -737,11 +445,8 @@ type Panel struct {
TimeShift *string `json:"timeShift,omitempty"`
// Panel title.
Title *string `json:"title,omitempty"`
Transformations []struct {
Id string `json:"id"`
Options map[string]interface{} `json:"options"`
} `json:"transformations"`
Title *string `json:"title,omitempty"`
Transformations []Transformation `json:"transformations"`
// Whether to display the panel without a background.
Transparent bool `json:"transparent"`
@ -759,37 +464,33 @@ type PanelRepeatDirection string
type RangeMap struct {
Options struct {
// to and from are `number | null` in current ts, really not sure what to do
From float64 `json:"from"`
Result struct {
Color *string `json:"color,omitempty"`
Icon *string `json:"icon,omitempty"`
Index *int32 `json:"index,omitempty"`
Text *string `json:"text,omitempty"`
} `json:"result"`
To float64 `json:"to"`
} `json:"options"`
Type RangeMapType `json:"type"`
}
From float64 `json:"from"`
// RangeMapType defines model for RangeMap.Type.
type RangeMapType string
// TODO docs
Result ValueMappingResult `json:"result"`
To float64 `json:"to"`
} `json:"options"`
Type struct {
// Embedded struct due to allOf(#/components/schemas/MappingType)
MappingType `yaml:",inline"`
// Embedded fields due to inline allOf schema
} `json:"type"`
}
// TODO docs
type RegexMap struct {
Options struct {
Pattern string `json:"pattern"`
Result struct {
Color *string `json:"color,omitempty"`
Icon *string `json:"icon,omitempty"`
Index *int32 `json:"index,omitempty"`
Text *string `json:"text,omitempty"`
} `json:"result"`
} `json:"options"`
Type RegexMapType `json:"type"`
}
// RegexMapType defines model for RegexMap.Type.
type RegexMapType string
// TODO docs
Result ValueMappingResult `json:"result"`
} `json:"options"`
Type struct {
// Embedded struct due to allOf(#/components/schemas/MappingType)
MappingType `yaml:",inline"`
// Embedded fields due to inline allOf schema
} `json:"type"`
}
// Row panel
type RowPanel struct {
@ -854,22 +555,20 @@ type SpecialValueMap struct {
Options struct {
Match SpecialValueMapOptionsMatch `json:"match"`
Pattern string `json:"pattern"`
Result struct {
Color *string `json:"color,omitempty"`
Icon *string `json:"icon,omitempty"`
Index *int32 `json:"index,omitempty"`
Text *string `json:"text,omitempty"`
} `json:"result"`
// TODO docs
Result ValueMappingResult `json:"result"`
} `json:"options"`
Type SpecialValueMapType `json:"type"`
Type struct {
// Embedded struct due to allOf(#/components/schemas/MappingType)
MappingType `yaml:",inline"`
// Embedded fields due to inline allOf schema
} `json:"type"`
}
// SpecialValueMapOptionsMatch defines model for SpecialValueMap.Options.Match.
type SpecialValueMapOptionsMatch string
// SpecialValueMapType defines model for SpecialValueMap.Type.
type SpecialValueMapType string
// TODO docs
type SpecialValueMatch string
@ -897,30 +596,15 @@ type Threshold struct {
Value *float32 `json:"value,omitempty"`
}
// ThresholdsConfig defines model for dashboard.ThresholdsConfig.
// ThresholdsConfig defines model for ThresholdsConfig.
type ThresholdsConfig struct {
Mode ThresholdsConfigMode `json:"mode"`
Mode ThresholdsMode `json:"mode"`
// Must be sorted by 'value', first value is always -Infinity
Steps []struct {
// TODO docs
Color string `json:"color"`
// TODO docs
// TODO are the values here enumerable into a disjunction?
// Some seem to be listed in typescript comment
State *string `json:"state,omitempty"`
// TODO docs
// FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON
Value *float32 `json:"value,omitempty"`
} `json:"steps"`
Steps []Threshold `json:"steps"`
}
// ThresholdsConfigMode defines model for ThresholdsConfig.Mode.
type ThresholdsConfigMode string
// ThresholdsMode defines model for dashboard.ThresholdsMode.
// ThresholdsMode defines model for ThresholdsMode.
type ThresholdsMode string
// TODO docs
@ -932,13 +616,14 @@ type Transformation struct {
// TODO docs
type ValueMap struct {
Options map[string]interface{} `json:"options"`
Type ValueMapType `json:"type"`
Options map[string]ValueMappingResult `json:"options"`
Type struct {
// Embedded struct due to allOf(#/components/schemas/MappingType)
MappingType `yaml:",inline"`
// Embedded fields due to inline allOf schema
} `json:"type"`
}
// ValueMapType defines model for ValueMap.Type.
type ValueMapType string
// TODO docs
type ValueMapping interface{}
@ -950,7 +635,7 @@ type ValueMappingResult struct {
Text *string `json:"text,omitempty"`
}
// TODO: There is a bug generating the names, they are always title case
// VariableHide defines model for VariableHide.
type VariableHide int
// FROM: packages/grafana-data/src/types/templateVars.ts
@ -963,30 +648,130 @@ type VariableModel struct {
Description *string `json:"description,omitempty"`
Error *map[string]interface{} `json:"error,omitempty"`
Global bool `json:"global"`
Hide VariableModelHide `json:"hide"`
Hide VariableHide `json:"hide"`
Id string `json:"id"`
Index int `json:"index"`
Label *string `json:"label,omitempty"`
Name string `json:"name"`
// TODO: Move this into a separated QueryVariableModel type
Query *interface{} `json:"query,omitempty"`
RootStateKey *string `json:"rootStateKey,omitempty"`
SkipUrlSync bool `json:"skipUrlSync"`
State VariableModelState `json:"state"`
Type VariableModelType `json:"type"`
Query *interface{} `json:"query,omitempty"`
RootStateKey *string `json:"rootStateKey,omitempty"`
SkipUrlSync bool `json:"skipUrlSync"`
State LoadingState `json:"state"`
// FROM: packages/grafana-data/src/types/templateVars.ts
// TODO docs
// TODO this implies some wider pattern/discriminated union, probably?
Type VariableType `json:"type"`
}
// VariableModelHide defines model for VariableModel.Hide.
type VariableModelHide int
// VariableModelState defines model for VariableModel.State.
type VariableModelState string
// VariableModelType defines model for VariableModel.Type.
type VariableModelType string
// FROM: packages/grafana-data/src/types/templateVars.ts
// TODO docs
// TODO this implies some wider pattern/discriminated union, probably?
type VariableType string
// Dashboard defines model for dashboard.
type Dashboard struct {
// TODO docs
Annotations *struct {
List *[]AnnotationQuery `json:"list,omitempty"`
} `json:"annotations,omitempty"`
// Description of dashboard.
Description *string `json:"description,omitempty"`
// Whether a dashboard is editable or not.
Editable bool `json:"editable"`
// TODO docs
FiscalYearStartMonth *int `json:"fiscalYearStartMonth,omitempty"`
GnetId *string `json:"gnetId,omitempty"`
// 0 for no shared crosshair or tooltip (default).
// 1 for shared crosshair.
// 2 for shared crosshair AND shared tooltip.
GraphTooltip CursorSync `json:"graphTooltip"`
// Unique numeric identifier for the dashboard.
// TODO must isolate or remove identifiers local to a Grafana instance...?
Id *int64 `json:"id,omitempty"`
// TODO docs
Links *[]Link `json:"links,omitempty"`
// TODO docs
LiveNow *bool `json:"liveNow,omitempty"`
Panels *[]interface{} `json:"panels,omitempty"`
// TODO docs
Refresh *interface{} `json:"refresh,omitempty"`
// Version of the current dashboard data
Revision int `json:"revision"`
// Version of the JSON schema, incremented each time a Grafana update brings
// changes to said schema.
// TODO this is the existing schema numbering system. It will be replaced by Thema's themaVersion
SchemaVersion int `json:"schemaVersion"`
// TODO docs
Snapshot *Snapshot `json:"snapshot,omitempty"`
// Theme of dashboard.
Style Style `json:"style"`
// Tags associated with dashboard.
Tags *[]string `json:"tags,omitempty"`
// TODO docs
Templating *struct {
List *[]VariableModel `json:"list,omitempty"`
} `json:"templating,omitempty"`
// Time range for dashboard, e.g. last 6 hours, last 7 days, etc
Time *struct {
From string `json:"from"`
To string `json:"to"`
} `json:"time,omitempty"`
// TODO docs
// TODO this appears to be spread all over in the frontend. Concepts will likely need tidying in tandem with schema changes
Timepicker *struct {
// Whether timepicker is collapsed or not.
Collapse bool `json:"collapse"`
// Whether timepicker is enabled or not.
Enable bool `json:"enable"`
// Whether timepicker is visible or not.
Hidden bool `json:"hidden"`
// Selectable intervals for auto-refresh.
RefreshIntervals []string `json:"refresh_intervals"`
// TODO docs
TimeOptions []string `json:"time_options"`
} `json:"timepicker,omitempty"`
// Timezone of dashboard,
Timezone *Timezone `json:"timezone,omitempty"`
// Title of dashboard.
Title *string `json:"title,omitempty"`
// Unique dashboard identifier that can be generated by anyone. string (8-40)
Uid *string `json:"uid,omitempty"`
// Version of the dashboard, incremented each time the dashboard is updated.
Version *int `json:"version,omitempty"`
// TODO docs
WeekStart *string `json:"weekStart,omitempty"`
}
// Theme of dashboard.
type Style string
// Timezone of dashboard,
type Timezone string

View File

@ -10,40 +10,22 @@
package playlist
// Defines values for PlaylistItemType.
// Defines values for ItemType.
const (
PlaylistItemTypeDashboardById PlaylistItemType = "dashboard_by_id"
ItemTypeDashboardById ItemType = "dashboard_by_id"
PlaylistItemTypeDashboardByTag PlaylistItemType = "dashboard_by_tag"
ItemTypeDashboardByTag ItemType = "dashboard_by_tag"
PlaylistItemTypeDashboardByUid PlaylistItemType = "dashboard_by_uid"
ItemTypeDashboardByUid ItemType = "dashboard_by_uid"
)
// Playlist defines model for playlist.
type Playlist struct {
// Interval sets the time between switching views in a playlist.
// FIXME: Is this based on a standardized format or what options are available? Can datemath be used?
Interval string `json:"interval"`
// The ordered list of items that the playlist will iterate over.
// FIXME! This should not be optional, but changing it makes the godegen awkward
Items *[]PlaylistItem `json:"items,omitempty"`
// Name of the playlist.
Name string `json:"name"`
// Unique playlist identifier. Generated on creation, either by the
// creator of the playlist of by the application.
Uid string `json:"uid"`
}
// PlaylistItem defines model for playlist.Item.
type PlaylistItem struct {
// Item defines model for Item.
type Item struct {
// Title is an unused property -- it will be removed in the future
Title *string `json:"title,omitempty"`
// Type of the item.
Type PlaylistItemType `json:"type"`
Type ItemType `json:"type"`
// Value depends on type and describes the playlist item.
//
@ -57,4 +39,22 @@ type PlaylistItem struct {
}
// Type of the item.
type PlaylistItemType string
type ItemType string
// Playlist defines model for playlist.
type Playlist struct {
// Interval sets the time between switching views in a playlist.
// FIXME: Is this based on a standardized format or what options are available? Can datemath be used?
Interval string `json:"interval"`
// The ordered list of items that the playlist will iterate over.
// FIXME! This should not be optional, but changing it makes the godegen awkward
Items *[]Item `json:"items,omitempty"`
// Name of the playlist.
Name string `json:"name"`
// Unique playlist identifier. Generated on creation, either by the
// creator of the playlist of by the application.
Uid string `json:"uid"`
}

View File

@ -19,10 +19,13 @@ const (
PermissionN4 Permission = 4
)
// Permission defines model for Permission.
type Permission int
// Team defines model for team.
type Team struct {
// AccessControl metadata associated with a given resource.
AccessControl map[string]interface{} `json:"accessControl"`
AccessControl map[string]bool `json:"accessControl"`
// AvatarUrl is the team's avatar URL.
AvatarUrl *string `json:"avatarUrl,omitempty"`
@ -40,14 +43,9 @@ type Team struct {
Name string `json:"name"`
// OrgId is the ID of an organisation the team belongs to.
OrgId int64 `json:"orgId"`
// TODO - it seems it's a team_member.permission, unlikely it should belong to the team kind
OrgId int64 `json:"orgId"`
Permission Permission `json:"permission"`
// Updated indicates when the team was updated.
Updated int64 `json:"updated"`
}
// TODO - it seems it's a team_member.permission, unlikely it should belong to the team kind
type Permission int

View File

@ -62,15 +62,17 @@ func (j *jennytypego) JennyName() string {
}
func (j *jennytypego) Generate(lin thema.Lineage) (*codejen.File, error) {
b, err := gocode.GenerateTypesOpenAPI(lin.Latest(), &gocode.TypeConfigOpenAPI{
ApplyFuncs: []astutil.ApplyFunc{
codegen.PrefixReplacer("Plugindef", "PluginDef"),
},
f, err := codegen.GoTypesJenny{ApplyFuncs: []astutil.ApplyFunc{
codegen.PrefixReplacer("Plugindef", "PluginDef"),
}}.Generate(codegen.SchemaForGen{
Name: "PluginDef",
Schema: lin.Latest(),
IsGroup: false,
})
if err != nil {
return nil, err
if f != nil {
f.RelativePath = filepath.Join(dirPlugindef, f.RelativePath)
}
return codejen.NewFile(filepath.Join(dirPlugindef, "plugindef_types_gen.go"), b, j), nil
return f, err
}
// one-off jenny for plugindef go bindings

View File

@ -77,7 +77,7 @@ func baseLineage(rt *thema.Runtime, opts ...thema.BindOption) (thema.Lineage, er
// but is invalid due to the violation of some general Thema invariant -
// for example, declared schemas don't follow backwards compatibility rules,
// lenses are incomplete.
return thema.BindLineage(raw, rt)
return thema.BindLineage(raw, rt, opts...)
}
// type guards

View File

@ -3,44 +3,12 @@
// Generated by:
// pkg/plugins/plugindef/gen.go
// Using jennies:
// PluginGoTypes
// GoTypesJenny
//
// Run 'make gen-cue' from repository root to regenerate.
package plugindef
// Defines values for Category.
const (
CategoryCloud Category = "cloud"
CategoryEnterprise Category = "enterprise"
CategoryLogging Category = "logging"
CategoryOther Category = "other"
CategoryProfiling Category = "profiling"
CategorySql Category = "sql"
CategoryTracing Category = "tracing"
CategoryTsdb Category = "tsdb"
)
// Defines values for Type.
const (
TypeApp Type = "app"
TypeDatasource Type = "datasource"
TypePanel Type = "panel"
TypeRenderer Type = "renderer"
TypeSecretsmanager Type = "secretsmanager"
)
// Defines values for BasicRole.
const (
BasicRoleAdmin BasicRole = "Admin"
@ -98,17 +66,298 @@ const (
ReleaseStateStable ReleaseState = "stable"
)
// Defines values for RoleRegistrationGrants.
// Defines values for Category.
const (
RoleRegistrationGrantsAdmin RoleRegistrationGrants = "Admin"
CategoryCloud Category = "cloud"
RoleRegistrationGrantsEditor RoleRegistrationGrants = "Editor"
CategoryEnterprise Category = "enterprise"
RoleRegistrationGrantsGrafanaAdmin RoleRegistrationGrants = "Grafana Admin"
CategoryLogging Category = "logging"
RoleRegistrationGrantsViewer RoleRegistrationGrants = "Viewer"
CategoryOther Category = "other"
CategoryProfiling Category = "profiling"
CategorySql Category = "sql"
CategoryTracing Category = "tracing"
CategoryTsdb Category = "tsdb"
)
// Defines values for Type.
const (
TypeApp Type = "app"
TypeDatasource Type = "datasource"
TypePanel Type = "panel"
TypeRenderer Type = "renderer"
TypeSecretsmanager Type = "secretsmanager"
)
// BasicRole is a Grafana basic role, which can be 'Viewer', 'Editor', 'Admin' or 'Grafana Admin'.
// With RBAC, the Admin basic role inherits its default permissions from the Editor basic role which
// in turn inherits them from the Viewer basic role.
type BasicRole string
// BuildInfo defines model for BuildInfo.
type BuildInfo struct {
// Git branch the plugin was built from.
Branch *string `json:"branch,omitempty"`
// Git hash of the commit the plugin was built from
Hash *string `json:"hash,omitempty"`
Number *int64 `json:"number,omitempty"`
// GitHub pull request the plugin was built from
Pr *int32 `json:"pr,omitempty"`
Repo *string `json:"repo,omitempty"`
// Time when the plugin was built, as a Unix timestamp.
Time *int64 `json:"time,omitempty"`
}
// Dependencies defines model for Dependencies.
type Dependencies struct {
// Required Grafana version for this plugin. Validated using
// https://github.com/npm/node-semver.
GrafanaDependency string `json:"grafanaDependency"`
// (Deprecated) Required Grafana version for this plugin, e.g.
// `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or
// v7.x.x.
GrafanaVersion *string `json:"grafanaVersion,omitempty"`
// An array of required plugins on which this plugin depends.
Plugins *[]Dependency `json:"plugins,omitempty"`
}
// Dependency describes another plugin on which a plugin depends.
// The id refers to the plugin package identifier, as given on
// the grafana.com plugin marketplace.
type Dependency struct {
Id string `json:"id"`
Name string `json:"name"`
Type DependencyType `json:"type"`
Version string `json:"version"`
}
// DependencyType defines model for Dependency.Type.
type DependencyType string
// Header describes an HTTP header that is forwarded with a proxied request for
// a plugin route.
type Header struct {
Content string `json:"content"`
Name string `json:"name"`
}
// A resource to be included in a plugin.
type Include struct {
// RBAC action the user must have to access the route
Action *string `json:"action,omitempty"`
// Add the include to the side menu.
AddToNav *bool `json:"addToNav,omitempty"`
// (Legacy) The Angular component to use for a page.
Component *string `json:"component,omitempty"`
// Page or dashboard when user clicks the icon in the side menu.
DefaultNav *bool `json:"defaultNav,omitempty"`
// Icon to use in the side menu. For information on available
// icon, refer to [Icons
// Overview](https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview).
Icon *string `json:"icon,omitempty"`
Name *string `json:"name,omitempty"`
// Used for app plugins.
Path *string `json:"path,omitempty"`
Role *IncludeRole `json:"role,omitempty"`
// IncludeType is a string identifier of a plugin include type, which is
// a superset of plugin types.
Type IncludeType `json:"type"`
// Unique identifier of the included resource
Uid *string `json:"uid,omitempty"`
}
// IncludeRole defines model for Include.Role.
type IncludeRole string
// IncludeType is a string identifier of a plugin include type, which is
// a superset of plugin types.
type IncludeType string
// Metadata about a Grafana plugin. Some fields are used on the plugins
// page in Grafana and others on grafana.com, if the plugin is published.
type Info struct {
// Information about the plugin author.
Author *struct {
// Author's name.
Email *string `json:"email,omitempty"`
// Author's name.
Name *string `json:"name,omitempty"`
// Link to author's website.
Url *string `json:"url,omitempty"`
} `json:"author,omitempty"`
Build *BuildInfo `json:"build,omitempty"`
// Description of plugin. Used on the plugins page in Grafana and
// for search on grafana.com.
Description *string `json:"description,omitempty"`
// Array of plugin keywords. Used for search on grafana.com.
Keywords []string `json:"keywords"`
// An array of link objects to be displayed on this plugin's
// project page in the form `{name: 'foo', url:
// 'http://example.com'}`
Links *[]struct {
Name *string `json:"name,omitempty"`
Url *string `json:"url,omitempty"`
} `json:"links,omitempty"`
// SVG images that are used as plugin icons.
Logos *struct {
// Link to the "large" version of the plugin logo, which must be
// an SVG image. "Large" and "small" logos can be the same image.
Large string `json:"large"`
// Link to the "small" version of the plugin logo, which must be
// an SVG image. "Large" and "small" logos can be the same image.
Small string `json:"small"`
} `json:"logos,omitempty"`
// An array of screenshot objects in the form `{name: 'bar', path:
// 'img/screenshot.png'}`
Screenshots *[]struct {
Name *string `json:"name,omitempty"`
Path *string `json:"path,omitempty"`
} `json:"screenshots,omitempty"`
// Date when this plugin was built.
Updated *string `json:"updated,omitempty"`
// Project version of this commit, e.g. `6.7.x`.
Version *string `json:"version,omitempty"`
}
// TODO docs
// TODO should this really be separate from TokenAuth?
type JWTTokenAuth struct {
// Parameters for the JWT token authentication request.
Params map[string]string `json:"params"`
// The list of scopes that your application should be granted
// access to.
Scopes []string `json:"scopes"`
// URL to fetch the JWT token.
Url string `json:"url"`
}
// Permission describes an RBAC permission on the plugin. A permission has an action and an optional
// scope.
// Example: action: 'test-app.schedules:read', scope: 'test-app.schedules:*'
type Permission struct {
Action string `json:"action"`
Scope *string `json:"scope,omitempty"`
}
// ReleaseState indicates release maturity state of a plugin.
type ReleaseState string
// Role describes an RBAC role which allows grouping multiple related permissions on the plugin,
// each of which has an action and an optional scope.
// Example: the role 'Schedules Reader' bundles permissions to view all schedules of the plugin.
type Role struct {
Description string `json:"description"`
Name string `json:"name"`
Permissions []Permission `json:"permissions"`
}
// RoleRegistration describes an RBAC role and its assignments to basic roles.
// It organizes related RBAC permissions on the plugin into a role and defines which basic roles
// will get them by default.
// Example: the role 'Schedules Reader' bundles permissions to view all schedules of the plugin
// which will be granted to Admins by default.
type RoleRegistration struct {
// Default assignment of the role to Grafana basic roles (Viewer, Editor, Admin, Grafana Admin)
// The Admin basic role inherits its default permissions from the Editor basic role which in turn
// inherits them from the Viewer basic role.
Grants []BasicRole `json:"grants"`
// Role describes an RBAC role which allows grouping multiple related permissions on the plugin,
// each of which has an action and an optional scope.
// Example: the role 'Schedules Reader' bundles permissions to view all schedules of the plugin.
Role Role `json:"role"`
}
// A proxy route used in datasource plugins for plugin authentication
// and adding headers to HTTP requests made by the plugin.
// For more information, refer to [Authentication for data source
// plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).
type Route struct {
// For data source plugins. Route headers set the body content and
// length to the proxied request.
Body *map[string]interface{} `json:"body,omitempty"`
// For data source plugins. Route headers adds HTTP headers to the
// proxied request.
Headers *[]Header `json:"headers,omitempty"`
// TODO docs
// TODO should this really be separate from TokenAuth?
JwtTokenAuth *JWTTokenAuth `json:"jwtTokenAuth,omitempty"`
// For data source plugins. Route method matches the HTTP verb
// like GET or POST. Multiple methods can be provided as a
// comma-separated list.
Method *string `json:"method,omitempty"`
// For data source plugins. The route path that is replaced by the
// route URL field when proxying the call.
Path *string `json:"path,omitempty"`
ReqRole *string `json:"reqRole,omitempty"`
ReqSignedIn *bool `json:"reqSignedIn,omitempty"`
// TODO docs
TokenAuth *TokenAuth `json:"tokenAuth,omitempty"`
// For data source plugins. Route URL is where the request is
// proxied to.
Url *string `json:"url,omitempty"`
UrlParams *[]URLParam `json:"urlParams,omitempty"`
}
// TODO docs
type TokenAuth struct {
// Parameters for the token authentication request.
Params map[string]string `json:"params"`
// The list of scopes that your application should be granted
// access to.
Scopes *[]string `json:"scopes,omitempty"`
// URL to fetch the authentication token.
Url *string `json:"url,omitempty"`
}
// URLParam describes query string parameters for
// a url in a plugin route
type URLParam struct {
Content string `json:"content"`
Name string `json:"name"`
}
// PluginDef defines model for plugindef.
type PluginDef struct {
// For data source plugins, if the plugin supports alerting.
@ -130,22 +379,8 @@ type PluginDef struct {
BuiltIn bool `json:"builtIn"`
// Plugin category used on the Add data source page.
Category *Category `json:"category,omitempty"`
// Dependencies needed by the plugin.
Dependencies struct {
// Required Grafana version for this plugin. Validated using
// https://github.com/npm/node-semver.
GrafanaDependency string `json:"grafanaDependency"`
// (Deprecated) Required Grafana version for this plugin, e.g.
// `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or
// v7.x.x.
GrafanaVersion *string `json:"grafanaVersion,omitempty"`
// An array of required plugins on which this plugin depends.
Plugins *[]Dependency `json:"plugins,omitempty"`
} `json:"dependencies"`
Category *Category `json:"category,omitempty"`
Dependencies Dependencies `json:"dependencies"`
// Grafana Enerprise specific features.
EnterpriseFeatures *struct {
@ -179,60 +414,9 @@ type PluginDef struct {
// Resources to include in plugin.
Includes *[]Include `json:"includes,omitempty"`
// Metadata about the plugin.
Info struct {
// Information about the plugin author.
Author *struct {
// Author's name.
Email *string `json:"email,omitempty"`
// Author's name.
Name *string `json:"name,omitempty"`
// Link to author's website.
Url *string `json:"url,omitempty"`
} `json:"author,omitempty"`
Build *BuildInfo `json:"build,omitempty"`
// Description of plugin. Used on the plugins page in Grafana and
// for search on grafana.com.
Description *string `json:"description,omitempty"`
// Array of plugin keywords. Used for search on grafana.com.
Keywords []string `json:"keywords"`
// An array of link objects to be displayed on this plugin's
// project page in the form `{name: 'foo', url:
// 'http://example.com'}`
Links *[]struct {
Name *string `json:"name,omitempty"`
Url *string `json:"url,omitempty"`
} `json:"links,omitempty"`
// SVG images that are used as plugin icons.
Logos *struct {
// Link to the "large" version of the plugin logo, which must be
// an SVG image. "Large" and "small" logos can be the same image.
Large string `json:"large"`
// Link to the "small" version of the plugin logo, which must be
// an SVG image. "Large" and "small" logos can be the same image.
Small string `json:"small"`
} `json:"logos,omitempty"`
// An array of screenshot objects in the form `{name: 'bar', path:
// 'img/screenshot.png'}`
Screenshots *[]struct {
Name *string `json:"name,omitempty"`
Path *string `json:"path,omitempty"`
} `json:"screenshots,omitempty"`
// Date when this plugin was built.
Updated *string `json:"updated,omitempty"`
// Project version of this commit, e.g. `6.7.x`.
Version *string `json:"version,omitempty"`
} `json:"info"`
// Metadata about a Grafana plugin. Some fields are used on the plugins
// page in Grafana and others on grafana.com, if the plugin is published.
Info Info `json:"info"`
// For data source plugins, if the plugin supports logs.
Logs *bool `json:"logs,omitempty"`
@ -302,270 +486,3 @@ type Category string
// type indicates which type of Grafana plugin this is, of the defined
// set of Grafana plugin types.
type Type string
// BasicRole is a Grafana basic role, which can be 'Viewer', 'Editor', 'Admin' or 'Grafana Admin'.
// With RBAC, the Admin basic role inherits its default permissions from the Editor basic role which
// in turn inherits them from the Viewer basic role.
type BasicRole string
// BuildInfo defines model for plugindef.BuildInfo.
type BuildInfo struct {
// Git branch the plugin was built from.
Branch *string `json:"branch,omitempty"`
// Git hash of the commit the plugin was built from
Hash *string `json:"hash,omitempty"`
Number *int64 `json:"number,omitempty"`
// GitHub pull request the plugin was built from
Pr *int32 `json:"pr,omitempty"`
Repo *string `json:"repo,omitempty"`
// Time when the plugin was built, as a Unix timestamp.
Time *int64 `json:"time,omitempty"`
}
// Dependencies defines model for plugindef.Dependencies.
type Dependencies struct {
// Required Grafana version for this plugin. Validated using
// https://github.com/npm/node-semver.
GrafanaDependency string `json:"grafanaDependency"`
// (Deprecated) Required Grafana version for this plugin, e.g.
// `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or
// v7.x.x.
GrafanaVersion *string `json:"grafanaVersion,omitempty"`
// An array of required plugins on which this plugin depends.
Plugins *[]Dependency `json:"plugins,omitempty"`
}
// Dependency describes another plugin on which a plugin depends.
// The id refers to the plugin package identifier, as given on
// the grafana.com plugin marketplace.
type Dependency struct {
Id string `json:"id"`
Name string `json:"name"`
Type DependencyType `json:"type"`
Version string `json:"version"`
}
// DependencyType defines model for Dependency.Type.
type DependencyType string
// Header describes an HTTP header that is forwarded with a proxied request for
// a plugin route.
type Header struct {
Content string `json:"content"`
Name string `json:"name"`
}
// A resource to be included in a plugin.
type Include struct {
// RBAC action the user must have to access the route
Action *string `json:"action,omitempty"`
// Add the include to the side menu.
AddToNav *bool `json:"addToNav,omitempty"`
// (Legacy) The Angular component to use for a page.
Component *string `json:"component,omitempty"`
// Page or dashboard when user clicks the icon in the side menu.
DefaultNav *bool `json:"defaultNav,omitempty"`
// Icon to use in the side menu. For information on available
// icon, refer to [Icons
// Overview](https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview).
Icon *string `json:"icon,omitempty"`
Name *string `json:"name,omitempty"`
// Used for app plugins.
Path *string `json:"path,omitempty"`
Role *IncludeRole `json:"role,omitempty"`
Type IncludeType `json:"type"`
// Unique identifier of the included resource
Uid *string `json:"uid,omitempty"`
}
// IncludeRole defines model for Include.Role.
type IncludeRole string
// IncludeType defines model for Include.Type.
type IncludeType string
// Metadata about a Grafana plugin. Some fields are used on the plugins
// page in Grafana and others on grafana.com, if the plugin is published.
type Info struct {
// Information about the plugin author.
Author *struct {
// Author's name.
Email *string `json:"email,omitempty"`
// Author's name.
Name *string `json:"name,omitempty"`
// Link to author's website.
Url *string `json:"url,omitempty"`
} `json:"author,omitempty"`
Build *BuildInfo `json:"build,omitempty"`
// Description of plugin. Used on the plugins page in Grafana and
// for search on grafana.com.
Description *string `json:"description,omitempty"`
// Array of plugin keywords. Used for search on grafana.com.
Keywords []string `json:"keywords"`
// An array of link objects to be displayed on this plugin's
// project page in the form `{name: 'foo', url:
// 'http://example.com'}`
Links *[]struct {
Name *string `json:"name,omitempty"`
Url *string `json:"url,omitempty"`
} `json:"links,omitempty"`
// SVG images that are used as plugin icons.
Logos *struct {
// Link to the "large" version of the plugin logo, which must be
// an SVG image. "Large" and "small" logos can be the same image.
Large string `json:"large"`
// Link to the "small" version of the plugin logo, which must be
// an SVG image. "Large" and "small" logos can be the same image.
Small string `json:"small"`
} `json:"logos,omitempty"`
// An array of screenshot objects in the form `{name: 'bar', path:
// 'img/screenshot.png'}`
Screenshots *[]struct {
Name *string `json:"name,omitempty"`
Path *string `json:"path,omitempty"`
} `json:"screenshots,omitempty"`
// Date when this plugin was built.
Updated *string `json:"updated,omitempty"`
// Project version of this commit, e.g. `6.7.x`.
Version *string `json:"version,omitempty"`
}
// TODO docs
// TODO should this really be separate from TokenAuth?
type JWTTokenAuth struct {
// Parameters for the JWT token authentication request.
Params map[string]interface{} `json:"params"`
// The list of scopes that your application should be granted
// access to.
Scopes []string `json:"scopes"`
// URL to fetch the JWT token.
Url string `json:"url"`
}
// Permission describes an RBAC permission on the plugin. A permission has an action and an optional
// scope.
// Example: action: 'test-app.schedules:read', scope: 'test-app.schedules:*'
type Permission struct {
Action string `json:"action"`
Scope *string `json:"scope,omitempty"`
}
// ReleaseState indicates release maturity state of a plugin.
type ReleaseState string
// Role describes an RBAC role which allows grouping multiple related permissions on the plugin,
// each of which has an action and an optional scope.
// Example: the role 'Schedules Reader' bundles permissions to view all schedules of the plugin.
type Role struct {
Description string `json:"description"`
Name string `json:"name"`
Permissions []struct {
Action string `json:"action"`
Scope *string `json:"scope,omitempty"`
} `json:"permissions"`
}
// RoleRegistration describes an RBAC role and its assignments to basic roles.
// It organizes related RBAC permissions on the plugin into a role and defines which basic roles
// will get them by default.
// Example: the role 'Schedules Reader' bundles permissions to view all schedules of the plugin
// which will be granted to Admins by default.
type RoleRegistration struct {
// Default assignment of the role to Grafana basic roles (Viewer, Editor, Admin, Grafana Admin)
// The Admin basic role inherits its default permissions from the Editor basic role which in turn
// inherits them from the Viewer basic role.
Grants []RoleRegistrationGrants `json:"grants"`
// RBAC role definition to bundle related RBAC permissions on the plugin.
Role struct {
Description string `json:"description"`
Name string `json:"name"`
Permissions []struct {
Action string `json:"action"`
Scope *string `json:"scope,omitempty"`
} `json:"permissions"`
} `json:"role"`
}
// RoleRegistrationGrants defines model for RoleRegistration.Grants.
type RoleRegistrationGrants string
// A proxy route used in datasource plugins for plugin authentication
// and adding headers to HTTP requests made by the plugin.
// For more information, refer to [Authentication for data source
// plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).
type Route struct {
// For data source plugins. Route headers set the body content and
// length to the proxied request.
Body *map[string]interface{} `json:"body,omitempty"`
// For data source plugins. Route headers adds HTTP headers to the
// proxied request.
Headers *[]Header `json:"headers,omitempty"`
// TODO docs
// TODO should this really be separate from TokenAuth?
JwtTokenAuth *JWTTokenAuth `json:"jwtTokenAuth,omitempty"`
// For data source plugins. Route method matches the HTTP verb
// like GET or POST. Multiple methods can be provided as a
// comma-separated list.
Method *string `json:"method,omitempty"`
// For data source plugins. The route path that is replaced by the
// route URL field when proxying the call.
Path *string `json:"path,omitempty"`
ReqRole *string `json:"reqRole,omitempty"`
ReqSignedIn *bool `json:"reqSignedIn,omitempty"`
// TODO docs
TokenAuth *TokenAuth `json:"tokenAuth,omitempty"`
// For data source plugins. Route URL is where the request is
// proxied to.
Url *string `json:"url,omitempty"`
UrlParams *[]URLParam `json:"urlParams,omitempty"`
}
// TODO docs
type TokenAuth struct {
// Parameters for the token authentication request.
Params map[string]interface{} `json:"params"`
// The list of scopes that your application should be granted
// access to.
Scopes *[]string `json:"scopes,omitempty"`
// URL to fetch the authentication token.
Url *string `json:"url,omitempty"`
}
// URLParam describes query string parameters for
// a url in a plugin route
type URLParam struct {
Content string `json:"content"`
Name string `json:"name"`
}

View File

@ -23,8 +23,8 @@ type Playlist struct {
}
type PlaylistDTO = playlist.Playlist
type PlaylistItemDTO = playlist.PlaylistItem
type PlaylistItemType = playlist.PlaylistItemType
type PlaylistItemDTO = playlist.Item
type PlaylistItemType = playlist.ItemType
type PlaylistItem struct {
Id int64 `db:"id"`

View File

@ -30,7 +30,7 @@ func summaryBuilder(ctx context.Context, uid string, body []byte) (*models.Entit
// TODO: fix model so this is not possible
if obj.Items == nil {
temp := make([]playlist.PlaylistItem, 0)
temp := make([]playlist.Item, 0)
obj.Items = &temp
}
@ -43,19 +43,19 @@ func summaryBuilder(ctx context.Context, uid string, body []byte) (*models.Entit
for _, item := range *obj.Items {
switch item.Type {
case playlist.PlaylistItemTypeDashboardByUid:
case playlist.ItemTypeDashboardByUid:
summary.References = append(summary.References, &models.EntityExternalReference{
Kind: "dashboard",
UID: item.Value,
})
case playlist.PlaylistItemTypeDashboardByTag:
case playlist.ItemTypeDashboardByTag:
if summary.Labels == nil {
summary.Labels = make(map[string]string, 0)
}
summary.Labels[item.Value] = ""
case playlist.PlaylistItemTypeDashboardById:
case playlist.ItemTypeDashboardById:
// obviously insufficient long term... but good to have an example :)
summary.Error = &models.EntityErrorInfo{
Message: "Playlist uses deprecated internal id system",

View File

@ -19,10 +19,10 @@ func TestPlaylistSummary(t *testing.T) {
playlist := playlist.Playlist{
Interval: "30s",
Name: "test",
Items: &[]playlist.PlaylistItem{
{Type: playlist.PlaylistItemTypeDashboardByUid, Value: "D1"},
{Type: playlist.PlaylistItemTypeDashboardByTag, Value: "tagA"},
{Type: playlist.PlaylistItemTypeDashboardByUid, Value: "D3"},
Items: &[]playlist.Item{
{Type: playlist.ItemTypeDashboardByUid, Value: "D1"},
{Type: playlist.ItemTypeDashboardByTag, Value: "tagA"},
{Type: playlist.ItemTypeDashboardByUid, Value: "D3"},
},
}
out, err := json.Marshal(playlist)