From b72201360a556f56624cb76b74e7284c0a92ef21 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Wed, 30 Jun 2021 23:03:15 +0300 Subject: [PATCH 01/18] Add basic test --- examples/test.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 examples/test.js diff --git a/examples/test.js b/examples/test.js new file mode 100644 index 0000000..9446261 --- /dev/null +++ b/examples/test.js @@ -0,0 +1,5 @@ +import Amqp from 'k6/x/amqp'; + +export default function () { + console.log("K6 amqp extension enabled, version: " + Amqp.version) +} From 0a41da5d8f09aff833f93a14bd6270fd3229f619 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Wed, 30 Jun 2021 23:03:32 +0300 Subject: [PATCH 02/18] Init go module --- .gitignore | 1 + go.mod | 5 + go.sum | 527 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 533 insertions(+) create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22d0d82 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vendor diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ad63b97 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/lxkuz/xk6-amqp + +go 1.15 + +require go.k6.io/k6 v0.33.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..5b5cb36 --- /dev/null +++ b/go.sum @@ -0,0 +1,527 @@ +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/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= +github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28= +github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= +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/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da/go.mod h1:DgrzXonpdQbfN3uYaGz1EG4Sbhyum/MMIn6Cphlh2bw= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/goquery v1.3.0/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA= +github.com/PuerkitoBio/goquery v1.6.1 h1:FgjbQZKl5HTmcn4sKBgvx8vv63nhyhIpv7lJpFGCWpk= +github.com/PuerkitoBio/goquery v1.6.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/Shopify/sarama v1.16.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5 h1:k+1+doEm31k0rRjCjLnGG3YRkuO9ljaEyS2ajZd6GK8= +github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5/go.mod h1:5Q4+CyR7+Q3VMG8f78ou+QSX/BNUNUx5W48eFRat8DQ= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/brotli v0.0.0-20190704151324-71eb68cc467c/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= +github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.2 h1:JKnhI/XQ75uFBTiuzXpzFrUriDPiZjlOSzh6wXogP0E= +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +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/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/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb/go.mod h1:U0vRfAucUOohvdCxt5MWLF+TePIL0xbCkbKIiV8TQCE= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 h1:Izz0+t1Z5nI16/II7vuEo/nHjodOg0p7+OiDpjX5t1E= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dop251/goja v0.0.0-20210216182323-60bc6ebb9fc1/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/dop251/goja v0.0.0-20210427212725-462d53687b0d h1:enuVjS1vVnToj/GuGZ7QegOAIh1jF340Sg6NXcoMohs= +github.com/dop251/goja v0.0.0-20210427212725-462d53687b0d/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20160609142408-bb955e01b934/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.5.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.11.0 h1:l4iX0RqNnx/pU7rY2DB/I+znuYY0K3x6Ywac6EIr0PA= +github.com/fatih/color v1.11.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +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-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +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.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/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/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.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 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +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/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.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/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +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/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/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-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= +github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +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/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jhump/protoreflect v1.7.0/go.mod h1:RZkzh7Hi9J7qT/sPlWnJ/UwZqCJvciFxKDA0UCeltSM= +github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= +github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.1.1-0.20180222160526-d18983907793/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/k6io/xk6-output-kafka v0.1.1/go.mod h1:FEnBddwavknsQ3/tGFW0CP9ABAVMyimlJdLgyT1BDPE= +github.com/k6io/xk6-output-kafka v0.1.2-0.20210510135110-a159d7c8c171/go.mod h1:fgsOfxm/erON/jKuOBL8/TceTnAZPQ1OS8A7cPhrso8= +github.com/k6io/xk6-output-kafka v0.2.0/go.mod h1:yoiecpPwfa3F/UVl8k2scJ0xkZqRYu6Ht1XqohXnlXA= +github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.7.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.12.2 h1:2KCfW3I9M7nSc5wOqXAlW2v2U6v+w6cbjvbfp+OykW8= +github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= +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/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +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/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kubernetes/helm v2.9.0+incompatible h1:X6Tl40RMiqT0GD8hT3+jFPgkZV1EB6vYsoJDX8YkY+c= +github.com/kubernetes/helm v2.9.0+incompatible/go.mod h1:3Nb8I82ptmDi7OvvBQK25X1bwxg+WMAkusUQXHxu8ag= +github.com/labstack/echo v3.2.6+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= +github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= +github.com/loadimpact/k6 v0.31.1/go.mod h1:wROIullWNNJKvNvRV/angbz+9lXn3OcCSVHmZVTO3Mc= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.7.4-0.20200812114229-8ab5ff9cd8e4/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/manyminds/api2go v0.0.0-20180125085803-95be7bd0455e/go.mod h1:Z60vy0EZVSu0bOugCHdcN5ZxFMKSpjRgsnh0XKPFqqk= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa/go.mod h1:fhpOYavp5g2K74XDl/ao2y4KvhqVtKlkg1e+0UaQv7I= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pierrec/lz4 v1.0.2-0.20171218195038-2fcda4cb7018/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/xxHash v0.1.1/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I= +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/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +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/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= +github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e h1:zWKUYT07mGmVBH+9UgnHXd/ekCK99C8EbDSAt5qsjXE= +github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= +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.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.4-0.20180629152535-a114f312e075/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0= +github.com/tidwall/gjson v1.7.4/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= +github.com/tidwall/gjson v1.8.0 h1:Qt+orfosKn0rbNTZqHYDqBrmm3UDA4KRkv70fDzG+PQ= +github.com/tidwall/gjson v1.8.0/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= +github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= +github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= +github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/urfave/negroni v0.3.1-0.20180130044549-22c5532ea862/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5/go.mod h1:c1r+Ob9tUTPB0FKWO1+x+Hsc/zNa45WdGq7Y38Ybip0= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.k6.io/k6 v0.31.2-0.20210510132435-c2958278a362/go.mod h1:WmqQqrJOnATU2o+vmmfPejQquY7DDsfUflLWUpu+LX0= +go.k6.io/k6 v0.31.2-0.20210511090412-61f464b99a2d/go.mod h1:5BTMcTH7K+IEoBUPBRM15M9c97nBqeKzQfop868FMiw= +go.k6.io/k6 v0.33.0 h1:NX/6hvAD6A780xg7STngX4ay8Le+V3rz7KOL2o5KzSk= +go.k6.io/k6 v0.33.0/go.mod h1:SNG6/ZknLfIqNGbYUfORZT6sNdUuBJ15ntzt8jZloc0= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +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-20181029021203-45a5f77698d3/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/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +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/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/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.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/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-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/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-20190620200207-3b0461eec859/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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/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-20201008223702-a5fa9d4b7c91/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210428185458-6f5299370f2b h1:KhiR4XRT2U3zIM2Doxa5zRumXk0ikjVzXMlrCr8epjQ= +golang.org/x/net v0.0.0-20210428185458-6f5299370f2b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +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/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-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-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-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/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-20201204225414-ed752295db88 h1:KmZPnMocC93w341XZp26yTJg8Za7lhb2KhkYmixoeso= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +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.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/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-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-20190328211700-ab21143f2384/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-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/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-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +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/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/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-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200903010400-9bfcb5116336 h1:ZcAny/XH59BbzUOKydQpvIlklwibW3T9SvDE5cGhdzc= +google.golang.org/genproto v0.0.0-20200903010400-9bfcb5116336/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +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.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.1 h1:ARnQJNWxGyYJpdf/JXscNlQr/uv607ZPU9Z7ogHi+iI= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +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.25.1-0.20200805231151-a709e31e5d12 h1:OwhZOOMuf7leLaSCuxtQ9FW7ui2L2L6UKOtKAUqovUQ= +google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +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-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/guregu/null.v2 v2.1.2/go.mod h1:XORrx8tyS5ZDcyUboCIxQtta/Aujk/6pfWrn9Xe33mU= +gopkg.in/guregu/null.v3 v3.3.0 h1:8j3ggqq+NgKt/O7mbFVUFKUMWN+l1AmT5jQmJ6nPh2c= +gopkg.in/guregu/null.v3 v3.3.0/go.mod h1:E4tX2Qe3h7QdL+uZ3a0vqvYwKQsRSQKM5V4YltdgH9Y= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +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.4/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= +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.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From c092da345e400fbec132e28d53a89d31493916b6 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Fri, 2 Jul 2021 17:50:27 +0300 Subject: [PATCH 03/18] Add amqp driver * Open connection * Publish message to queue --- amqp.go | 49 +++++++++++++++++++++++++++++++++++++++++++++++- examples/test.js | 9 +++++++++ go.mod | 5 ++++- go.sum | 2 ++ 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/amqp.go b/amqp.go index 083f8e1..4e2868c 100644 --- a/amqp.go +++ b/amqp.go @@ -1,13 +1,60 @@ package amqp import ( + amqpDriver "github.com/streadway/amqp" "go.k6.io/k6/js/modules" ) const version = "v0.0.1" type Amqp struct { - Version string + Version string + Connection *amqpDriver.Connection +} + +type AmqpOptions struct { + ConnectionUrl string +} + +type PublishOptions struct { + QueueName string + Body string +} + +func (amqp *Amqp) Start(options AmqpOptions) error { + conn, err := amqpDriver.Dial(options.ConnectionUrl) + amqp.Connection = conn + return err +} + +func (amqp *Amqp) Publish(options PublishOptions) error { + ch, err := amqp.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + name := options.QueueName + queue, err := ch.QueueDeclare( + name, // name + false, // durable + false, // delete when unused + false, // exclusive + false, // no-wait + nil, // arguments + ) + if err != nil { + return err + } + return ch.Publish( + "", // exchange + queue.Name, // routing key + false, // mandatory + false, // immediate + amqpDriver.Publishing{ + ContentType: "text/plain", + Body: []byte(options.Body), + }, + ) } func init() { diff --git a/examples/test.js b/examples/test.js index 9446261..49091da 100644 --- a/examples/test.js +++ b/examples/test.js @@ -2,4 +2,13 @@ import Amqp from 'k6/x/amqp'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + console.log("Connection opened: " + url) + Amqp.publish({ + queue_name: "general", + body: "Hello AMQP from xk6" + }) } diff --git a/go.mod b/go.mod index ad63b97..a805aae 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,7 @@ module github.com/lxkuz/xk6-amqp go 1.15 -require go.k6.io/k6 v0.33.0 +require ( + github.com/streadway/amqp v1.0.0 + go.k6.io/k6 v0.33.0 +) diff --git a/go.sum b/go.sum index 5b5cb36..a678710 100644 --- a/go.sum +++ b/go.sum @@ -286,6 +286,8 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= 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= From 8b748213bf85b13d1caaacf126d73d85db8291c9 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sat, 3 Jul 2021 23:42:16 +0300 Subject: [PATCH 04/18] Add listening functionallity --- amqp.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ examples/test.js | 20 +++++++++++++++++-- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/amqp.go b/amqp.go index 4e2868c..33ea309 100644 --- a/amqp.go +++ b/amqp.go @@ -57,6 +57,56 @@ func (amqp *Amqp) Publish(options PublishOptions) error { ) } +type ListenerType func(string) error + +type ListenOptions struct { + Listener ListenerType + QueueName string +} + +func (amqp *Amqp) Listen(options ListenOptions) error { + ch, err := amqp.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + name := options.QueueName + queue, err := ch.QueueDeclare( + name, // name + false, // durable + false, // delete when unused + false, // exclusive + false, // no-wait + nil, // arguments + ) + if err != nil { + return err + } + msgs, err := ch.Consume( + queue.Name, // queue + "", // consumer + true, // auto-ack + false, // exclusive + false, // no-local + false, // no-wait + nil, // args + ) + if err != nil { + return err + } + + // forever := make(chan bool) + + go func() { + for d := range msgs { + options.Listener(string(d.Body)) + } + }() + // log.Printf(" [*] Waiting for messages. To exit press CTRL+C") + // <-forever + return nil +} + func init() { modules.Register("k6/x/amqp", &Amqp{ Version: version, diff --git a/examples/test.js b/examples/test.js index 49091da..ffab4b1 100644 --- a/examples/test.js +++ b/examples/test.js @@ -1,4 +1,5 @@ import Amqp from 'k6/x/amqp'; +import { sleep } from 'k6'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) @@ -6,9 +7,24 @@ export default function () { Amqp.start({ connection_url: url }) + console.log("Connection opened: " + url) - Amqp.publish({ + + const listener = function(data) { console.log('received data: ' + data) } + Amqp.listen({ queue_name: "general", - body: "Hello AMQP from xk6" + listener: listener }) + const publish = function(mark) { + Amqp.publish({ + queue_name: "general", + body: "Ping from k6: " + mark + }) + } + + publish('A') + sleep('3s') + publish('B') + sleep('5s') + publish('C') } From 1819766f0df3a4a9bb289beb134c49f6c0d5fde6 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Tue, 6 Jul 2021 00:52:57 +0300 Subject: [PATCH 05/18] Keep sync implementation of listener As we have k6 limitation and cannot read data in parallel --- amqp.go | 4 ---- examples/test.js | 15 +++++++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/amqp.go b/amqp.go index 33ea309..a9d2015 100644 --- a/amqp.go +++ b/amqp.go @@ -95,15 +95,11 @@ func (amqp *Amqp) Listen(options ListenOptions) error { return err } - // forever := make(chan bool) - go func() { for d := range msgs { options.Listener(string(d.Body)) } }() - // log.Printf(" [*] Waiting for messages. To exit press CTRL+C") - // <-forever return nil } diff --git a/examples/test.js b/examples/test.js index ffab4b1..fee1fcd 100644 --- a/examples/test.js +++ b/examples/test.js @@ -10,21 +10,20 @@ export default function () { console.log("Connection opened: " + url) - const listener = function(data) { console.log('received data: ' + data) } - Amqp.listen({ - queue_name: "general", - listener: listener - }) const publish = function(mark) { Amqp.publish({ queue_name: "general", - body: "Ping from k6: " + mark + body: "Ping from k6 -> " + mark }) } publish('A') - sleep('3s') publish('B') - sleep('5s') publish('C') + + const listener = function(data) { console.log('received data: ' + data) } + Amqp.listen({ + queue_name: "general", + listener: listener + }) } From c95235b4c5b8b2f107f8793d50366c980a91f69b Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sat, 10 Jul 2021 01:51:25 +0300 Subject: [PATCH 06/18] Rework amqp with adding Queues structure --- amqp.go | 92 +++++++++++++++++++++++++----------------------- examples/test.js | 36 +++++++++++++++++-- queues.go | 63 +++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 47 deletions(-) create mode 100644 queues.go diff --git a/amqp.go b/amqp.go index a9d2015..6ac7c94 100644 --- a/amqp.go +++ b/amqp.go @@ -10,6 +10,7 @@ const version = "v0.0.1" type Amqp struct { Version string Connection *amqpDriver.Connection + Queues *Queues } type AmqpOptions struct { @@ -19,11 +20,37 @@ type AmqpOptions struct { type PublishOptions struct { QueueName string Body string + Exchange string + Mandatory bool + Immediate bool +} + +type ConsumeOptions struct { + Consumer string + AutoAck bool + Exclusive bool + NoLocal bool + NoWait bool + Args amqpDriver.Table +} + +type ListenerType func(string) error + +type ListenOptions struct { + Listener ListenerType + QueueName string + Consumer string + AutoAck bool + Exclusive bool + NoLocal bool + NoWait bool + Args amqpDriver.Table } func (amqp *Amqp) Start(options AmqpOptions) error { conn, err := amqpDriver.Dial(options.ConnectionUrl) amqp.Connection = conn + amqp.Queues.Connection = conn return err } @@ -33,23 +60,12 @@ func (amqp *Amqp) Publish(options PublishOptions) error { return err } defer ch.Close() - name := options.QueueName - queue, err := ch.QueueDeclare( - name, // name - false, // durable - false, // delete when unused - false, // exclusive - false, // no-wait - nil, // arguments - ) - if err != nil { - return err - } + return ch.Publish( - "", // exchange - queue.Name, // routing key - false, // mandatory - false, // immediate + options.Exchange, + options.QueueName, + options.Mandatory, + options.Immediate, amqpDriver.Publishing{ ContentType: "text/plain", Body: []byte(options.Body), @@ -57,39 +73,21 @@ func (amqp *Amqp) Publish(options PublishOptions) error { ) } -type ListenerType func(string) error - -type ListenOptions struct { - Listener ListenerType - QueueName string -} - func (amqp *Amqp) Listen(options ListenOptions) error { ch, err := amqp.Connection.Channel() if err != nil { return err } defer ch.Close() - name := options.QueueName - queue, err := ch.QueueDeclare( - name, // name - false, // durable - false, // delete when unused - false, // exclusive - false, // no-wait - nil, // arguments - ) - if err != nil { - return err - } + msgs, err := ch.Consume( - queue.Name, // queue - "", // consumer - true, // auto-ack - false, // exclusive - false, // no-local - false, // no-wait - nil, // args + options.QueueName, + options.Consumer, + options.AutoAck, + options.Exclusive, + options.NoLocal, + options.NoWait, + options.Args, ) if err != nil { return err @@ -104,7 +102,13 @@ func (amqp *Amqp) Listen(options ListenOptions) error { } func init() { - modules.Register("k6/x/amqp", &Amqp{ + + queues := Queues{} + + generalAmqp := Amqp{ Version: version, - }) + Queues: &queues, + } + modules.Register("k6/x/amqp", &generalAmqp) + modules.Register("k6/x/amqp/queues", &queues) } diff --git a/examples/test.js b/examples/test.js index fee1fcd..65c35d1 100644 --- a/examples/test.js +++ b/examples/test.js @@ -1,4 +1,5 @@ import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; import { sleep } from 'k6'; export default function () { @@ -10,9 +11,26 @@ export default function () { console.log("Connection opened: " + url) + const queueName = 'K6 general' + const consumerName = 'K6 consumer' + + Queues.declare({ + name: queueName, + durable: false, + delete_when_unused: false, + exclusive: false, + no_wait: false, + args: null + }) + + console.log(queueName + " queue is ready") + const publish = function(mark) { Amqp.publish({ - queue_name: "general", + queue_name: queueName, + exchange: '', + mandatory: false, + immediate: false, body: "Ping from k6 -> " + mark }) } @@ -23,7 +41,19 @@ export default function () { const listener = function(data) { console.log('received data: ' + data) } Amqp.listen({ - queue_name: "general", - listener: listener + queue_name: queueName, + listener: listener, + consumer: consumerName, + // auto_ack: true, + // exclusive: false, + // no_local: false, + // no_wait: false, + // args: null }) + + console.log('Inspecting ' + queueName) + console.log(JSON.stringify(Queues.inspect(queueName), null, 2)) + + Queues.delete(queueName) + console.log(queueName + " removed") } diff --git a/queues.go b/queues.go new file mode 100644 index 0000000..a585186 --- /dev/null +++ b/queues.go @@ -0,0 +1,63 @@ +package amqp + +import ( + amqpDriver "github.com/streadway/amqp" +) + +type Queues struct { + Version string + Connection *amqpDriver.Connection +} + +type QueueOptions struct { + ConnectionUrl string +} + +type DeclareOptions struct { + Name string + Durable bool + DeleteWhenUnused bool + Exclusive bool + NoWait bool + Args amqpDriver.Table +} + +func (queues *Queues) Declare(options DeclareOptions) (amqpDriver.Queue, error) { + ch, err := queues.Connection.Channel() + if err != nil { + return amqpDriver.Queue{}, err + } + defer ch.Close() + return ch.QueueDeclare( + options.Name, + options.Durable, + options.DeleteWhenUnused, + options.Exclusive, + options.NoWait, + options.Args, + ) +} + +func (queues *Queues) Inspect(name string) (amqpDriver.Queue, error) { + ch, err := queues.Connection.Channel() + if err != nil { + return amqpDriver.Queue{}, err + } + defer ch.Close() + return ch.QueueInspect(name) +} + +func (queues *Queues) Delete(name string) error { + ch, err := queues.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + _, err = ch.QueueDelete( + name, + false, // ifUnused + false, // ifEmpty + false, // noWait + ) + return err +} From d65189334650a551b04e3f1f74dd52cede082893 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 00:54:22 +0300 Subject: [PATCH 07/18] Add Exchange methods --- amqp.go | 11 +++++--- examples/create-exchange.js | 25 +++++++++++++++++ examples/delete-exchange.js | 17 ++++++++++++ exchanges.go | 54 +++++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 examples/create-exchange.js create mode 100644 examples/delete-exchange.js create mode 100644 exchanges.go diff --git a/amqp.go b/amqp.go index 6ac7c94..29c0967 100644 --- a/amqp.go +++ b/amqp.go @@ -11,6 +11,7 @@ type Amqp struct { Version string Connection *amqpDriver.Connection Queues *Queues + Exchanges *Exchanges } type AmqpOptions struct { @@ -51,6 +52,7 @@ func (amqp *Amqp) Start(options AmqpOptions) error { conn, err := amqpDriver.Dial(options.ConnectionUrl) amqp.Connection = conn amqp.Queues.Connection = conn + amqp.Exchanges.Connection = conn return err } @@ -104,11 +106,14 @@ func (amqp *Amqp) Listen(options ListenOptions) error { func init() { queues := Queues{} - + exchanges := Exchanges{} generalAmqp := Amqp{ - Version: version, - Queues: &queues, + Version: version, + Queues: &queues, + Exchanges: &exchanges, } + modules.Register("k6/x/amqp", &generalAmqp) modules.Register("k6/x/amqp/queues", &queues) + modules.Register("k6/x/amqp/exchanges", &exchanges) } diff --git a/examples/create-exchange.js b/examples/create-exchange.js new file mode 100644 index 0000000..da70c6c --- /dev/null +++ b/examples/create-exchange.js @@ -0,0 +1,25 @@ +import Amqp from 'k6/x/amqp'; +import Exchanges from 'k6/x/amqp/exchanges'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + console.log("Connection opened: " + url) + + const exchangeName = 'K6 exchange' + + Exchanges.declare({ + name: exchangeName, + kind: 'direct', + durable: false, + auto_delete: false, + internal: false, + no_wait: false, + args: null + }) + + console.log(exchangeName + " exchange is ready") +} diff --git a/examples/delete-exchange.js b/examples/delete-exchange.js new file mode 100644 index 0000000..9674ab4 --- /dev/null +++ b/examples/delete-exchange.js @@ -0,0 +1,17 @@ +import Amqp from 'k6/x/amqp'; +import Exchanges from 'k6/x/amqp/exchanges'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + console.log("Connection opened: " + url) + + const exchangeName = 'K6 exchange' + + Exchanges.delete(exchangeName) + + console.log(exchangeName + " exchange deleted") +} diff --git a/exchanges.go b/exchanges.go new file mode 100644 index 0000000..589b7b8 --- /dev/null +++ b/exchanges.go @@ -0,0 +1,54 @@ +package amqp + +import ( + amqpDriver "github.com/streadway/amqp" +) + +type Exchanges struct { + Version string + Connection *amqpDriver.Connection +} + +type ExchangeOptions struct { + ConnectionUrl string +} + +type EchangeDeclareOptions struct { + Name string + Kind string + Durable bool + AutoDelete bool + Internal bool + NoWait bool + Args amqpDriver.Table +} + +func (exchanges *Exchanges) Declare(options EchangeDeclareOptions) error { + ch, err := exchanges.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ExchangeDeclare( + options.Name, + options.Kind, + options.Durable, + options.AutoDelete, + options.Internal, + options.NoWait, + options.Args, + ) +} + +func (exchanges *Exchanges) Delete(name string) error { + ch, err := exchanges.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ExchangeDelete( + name, + false, // ifUnused + false, // noWait + ) +} From e8c1a6409958c4f6a72a2d4a12a1705420799eb9 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 08:15:15 +0300 Subject: [PATCH 08/18] Add examples --- ...create-exchange.js => declare-exchange.js} | 0 examples/declare-queue.js | 22 +++++++++++++++++++ examples/delete-queue.js | 15 +++++++++++++ examples/inspect-queue.js | 13 +++++++++++ examples/{test.js => publish-listen.js} | 6 ----- 5 files changed, 50 insertions(+), 6 deletions(-) rename examples/{create-exchange.js => declare-exchange.js} (100%) create mode 100644 examples/declare-queue.js create mode 100644 examples/delete-queue.js create mode 100644 examples/inspect-queue.js rename examples/{test.js => publish-listen.js} (86%) diff --git a/examples/create-exchange.js b/examples/declare-exchange.js similarity index 100% rename from examples/create-exchange.js rename to examples/declare-exchange.js diff --git a/examples/declare-queue.js b/examples/declare-queue.js new file mode 100644 index 0000000..1eac524 --- /dev/null +++ b/examples/declare-queue.js @@ -0,0 +1,22 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const queueName = 'K6 general' + + Queues.declare({ + name: queueName, + durable: false, + delete_when_unused: false, + exclusive: false, + no_wait: false, + args: null + }) + + console.log(queueName + " queue declared") +} diff --git a/examples/delete-queue.js b/examples/delete-queue.js new file mode 100644 index 0000000..1490615 --- /dev/null +++ b/examples/delete-queue.js @@ -0,0 +1,15 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const queueName = 'K6 general' + + Queues.delete(queueName) + + console.log(queueName + " queue deleted") +} diff --git a/examples/inspect-queue.js b/examples/inspect-queue.js new file mode 100644 index 0000000..b8e4137 --- /dev/null +++ b/examples/inspect-queue.js @@ -0,0 +1,13 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const queueName = 'K6 general' + console.log('Inspecting ' + queueName) + console.log(JSON.stringify(Queues.inspect(queueName), null, 2)) +} diff --git a/examples/test.js b/examples/publish-listen.js similarity index 86% rename from examples/test.js rename to examples/publish-listen.js index 65c35d1..04e1659 100644 --- a/examples/test.js +++ b/examples/publish-listen.js @@ -50,10 +50,4 @@ export default function () { // no_wait: false, // args: null }) - - console.log('Inspecting ' + queueName) - console.log(JSON.stringify(Queues.inspect(queueName), null, 2)) - - Queues.delete(queueName) - console.log(queueName + " removed") } From b573338d18923e6fda3c10c2fb0af1d7dca08350 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 08:22:25 +0300 Subject: [PATCH 09/18] Compose example for Readme --- README.md | 48 +++++++++++++++++++++++++++++++++++--- examples/publish-listen.js | 3 +-- examples/test.js | 44 ++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 examples/test.js diff --git a/README.md b/README.md index 30cea85..c47d499 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,48 @@ $ ./build.sh && ./k6 run my-test-script.js ```javascript import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + console.log("Connection opened: " + url) + + const queueName = 'K6 general' + + Queues.declare({ + name: queueName, + // durable: false, + // delete_when_unused: false, + // exclusive: false, + // no_wait: false, + // args: null + }) + + console.log(queueName + " queue is ready") + + Amqp.publish({ + queue_name: queueName, + body: "Ping from k6" + // exchange: '', + // mandatory: false, + // immediate: false, + }) + + const listener = function(data) { console.log('received data: ' + data) } + Amqp.listen({ + queue_name: queueName, + listener: listener, + // consumer: '', + // auto_ack: true, + // exclusive: false, + // no_local: false, + // no_wait: false, + // args: null + }) } ``` @@ -70,15 +109,18 @@ $ ./k6 run script.js scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop): * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s) -INFO[0000] K6 amqp extension enabled, version: v0.0.1 +INFO[0000] K6 amqp extension enabled, version: v0.0.1 source=console +INFO[0000] Connection opened: amqp://guest:guest@localhost:5672/ source=console +INFO[0000] K6 general queue is ready source=console +INFO[0000] received data: Ping from k6 source=console running (00m00.0s), 0/1 VUs, 1 complete and 0 interrupted iterations default ✓ [======================================] 1 VUs 00m00.0s/10m0s 1/1 iters, 1 per VU data_received........: 0 B 0 B/s data_sent............: 0 B 0 B/s - iteration_duration...: avg=9.64ms min=9.64ms med=9.64ms max=9.64ms p(90)=9.64ms p(95)=9.64ms - iterations...........: 1 25.017512/s + iteration_duration...: avg=31.37ms min=31.37ms med=31.37ms max=31.37ms p(90)=31.37ms p(95)=31.37ms + iterations...........: 1 30.855627/s ``` diff --git a/examples/publish-listen.js b/examples/publish-listen.js index 04e1659..4e35ae5 100644 --- a/examples/publish-listen.js +++ b/examples/publish-listen.js @@ -1,6 +1,5 @@ import Amqp from 'k6/x/amqp'; import Queues from 'k6/x/amqp/queues'; -import { sleep } from 'k6'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) @@ -44,7 +43,7 @@ export default function () { queue_name: queueName, listener: listener, consumer: consumerName, - // auto_ack: true, + auto_ack: true, // exclusive: false, // no_local: false, // no_wait: false, diff --git a/examples/test.js b/examples/test.js new file mode 100644 index 0000000..4884b4a --- /dev/null +++ b/examples/test.js @@ -0,0 +1,44 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + console.log("K6 amqp extension enabled, version: " + Amqp.version) + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + console.log("Connection opened: " + url) + + const queueName = 'K6 general' + + Queues.declare({ + name: queueName, + // durable: false, + // delete_when_unused: false, + // exclusive: false, + // no_wait: false, + // args: null + }) + + console.log(queueName + " queue is ready") + + Amqp.publish({ + queue_name: queueName, + body: "Ping from k6" + // exchange: '', + // mandatory: false, + // immediate: false, + }) + + const listener = function(data) { console.log('received data: ' + data) } + Amqp.listen({ + queue_name: queueName, + listener: listener, + auto_ack: true, + // consumer: '', + // exclusive: false, + // no_local: false, + // no_wait: false, + // args: null + }) +} From cab73dc240a5811c3fb6084409ef23585c47ca83 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 08:44:15 +0300 Subject: [PATCH 10/18] Add bind/unbind to queues --- examples/bind-queue.js | 22 ++++++++++++++++++++ examples/unbind-queue.js | 21 +++++++++++++++++++ queues.go | 44 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 examples/bind-queue.js create mode 100644 examples/unbind-queue.js diff --git a/examples/bind-queue.js b/examples/bind-queue.js new file mode 100644 index 0000000..74d4b9b --- /dev/null +++ b/examples/bind-queue.js @@ -0,0 +1,22 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const queueName = 'K6 queue' + const exchangeName = 'K6 exchange' + + Queues.bind({ + queue_name: queueName, + routing_key: '', + exchange_name: exchangeName, + no_wait: false, + args: null + }) + + console.log(queueName + " queue binded to " + exchangeName) +} diff --git a/examples/unbind-queue.js b/examples/unbind-queue.js new file mode 100644 index 0000000..20a2074 --- /dev/null +++ b/examples/unbind-queue.js @@ -0,0 +1,21 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const queueName = 'K6 queue' + const exchangeName = 'K6 exchange' + + Queues.unbind({ + queue_name: queueName, + routing_key: '', + exchange_name: exchangeName, + args: null + }) + + console.log(queueName + " queue unbinded from " + exchangeName) +} diff --git a/queues.go b/queues.go index a585186..d47f4c1 100644 --- a/queues.go +++ b/queues.go @@ -22,6 +22,21 @@ type DeclareOptions struct { Args amqpDriver.Table } +type QueueBindOptions struct { + QueueName string + ExchangeName string + RoutingKey string + NoWait bool + Args amqpDriver.Table +} + +type QueueUnindOptions struct { + QueueName string + ExchangeName string + RoutingKey string + Args amqpDriver.Table +} + func (queues *Queues) Declare(options DeclareOptions) (amqpDriver.Queue, error) { ch, err := queues.Connection.Channel() if err != nil { @@ -61,3 +76,32 @@ func (queues *Queues) Delete(name string) error { ) return err } + +func (queues *Queues) Bind(options QueueBindOptions) error { + ch, err := queues.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.QueueBind( + options.QueueName, + options.RoutingKey, + options.ExchangeName, + options.NoWait, + options.Args, + ) +} + +func (queues *Queues) Unbind(options QueueUnindOptions) error { + ch, err := queues.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.QueueUnbind( + options.QueueName, + options.RoutingKey, + options.ExchangeName, + options.Args, + ) +} From 32c0294b3c185cc6a101c615f7ae0ce33f860a43 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 08:44:57 +0300 Subject: [PATCH 11/18] Polish naming in examples --- examples/declare-queue.js | 2 +- examples/delete-exchange.js | 2 -- examples/delete-queue.js | 2 +- examples/inspect-queue.js | 2 +- examples/publish-listen.js | 7 ++----- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/declare-queue.js b/examples/declare-queue.js index 1eac524..aaaf0b6 100644 --- a/examples/declare-queue.js +++ b/examples/declare-queue.js @@ -7,7 +7,7 @@ export default function () { connection_url: url }) - const queueName = 'K6 general' + const queueName = 'K6 queue' Queues.declare({ name: queueName, diff --git a/examples/delete-exchange.js b/examples/delete-exchange.js index 9674ab4..18d3a1f 100644 --- a/examples/delete-exchange.js +++ b/examples/delete-exchange.js @@ -7,8 +7,6 @@ export default function () { connection_url: url }) - console.log("Connection opened: " + url) - const exchangeName = 'K6 exchange' Exchanges.delete(exchangeName) diff --git a/examples/delete-queue.js b/examples/delete-queue.js index 1490615..61d23d8 100644 --- a/examples/delete-queue.js +++ b/examples/delete-queue.js @@ -7,7 +7,7 @@ export default function () { connection_url: url }) - const queueName = 'K6 general' + const queueName = 'K6 queue' Queues.delete(queueName) diff --git a/examples/inspect-queue.js b/examples/inspect-queue.js index b8e4137..6f5ff18 100644 --- a/examples/inspect-queue.js +++ b/examples/inspect-queue.js @@ -7,7 +7,7 @@ export default function () { connection_url: url }) - const queueName = 'K6 general' + const queueName = 'K6 queue' console.log('Inspecting ' + queueName) console.log(JSON.stringify(Queues.inspect(queueName), null, 2)) } diff --git a/examples/publish-listen.js b/examples/publish-listen.js index 4e35ae5..e1e00f7 100644 --- a/examples/publish-listen.js +++ b/examples/publish-listen.js @@ -7,10 +7,7 @@ export default function () { Amqp.start({ connection_url: url }) - - console.log("Connection opened: " + url) - - const queueName = 'K6 general' + const queueName = 'K6 queue' const consumerName = 'K6 consumer' Queues.declare({ @@ -42,8 +39,8 @@ export default function () { Amqp.listen({ queue_name: queueName, listener: listener, - consumer: consumerName, auto_ack: true, + consumer: consumerName, // exclusive: false, // no_local: false, // no_wait: false, From d698bc9fce686e265e494a758f23b6a1b9bceb00 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 09:04:49 +0300 Subject: [PATCH 12/18] Add queue purge --- examples/purge-queue.js | 14 ++++++++++++++ queues.go | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 examples/purge-queue.js diff --git a/examples/purge-queue.js b/examples/purge-queue.js new file mode 100644 index 0000000..bb6970d --- /dev/null +++ b/examples/purge-queue.js @@ -0,0 +1,14 @@ +import Amqp from 'k6/x/amqp'; +import Queues from 'k6/x/amqp/queues'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const queueName = 'K6 queue' + const count = Queues.purge(queueName, false) + + console.log(queueName + " purge: " + count + " messages deleted") +} diff --git a/queues.go b/queues.go index d47f4c1..9dc837f 100644 --- a/queues.go +++ b/queues.go @@ -105,3 +105,12 @@ func (queues *Queues) Unbind(options QueueUnindOptions) error { options.Args, ) } + +func (queues *Queues) Purge(name string, noWait bool) (int, error) { + ch, err := queues.Connection.Channel() + if err != nil { + return 0, err + } + defer ch.Close() + return ch.QueuePurge(name, noWait) +} From 7491e2e0dde0d206d3f1c7316549e725ea3c6091 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 11 Jul 2021 09:05:07 +0300 Subject: [PATCH 13/18] Add bind/unbind exchange to another exchange methods --- examples/bind-exchange.js | 22 ++++++++++++++++++ examples/unbind-exchange.js | 22 ++++++++++++++++++ exchanges.go | 46 +++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 examples/bind-exchange.js create mode 100644 examples/unbind-exchange.js diff --git a/examples/bind-exchange.js b/examples/bind-exchange.js new file mode 100644 index 0000000..36254d1 --- /dev/null +++ b/examples/bind-exchange.js @@ -0,0 +1,22 @@ +import Amqp from 'k6/x/amqp'; +import Exchanges from 'k6/x/amqp/exchanges'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const sourceExchangeName = 'K6 exchange' + const destinationExchangeName = 'destination K6 exchange' + + Exchanges.bind({ + destination_exchange_name: destinationExchangeName, + routing_key: '', + source_exchange_name: sourceExchangeName, + no_wait: false, + args: null + }) + + console.log(destinationExchangeName + " exchange binded to " + sourceExchangeName + ' exchange') +} diff --git a/examples/unbind-exchange.js b/examples/unbind-exchange.js new file mode 100644 index 0000000..95db8d2 --- /dev/null +++ b/examples/unbind-exchange.js @@ -0,0 +1,22 @@ +import Amqp from 'k6/x/amqp'; +import Exchanges from 'k6/x/amqp/exchanges'; + +export default function () { + const url = "amqp://guest:guest@localhost:5672/" + Amqp.start({ + connection_url: url + }) + + const sourceExchangeName = 'K6 exchange' + const destinationExchangeName = 'destination K6 exchange' + + Exchanges.unbind({ + destination_exchange_name: destinationExchangeName, + routing_key: '', + source_exchange_name: sourceExchangeName, + no_wait: false, + args: null + }) + + console.log(destinationExchangeName + ' exchange unbinded from ' + sourceExchangeName + ' exchange') +} diff --git a/exchanges.go b/exchanges.go index 589b7b8..3070d3d 100644 --- a/exchanges.go +++ b/exchanges.go @@ -23,6 +23,22 @@ type EchangeDeclareOptions struct { Args amqpDriver.Table } +type ExchangeBindOptions struct { + DestinationExchangeName string + SourceExchangeName string + RoutingKey string + NoWait bool + Args amqpDriver.Table +} + +type ExchangeUnindOptions struct { + DestinationExchangeName string + SourceExchangeName string + RoutingKey string + NoWait bool + Args amqpDriver.Table +} + func (exchanges *Exchanges) Declare(options EchangeDeclareOptions) error { ch, err := exchanges.Connection.Channel() if err != nil { @@ -52,3 +68,33 @@ func (exchanges *Exchanges) Delete(name string) error { false, // noWait ) } + +func (exchanges *Exchanges) Bind(options ExchangeBindOptions) error { + ch, err := exchanges.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ExchangeBind( + options.DestinationExchangeName, + options.RoutingKey, + options.SourceExchangeName, + options.NoWait, + options.Args, + ) +} + +func (exchanges *Exchanges) Unbind(options ExchangeUnindOptions) error { + ch, err := exchanges.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ExchangeUnbind( + options.DestinationExchangeName, + options.RoutingKey, + options.SourceExchangeName, + options.NoWait, + options.Args, + ) +} From 4795635013de118fe7160ee4d4e0de58448b9dd5 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Wed, 14 Jul 2021 20:36:15 +0500 Subject: [PATCH 14/18] Prepare the plugin to migration under k6io namespace --- README.md | 4 ++-- build.sh | 2 +- go.mod | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c47d499..20cb01f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > > As this is a proof of concept, it won't be supported by the k6 team. > It may also break in the future as xk6 evolves. USE AT YOUR OWN RISK! -> Any issues with the tool should be raised [here](https://github.com/lxkuz/xk6-amqp/issues). +> Any issues with the tool should be raised [here](https://github.com/k6io/xk6-amqp/issues).

@@ -30,7 +30,7 @@ Then: 2. Build the binary: ```bash - $ xk6 build --with github.com/lxkuz/xk6-amqp@latest + $ xk6 build --with github.com/k6io/xk6-amqp@latest ``` ## Development diff --git a/build.sh b/build.sh index 3a02cd7..8324a58 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -xk6 build --with github.com/lxkuz/xk6-amqp=. \ No newline at end of file +xk6 build --with github.com/k6io/xk6-amqp=. \ No newline at end of file diff --git a/go.mod b/go.mod index a805aae..31abbc1 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/lxkuz/xk6-amqp +module github.com/k6io/xk6-amqp go 1.15 From 4ad246fd2264eec82e16ae688e0735f3c94cbb76 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Wed, 21 Jul 2021 18:56:11 +0500 Subject: [PATCH 15/18] Singularize queue and exchange names --- amqp.go | 4 ++-- examples/bind-exchange.js | 4 ++-- examples/bind-queue.js | 4 ++-- examples/declare-exchange.js | 4 ++-- examples/declare-queue.js | 4 ++-- examples/delete-exchange.js | 4 ++-- examples/delete-queue.js | 4 ++-- examples/inspect-queue.js | 4 ++-- examples/publish-listen.js | 4 ++-- examples/purge-queue.js | 4 ++-- examples/test.js | 4 ++-- examples/unbind-exchange.js | 4 ++-- examples/unbind-queue.js | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/amqp.go b/amqp.go index 29c0967..abbcaf6 100644 --- a/amqp.go +++ b/amqp.go @@ -114,6 +114,6 @@ func init() { } modules.Register("k6/x/amqp", &generalAmqp) - modules.Register("k6/x/amqp/queues", &queues) - modules.Register("k6/x/amqp/exchanges", &exchanges) + modules.Register("k6/x/amqp/queue", &queues) + modules.Register("k6/x/amqp/exchange", &exchanges) } diff --git a/examples/bind-exchange.js b/examples/bind-exchange.js index 36254d1..eccc48f 100644 --- a/examples/bind-exchange.js +++ b/examples/bind-exchange.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Exchanges from 'k6/x/amqp/exchanges'; +import Exchange from 'k6/x/amqp/exchange'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -10,7 +10,7 @@ export default function () { const sourceExchangeName = 'K6 exchange' const destinationExchangeName = 'destination K6 exchange' - Exchanges.bind({ + Exchange.bind({ destination_exchange_name: destinationExchangeName, routing_key: '', source_exchange_name: sourceExchangeName, diff --git a/examples/bind-queue.js b/examples/bind-queue.js index 74d4b9b..b7db15a 100644 --- a/examples/bind-queue.js +++ b/examples/bind-queue.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -10,7 +10,7 @@ export default function () { const queueName = 'K6 queue' const exchangeName = 'K6 exchange' - Queues.bind({ + Queue.bind({ queue_name: queueName, routing_key: '', exchange_name: exchangeName, diff --git a/examples/declare-exchange.js b/examples/declare-exchange.js index da70c6c..c53fcc0 100644 --- a/examples/declare-exchange.js +++ b/examples/declare-exchange.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Exchanges from 'k6/x/amqp/exchanges'; +import Exchange from 'k6/x/amqp/exchange'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -11,7 +11,7 @@ export default function () { const exchangeName = 'K6 exchange' - Exchanges.declare({ + Exchange.declare({ name: exchangeName, kind: 'direct', durable: false, diff --git a/examples/declare-queue.js b/examples/declare-queue.js index aaaf0b6..e1e74c0 100644 --- a/examples/declare-queue.js +++ b/examples/declare-queue.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -9,7 +9,7 @@ export default function () { const queueName = 'K6 queue' - Queues.declare({ + Queue.declare({ name: queueName, durable: false, delete_when_unused: false, diff --git a/examples/delete-exchange.js b/examples/delete-exchange.js index 18d3a1f..2327d39 100644 --- a/examples/delete-exchange.js +++ b/examples/delete-exchange.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Exchanges from 'k6/x/amqp/exchanges'; +import Exchange from 'k6/x/amqp/exchange'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -9,7 +9,7 @@ export default function () { const exchangeName = 'K6 exchange' - Exchanges.delete(exchangeName) + Exchange.delete(exchangeName) console.log(exchangeName + " exchange deleted") } diff --git a/examples/delete-queue.js b/examples/delete-queue.js index 61d23d8..23794eb 100644 --- a/examples/delete-queue.js +++ b/examples/delete-queue.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -9,7 +9,7 @@ export default function () { const queueName = 'K6 queue' - Queues.delete(queueName) + Queue.delete(queueName) console.log(queueName + " queue deleted") } diff --git a/examples/inspect-queue.js b/examples/inspect-queue.js index 6f5ff18..2597547 100644 --- a/examples/inspect-queue.js +++ b/examples/inspect-queue.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -9,5 +9,5 @@ export default function () { const queueName = 'K6 queue' console.log('Inspecting ' + queueName) - console.log(JSON.stringify(Queues.inspect(queueName), null, 2)) + console.log(JSON.stringify(Queue.inspect(queueName), null, 2)) } diff --git a/examples/publish-listen.js b/examples/publish-listen.js index e1e00f7..2bcb3f2 100644 --- a/examples/publish-listen.js +++ b/examples/publish-listen.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) @@ -10,7 +10,7 @@ export default function () { const queueName = 'K6 queue' const consumerName = 'K6 consumer' - Queues.declare({ + Queue.declare({ name: queueName, durable: false, delete_when_unused: false, diff --git a/examples/purge-queue.js b/examples/purge-queue.js index bb6970d..a77d53a 100644 --- a/examples/purge-queue.js +++ b/examples/purge-queue.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -8,7 +8,7 @@ export default function () { }) const queueName = 'K6 queue' - const count = Queues.purge(queueName, false) + const count = Queue.purge(queueName, false) console.log(queueName + " purge: " + count + " messages deleted") } diff --git a/examples/test.js b/examples/test.js index 4884b4a..950efb6 100644 --- a/examples/test.js +++ b/examples/test.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) @@ -11,7 +11,7 @@ export default function () { const queueName = 'K6 general' - Queues.declare({ + Queue.declare({ name: queueName, // durable: false, // delete_when_unused: false, diff --git a/examples/unbind-exchange.js b/examples/unbind-exchange.js index 95db8d2..2a93376 100644 --- a/examples/unbind-exchange.js +++ b/examples/unbind-exchange.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Exchanges from 'k6/x/amqp/exchanges'; +import Exchange from 'k6/x/amqp/exchange'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -10,7 +10,7 @@ export default function () { const sourceExchangeName = 'K6 exchange' const destinationExchangeName = 'destination K6 exchange' - Exchanges.unbind({ + Exchange.unbind({ destination_exchange_name: destinationExchangeName, routing_key: '', source_exchange_name: sourceExchangeName, diff --git a/examples/unbind-queue.js b/examples/unbind-queue.js index 20a2074..1b8a69f 100644 --- a/examples/unbind-queue.js +++ b/examples/unbind-queue.js @@ -1,5 +1,5 @@ import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { const url = "amqp://guest:guest@localhost:5672/" @@ -10,7 +10,7 @@ export default function () { const queueName = 'K6 queue' const exchangeName = 'K6 exchange' - Queues.unbind({ + Queue.unbind({ queue_name: queueName, routing_key: '', exchange_name: exchangeName, From f38975e3eb94eec5b88f0ecbf218dc58a28aad9a Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Wed, 21 Jul 2021 18:58:20 +0500 Subject: [PATCH 16/18] Fix typo --- exchanges.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exchanges.go b/exchanges.go index 3070d3d..9899122 100644 --- a/exchanges.go +++ b/exchanges.go @@ -13,7 +13,7 @@ type ExchangeOptions struct { ConnectionUrl string } -type EchangeDeclareOptions struct { +type ExchangeDeclareOptions struct { Name string Kind string Durable bool @@ -39,7 +39,7 @@ type ExchangeUnindOptions struct { Args amqpDriver.Table } -func (exchanges *Exchanges) Declare(options EchangeDeclareOptions) error { +func (exchanges *Exchanges) Declare(options ExchangeDeclareOptions) error { ch, err := exchanges.Connection.Channel() if err != nil { return err From 2461cfea743cb3f1aab06fae22646554cfd745f3 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Wed, 21 Jul 2021 18:58:48 +0500 Subject: [PATCH 17/18] Rename github.com/k6io path to github.com/grafana --- README.md | 4 ++-- build.sh | 2 +- go.mod | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 20cb01f..0d1d2a5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > > As this is a proof of concept, it won't be supported by the k6 team. > It may also break in the future as xk6 evolves. USE AT YOUR OWN RISK! -> Any issues with the tool should be raised [here](https://github.com/k6io/xk6-amqp/issues). +> Any issues with the tool should be raised [here](https://github.com/grafana/xk6-amqp/issues).

@@ -30,7 +30,7 @@ Then: 2. Build the binary: ```bash - $ xk6 build --with github.com/k6io/xk6-amqp@latest + $ xk6 build --with github.com/grafana/xk6-amqp@latest ``` ## Development diff --git a/build.sh b/build.sh index 8324a58..7f1f249 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -xk6 build --with github.com/k6io/xk6-amqp=. \ No newline at end of file +xk6 build --with github.com/grafana/xk6-amqp=. \ No newline at end of file diff --git a/go.mod b/go.mod index 31abbc1..2eb10dc 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/k6io/xk6-amqp +module github.com/grafana/xk6-amqp go 1.15 From 6097daf1c844ed4a33c40aed8934f2cc33269e51 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Fri, 23 Jul 2021 18:13:56 +0500 Subject: [PATCH 18/18] Singularize queue and exchange structures --- README.md | 4 +-- amqp.go | 20 +++++------ channels.go | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ exchanges.go | 18 +++++----- queues.go | 26 +++++++------- 5 files changed, 134 insertions(+), 34 deletions(-) create mode 100644 channels.go diff --git a/README.md b/README.md index 0d1d2a5..408453c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ $ ./build.sh && ./k6 run my-test-script.js ```javascript import Amqp from 'k6/x/amqp'; -import Queues from 'k6/x/amqp/queues'; +import Queue from 'k6/x/amqp/queue'; export default function () { console.log("K6 amqp extension enabled, version: " + Amqp.version) @@ -57,7 +57,7 @@ export default function () { const queueName = 'K6 general' - Queues.declare({ + Queue.declare({ name: queueName, // durable: false, // delete_when_unused: false, diff --git a/amqp.go b/amqp.go index abbcaf6..dd48545 100644 --- a/amqp.go +++ b/amqp.go @@ -10,8 +10,8 @@ const version = "v0.0.1" type Amqp struct { Version string Connection *amqpDriver.Connection - Queues *Queues - Exchanges *Exchanges + Queue *Queue + Exchange *Exchange } type AmqpOptions struct { @@ -51,8 +51,8 @@ type ListenOptions struct { func (amqp *Amqp) Start(options AmqpOptions) error { conn, err := amqpDriver.Dial(options.ConnectionUrl) amqp.Connection = conn - amqp.Queues.Connection = conn - amqp.Exchanges.Connection = conn + amqp.Queue.Connection = conn + amqp.Exchange.Connection = conn return err } @@ -105,15 +105,15 @@ func (amqp *Amqp) Listen(options ListenOptions) error { func init() { - queues := Queues{} - exchanges := Exchanges{} + queue := Queue{} + exchange := Exchange{} generalAmqp := Amqp{ Version: version, - Queues: &queues, - Exchanges: &exchanges, + Queue: &queue, + Exchange: &exchange, } modules.Register("k6/x/amqp", &generalAmqp) - modules.Register("k6/x/amqp/queue", &queues) - modules.Register("k6/x/amqp/exchange", &exchanges) + modules.Register("k6/x/amqp/queue", &queue) + modules.Register("k6/x/amqp/exchange", &exchange) } diff --git a/channels.go b/channels.go new file mode 100644 index 0000000..e3478fb --- /dev/null +++ b/channels.go @@ -0,0 +1,100 @@ +package amqp + +import ( + amqpDriver "github.com/streadway/amqp" +) + +type Channels struct { + Version string + Connection *amqpDriver.Connection +} + +type ChannelOptions struct { + ConnectionUrl string +} + +type ChannelDeclareOptions struct { + Name string + Kind string + Durable bool + AutoDelete bool + Internal bool + NoWait bool + Args amqpDriver.Table +} + +type ChannelBindOptions struct { + DestinationChannelName string + SourceChannelName string + RoutingKey string + NoWait bool + Args amqpDriver.Table +} + +type ChannelUnindOptions struct { + DestinationChannelName string + SourceChannelName string + RoutingKey string + NoWait bool + Args amqpDriver.Table +} + +func (Channels *Channels) Declare(options ChannelDeclareOptions) error { + ch, err := Channels.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ChannelDeclare( + options.Name, + options.Kind, + options.Durable, + options.AutoDelete, + options.Internal, + options.NoWait, + options.Args, + ) +} + +func (Channels *Channels) Delete(name string) error { + ch, err := Channels.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ChannelDelete( + name, + false, // ifUnused + false, // noWait + ) +} + +func (Channels *Channels) Bind(options ChannelBindOptions) error { + ch, err := Channels.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ChannelBind( + options.DestinationChannelName, + options.RoutingKey, + options.SourceChannelName, + options.NoWait, + options.Args, + ) +} + +func (Channels *Channels) Unbind(options ChannelUnindOptions) error { + ch, err := Channels.Connection.Channel() + if err != nil { + return err + } + defer ch.Close() + return ch.ChannelUnbind( + options.DestinationChannelName, + options.RoutingKey, + options.SourceChannelName, + options.NoWait, + options.Args, + ) +} diff --git a/exchanges.go b/exchanges.go index 9899122..7eea17c 100644 --- a/exchanges.go +++ b/exchanges.go @@ -4,7 +4,7 @@ import ( amqpDriver "github.com/streadway/amqp" ) -type Exchanges struct { +type Exchange struct { Version string Connection *amqpDriver.Connection } @@ -39,8 +39,8 @@ type ExchangeUnindOptions struct { Args amqpDriver.Table } -func (exchanges *Exchanges) Declare(options ExchangeDeclareOptions) error { - ch, err := exchanges.Connection.Channel() +func (exchange *Exchange) Declare(options ExchangeDeclareOptions) error { + ch, err := exchange.Connection.Channel() if err != nil { return err } @@ -56,8 +56,8 @@ func (exchanges *Exchanges) Declare(options ExchangeDeclareOptions) error { ) } -func (exchanges *Exchanges) Delete(name string) error { - ch, err := exchanges.Connection.Channel() +func (exchange *Exchange) Delete(name string) error { + ch, err := exchange.Connection.Channel() if err != nil { return err } @@ -69,8 +69,8 @@ func (exchanges *Exchanges) Delete(name string) error { ) } -func (exchanges *Exchanges) Bind(options ExchangeBindOptions) error { - ch, err := exchanges.Connection.Channel() +func (exchange *Exchange) Bind(options ExchangeBindOptions) error { + ch, err := exchange.Connection.Channel() if err != nil { return err } @@ -84,8 +84,8 @@ func (exchanges *Exchanges) Bind(options ExchangeBindOptions) error { ) } -func (exchanges *Exchanges) Unbind(options ExchangeUnindOptions) error { - ch, err := exchanges.Connection.Channel() +func (exchange *Exchange) Unbind(options ExchangeUnindOptions) error { + ch, err := exchange.Connection.Channel() if err != nil { return err } diff --git a/queues.go b/queues.go index 9dc837f..e362fb4 100644 --- a/queues.go +++ b/queues.go @@ -4,7 +4,7 @@ import ( amqpDriver "github.com/streadway/amqp" ) -type Queues struct { +type Queue struct { Version string Connection *amqpDriver.Connection } @@ -37,8 +37,8 @@ type QueueUnindOptions struct { Args amqpDriver.Table } -func (queues *Queues) Declare(options DeclareOptions) (amqpDriver.Queue, error) { - ch, err := queues.Connection.Channel() +func (queue *Queue) Declare(options DeclareOptions) (amqpDriver.Queue, error) { + ch, err := queue.Connection.Channel() if err != nil { return amqpDriver.Queue{}, err } @@ -53,8 +53,8 @@ func (queues *Queues) Declare(options DeclareOptions) (amqpDriver.Queue, error) ) } -func (queues *Queues) Inspect(name string) (amqpDriver.Queue, error) { - ch, err := queues.Connection.Channel() +func (queue *Queue) Inspect(name string) (amqpDriver.Queue, error) { + ch, err := queue.Connection.Channel() if err != nil { return amqpDriver.Queue{}, err } @@ -62,8 +62,8 @@ func (queues *Queues) Inspect(name string) (amqpDriver.Queue, error) { return ch.QueueInspect(name) } -func (queues *Queues) Delete(name string) error { - ch, err := queues.Connection.Channel() +func (queue *Queue) Delete(name string) error { + ch, err := queue.Connection.Channel() if err != nil { return err } @@ -77,8 +77,8 @@ func (queues *Queues) Delete(name string) error { return err } -func (queues *Queues) Bind(options QueueBindOptions) error { - ch, err := queues.Connection.Channel() +func (queue *Queue) Bind(options QueueBindOptions) error { + ch, err := queue.Connection.Channel() if err != nil { return err } @@ -92,8 +92,8 @@ func (queues *Queues) Bind(options QueueBindOptions) error { ) } -func (queues *Queues) Unbind(options QueueUnindOptions) error { - ch, err := queues.Connection.Channel() +func (queue *Queue) Unbind(options QueueUnindOptions) error { + ch, err := queue.Connection.Channel() if err != nil { return err } @@ -106,8 +106,8 @@ func (queues *Queues) Unbind(options QueueUnindOptions) error { ) } -func (queues *Queues) Purge(name string, noWait bool) (int, error) { - ch, err := queues.Connection.Channel() +func (queue *Queue) Purge(name string, noWait bool) (int, error) { + ch, err := queue.Connection.Channel() if err != nil { return 0, err }