diff --git a/go.mod b/go.mod index b53a2a2bd1e..ddeb98045af 100644 --- a/go.mod +++ b/go.mod @@ -85,8 +85,7 @@ require ( github.com/shurcooL/vfsgen v0.0.0-20180711163814-62bca832be04 github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff // indirect github.com/stretchr/testify v1.3.0 - github.com/v3io/v3io-go-http v0.0.0-20190221115935-53e2b487c9a2 - github.com/v3io/v3io-tsdb v0.9.0 + github.com/v3io/v3io-tsdb v0.9.2 go.opencensus.io v0.19.2 // indirect golang.org/x/net v0.0.0-20190311183353-d8887717615a golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 @@ -114,6 +113,4 @@ replace labix.org/v2/mgo => github.com/go-mgo/mgo v0.0.0-20180705113738-7446a034 replace launchpad.net/gocheck => github.com/go-check/check v0.0.0-20180628173108-788fd78401277ebd861206a03c884797c6ec5541 -replace github.com/v3io/frames => github.com/v3io/frames v0.0.0-20190328123118-1dad1ff610509e7b087d9cd390ed1b452caecf15 - -replace github.com/v3io/v3io-tsdb => github.com/v3io/v3io-tsdb v0.0.0-20190410160018-de081cf7a8519d2c67e31b6202046b1defa87559 +replace github.com/v3io/frames => github.com/v3io/frames v0.0.0-20190328123118-1dad1ff610509e7b087d9cd390ed1b452caecf15 \ No newline at end of file diff --git a/go.sum b/go.sum index 5f106945439..cceddd114dd 100644 --- a/go.sum +++ b/go.sum @@ -207,9 +207,13 @@ github.com/lightstep/lightstep-tracer-go v0.15.6 h1:D0GGa7afJ7GcQvu5as6ssLEEKYXv github.com/lightstep/lightstep-tracer-go v0.15.6/go.mod h1:6AMpwZpsyCFwSovxzM78e+AsYxE8sGwiM6C3TytaWeI= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -237,7 +241,10 @@ github.com/montanaflynn/stats v0.5.0 h1:2EkzeTSqBB4V4bJwWrt5gIIrZmpJBcoIRGS2kWLg github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nuclio/errors v0.0.1 h1:JoADBDnhRKjW05Npu5CLS27Peo7gx+QZcNrLwINV6UY= +github.com/nuclio/errors v0.0.1/go.mod h1:it2rUqDarIL8PasLYZo0Q1Ebsx4NRPM+OyYYakgNyrQ= github.com/nuclio/logger v0.0.0-20180410162335-ccc5ab971395/go.mod h1:ttazNAqTxKjQ7XrGDZxecumGa9KCIuJh88gzFY1mRXo= +github.com/nuclio/logger v0.0.0-20190303161055-fc1e4b16d127/go.mod h1:ttazNAqTxKjQ7XrGDZxecumGa9KCIuJh88gzFY1mRXo= github.com/nuclio/logger v0.0.1 h1:e+vT/Ug65RC+u0QX2J+lq3P57ZBwJ1ZA6Q2LCEcViwE= github.com/nuclio/logger v0.0.1/go.mod h1:ttazNAqTxKjQ7XrGDZxecumGa9KCIuJh88gzFY1mRXo= github.com/nuclio/nuclio-sdk-go v0.0.0-20190205170814-3b507fbd0324/go.mod h1:NqMgotiF6Y0Ho4+i5AvJhH3FRKAyL4IMaMv/eoUOkKQ= @@ -269,6 +276,8 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pavius/zap v0.0.0-20180228181622-8d52692529b8 h1:1N/m7VjDY1Pd30Uwv6bLttZVFQm3n8RUK9Ylf2J+4a4= github.com/pavius/zap v0.0.0-20180228181622-8d52692529b8/go.mod h1:6FWOCx06uh50GClv8S2cfk3asqTJs3qq3ZNRtLZE77I= +github.com/pavius/zap v1.4.2-0.20180228181622-8d52692529b8 h1:WqLgmr/wj9TO5Sc6oYPQRAJBxuHE0NTeuVeFnT+FZVo= +github.com/pavius/zap v1.4.2-0.20180228181622-8d52692529b8/go.mod h1:6FWOCx06uh50GClv8S2cfk3asqTJs3qq3ZNRtLZE77I= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk= @@ -343,14 +352,21 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/v3io/frames v0.0.0-20190328123118-1dad1ff610509e7b087d9cd390ed1b452caecf15 h1:Y/ABiIlS3tqLHsj0DZkkpMyvdoCmU1nwgQ0On6n6imk= github.com/v3io/frames v0.0.0-20190328123118-1dad1ff610509e7b087d9cd390ed1b452caecf15/go.mod h1:6aKW4Wl4A+gQhXH0JRCVOLgwvcrLyk+fqEpemuie094= +github.com/v3io/v3io-go v0.0.0-20180415000000-1486c75b0e590a14580f7d9b6cef7a944a231ca7 h1:J+ps6exCjowNidrtawSQglJQpKrJ6v8UjBVTNrRTpMs= +github.com/v3io/v3io-go v0.0.0-20180415000000-1486c75b0e590a14580f7d9b6cef7a944a231ca7/go.mod h1:MHc+d/Jg/y8lV4B9sgwTvuS3tEE9wS+kqtU0+D0Sr78= github.com/v3io/v3io-go-http v0.0.0-20190221115935-53e2b487c9a2 h1:NJc63wM25iS+ci5z7LVwjWD4QM0QpTQw/fovKzatss0= github.com/v3io/v3io-go-http v0.0.0-20190221115935-53e2b487c9a2/go.mod h1:GXYcR9MxgfbE3BJdkXki5EclvtS8Nxu2RQNLA8hMMog= -github.com/v3io/v3io-tsdb v0.0.0-20190410160018-de081cf7a8519d2c67e31b6202046b1defa87559 h1:FWaY/tEnAVMdD51p+iDxbWw54l+5nAZ5dTbKclOsQLo= -github.com/v3io/v3io-tsdb v0.0.0-20190410160018-de081cf7a8519d2c67e31b6202046b1defa87559/go.mod h1:5GOd2S8a0EtKkQAjp7Ke3o+oxZKdUMJFVEU+mk9ltdE= +github.com/v3io/v3io-tsdb v0.0.0-20190328071546-4e85f3df2d205fc7368d54184bb2ceff949ab4bd/go.mod h1:A+5yKC16QxLf+Fy5v7VvIxSw+jwsKHLhUS7dCYFDLAA= +github.com/v3io/v3io-tsdb v0.9.0 h1:HcopU5LpwAipvQ7D7jBZ2nrMNKycygttKBjnRwNzwZA= +github.com/v3io/v3io-tsdb v0.9.0/go.mod h1:5GOd2S8a0EtKkQAjp7Ke3o+oxZKdUMJFVEU+mk9ltdE= +github.com/v3io/v3io-tsdb v0.9.2 h1:9taOa/SrAA/cWMgTLO8M12FNqgH4SyhrBzKzdCRp/Z0= +github.com/v3io/v3io-tsdb v0.9.2/go.mod h1:cPLq5KvhxzdvRaVzy8HTDxousSFUaSRBRdhtd131JgU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.0.0 h1:BwIoZQbBsTo3v2F5lz5Oy3TlTq4wLKTLV260EVTEWco= github.com/valyala/fasthttp v1.0.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= +github.com/valyala/fasthttp v1.2.0 h1:dzZJf2IuMiclVjdw0kkT+f9u4YdrapbNyGAN47E/qnk= +github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryBNl9eKOeqQ58Y/Qpo3Q9QNxKHX5uzzQ= github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY= @@ -412,6 +428,8 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20170424234030-8be79e1e0910 h1:bCMaBn7ph495H+x72gEvgcv+mDRd9dElbzo/mVCMxX4= diff --git a/storage/tsdb/promtsdb.go b/storage/tsdb/promtsdb.go index e6e8a2598a1..bddaa2e0ee3 100644 --- a/storage/tsdb/promtsdb.go +++ b/storage/tsdb/promtsdb.go @@ -9,7 +9,6 @@ import ( "github.com/pkg/errors" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" - "github.com/v3io/v3io-go-http" "github.com/v3io/v3io-tsdb/pkg/aggregate" tsdbAppender "github.com/v3io/v3io-tsdb/pkg/appender" "github.com/v3io/v3io-tsdb/pkg/config" @@ -25,7 +24,7 @@ type V3ioPromAdapter struct { useV3ioAggregations bool // Indicate whether or not to use v3io aggregations by default (passed from prometheus.yml) } -func NewV3ioProm(cfg *config.V3ioConfig, container *v3io.Container, logger logger.Logger) (*V3ioPromAdapter, error) { +func NewV3ioProm(cfg *config.V3ioConfig, logger logger.Logger) (*V3ioPromAdapter, error) { if logger == nil { newLogger, err := utils.NewLogger(cfg.LogLevel) @@ -35,7 +34,7 @@ func NewV3ioProm(cfg *config.V3ioConfig, container *v3io.Container, logger logge logger = newLogger } - adapter, err := tsdb.NewV3ioAdapter(cfg, container, logger) + adapter, err := tsdb.NewV3ioAdapter(cfg, nil, logger) newAdapter := V3ioPromAdapter{db: adapter, logger: logger.GetChild("v3io-prom-adapter")} return &newAdapter, err } diff --git a/storage/tsdb/v3io.go b/storage/tsdb/v3io.go index 3893369a482..983d6048953 100644 --- a/storage/tsdb/v3io.go +++ b/storage/tsdb/v3io.go @@ -229,7 +229,7 @@ func (s *ReadyStorage) createV3ioPromAdapater(configPath string) (*V3ioPromAdapt s.logger.Log("msg", "Creating v3io adapter", "config", loadedConfig.String()) - adapter, err := NewV3ioProm(loadedConfig, nil, nil) + adapter, err := NewV3ioProm(loadedConfig, nil) adapter.SetUseV3ioAggregations(s.useV3ioAggregations) if err != nil { return nil, nil, err diff --git a/vendor/github.com/v3io/v3io-go-http/.gitignore b/vendor/github.com/v3io/v3io-go-http/.gitignore deleted file mode 100644 index 59f1f3e8618..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ -.idea/ diff --git a/vendor/github.com/v3io/v3io-go-http/LICENSE b/vendor/github.com/v3io/v3io-go-http/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/v3io/v3io-go-http/README.md b/vendor/github.com/v3io/v3io-go-http/README.md deleted file mode 100644 index aedb669f124..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/README.md +++ /dev/null @@ -1 +0,0 @@ -# v3io diff --git a/vendor/github.com/v3io/v3io-go-http/container.go b/vendor/github.com/v3io/v3io-go-http/container.go deleted file mode 100644 index 5c713761c3f..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/container.go +++ /dev/null @@ -1,144 +0,0 @@ -package v3io - -import ( - "sync/atomic" - "time" - - "github.com/nuclio/logger" -) - -type Container struct { - logger logger.Logger - session *Session - Sync *SyncContainer -} - -func newContainer(parentLogger logger.Logger, session *Session, alias string) (*Container, error) { - newSyncContainer, err := newSyncContainer(parentLogger, session.Sync, alias) - if err != nil { - return nil, err - } - - return &Container{ - logger: parentLogger.GetChild(alias), - session: session, - Sync: newSyncContainer, - }, nil -} - -func (c *Container) ListAll(input *ListAllInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) ListBucket(input *ListBucketInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) GetObject(input *GetObjectInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) DeleteObject(input *DeleteObjectInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) PutObject(input *PutObjectInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) GetItem(input *GetItemInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) GetItems(input *GetItemsInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) PutItem(input *PutItemInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) PutItems(input *PutItemsInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) UpdateItem(input *UpdateItemInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) CreateStream(input *CreateStreamInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) DeleteStream(input *DeleteStreamInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) SeekShard(input *SeekShardInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) PutRecords(input *PutRecordsInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) GetRecords(input *GetRecordsInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - return c.sendRequest(input, context, responseChan) -} - -func (c *Container) sendRequest(input interface{}, - context interface{}, - responseChan chan *Response) (*Request, error) { - id := atomic.AddUint64(&requestID, 1) - - // create a request/response (TODO: from pool) - requestResponse := &RequestResponse{ - Request: Request{ - ID: id, - container: c, - Input: input, - Context: context, - responseChan: responseChan, - SendTimeNanoseconds: time.Now().UnixNano(), - }, - } - - // point to container - requestResponse.Request.requestResponse = requestResponse - - if err := c.session.sendRequest(&requestResponse.Request); err != nil { - return nil, err - } - - return &requestResponse.Request, nil -} diff --git a/vendor/github.com/v3io/v3io-go-http/context.go b/vendor/github.com/v3io/v3io-go-http/context.go deleted file mode 100644 index f62dd286a55..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/context.go +++ /dev/null @@ -1,116 +0,0 @@ -package v3io - -import ( - "github.com/nuclio/logger" -) - -type Context struct { - logger logger.Logger - Sync *SyncContext - requestChan chan *Request - numWorkers int -} - -type SessionConfig struct { - Username string - Password string - Label string - SessionKey string -} - -func NewContext(parentLogger logger.Logger, clusterURL string, numWorkers int) (*Context, error) { - newSyncContext, err := newSyncContext(parentLogger, clusterURL) - if err != nil { - return nil, err - } - - newContext := &Context{ - logger: parentLogger.GetChild("v3io"), - Sync: newSyncContext, - requestChan: make(chan *Request, 1024), - numWorkers: numWorkers, - } - - for workerIndex := 0; workerIndex < numWorkers; workerIndex++ { - go newContext.workerEntry(workerIndex) - } - - return newContext, nil -} - -func (c *Context) NewSession(username string, password string, label string) (*Session, error) { - return newSession(c.logger, c, username, password, label, "") -} - -func (c *Context) NewSessionFromConfig(sc *SessionConfig) (*Session, error) { - return newSession(c.logger, c, sc.Username, sc.Password, sc.Label, sc.SessionKey) -} - -func (c *Context) sendRequest(request *Request) error { - - // send the request to the request channel - c.requestChan <- request - - return nil -} - -func (c *Context) workerEntry(workerIndex int) { - for { - var response *Response - var err error - - // read a request - request := <-c.requestChan - - // according to the input type - switch typedInput := request.Input.(type) { - case *ListAllInput: - response, err = request.session.Sync.ListAll() - case *ListBucketInput: - response, err = request.container.Sync.ListBucket(typedInput) - case *GetObjectInput: - response, err = request.container.Sync.GetObject(typedInput) - case *PutObjectInput: - err = request.container.Sync.PutObject(typedInput) - case *DeleteObjectInput: - err = request.container.Sync.DeleteObject(typedInput) - case *GetItemInput: - response, err = request.container.Sync.GetItem(typedInput) - case *GetItemsInput: - response, err = request.container.Sync.GetItems(typedInput) - case *PutItemInput: - err = request.container.Sync.PutItem(typedInput) - case *PutItemsInput: - response, err = request.container.Sync.PutItems(typedInput) - case *UpdateItemInput: - err = request.container.Sync.UpdateItem(typedInput) - case *CreateStreamInput: - err = request.container.Sync.CreateStream(typedInput) - case *DeleteStreamInput: - err = request.container.Sync.DeleteStream(typedInput) - case *SeekShardInput: - response, err = request.container.Sync.SeekShard(typedInput) - case *PutRecordsInput: - response, err = request.container.Sync.PutRecords(typedInput) - case *GetRecordsInput: - response, err = request.container.Sync.GetRecords(typedInput) - default: - c.logger.ErrorWith("Got unexpected request type", "request", request) - } - - // TODO: have the sync interfaces somehow use the pre-allocated response - if response != nil { - request.requestResponse.Response = *response - } - - response = &request.requestResponse.Response - - response.ID = request.ID - response.Error = err - response.requestResponse = request.requestResponse - response.Context = request.Context - - // write to response channel - request.responseChan <- &request.requestResponse.Response - } -} diff --git a/vendor/github.com/v3io/v3io-go-http/error.go b/vendor/github.com/v3io/v3io-go-http/error.go deleted file mode 100644 index 7732e31cce6..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/error.go +++ /dev/null @@ -1,27 +0,0 @@ -package v3io - -import ( - "fmt" - - "errors" -) - -// ErrorWithStatusCode is an error that holds a status code -type ErrorWithStatusCode struct { - error - statusCode int - message string -} - -// NewErrorWithStatusCode creates an error that holds a status code -func NewErrorWithStatusCode(statusCode int, format string, args ...interface{}) ErrorWithStatusCode { - return ErrorWithStatusCode{ - error: errors.New(fmt.Sprintf(format, args...)), - statusCode: statusCode, - } -} - -// StatusCode returns the status code of the error -func (e *ErrorWithStatusCode) StatusCode() int { - return e.statusCode -} diff --git a/vendor/github.com/v3io/v3io-go-http/item.go b/vendor/github.com/v3io/v3io-go-http/item.go deleted file mode 100644 index 0cbc1737170..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/item.go +++ /dev/null @@ -1,35 +0,0 @@ -package v3io - -import "strconv" - -type Item map[string]interface{} - -func (i Item) GetField(name string) interface{} { - return i[name] -} - -func (i Item) GetFieldInt(name string) (int, error) { - switch typedField := i[name].(type) { - case int: - return typedField, nil - case float64: - return int(typedField), nil - case string: - return strconv.Atoi(typedField) - default: - return 0, ErrInvalidTypeConversion - } -} - -func (i Item) GetFieldString(name string) (string, error) { - switch typedField := i[name].(type) { - case int: - return strconv.Itoa(typedField), nil - case float64: - return strconv.FormatFloat(typedField, 'E', -1, 64), nil - case string: - return typedField, nil - default: - return "", ErrInvalidTypeConversion - } -} diff --git a/vendor/github.com/v3io/v3io-go-http/itemscursor.go b/vendor/github.com/v3io/v3io-go-http/itemscursor.go deleted file mode 100644 index 57f13b49e0f..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/itemscursor.go +++ /dev/null @@ -1,11 +0,0 @@ -package v3io - -type ItemsCursor struct { - Sync *SyncItemsCursor -} - -func newItemsCursor(container *Container, input *GetItemsInput, response *Response) *ItemsCursor { - return &ItemsCursor{} -} - -// TODO: support Next and All() for async as well diff --git a/vendor/github.com/v3io/v3io-go-http/session.go b/vendor/github.com/v3io/v3io-go-http/session.go deleted file mode 100644 index 764df4bf7af..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/session.go +++ /dev/null @@ -1,72 +0,0 @@ -package v3io - -import ( - "sync/atomic" - - "github.com/nuclio/logger" -) - -// TODO: Request should have a global pool -var requestID uint64 = 0 - -type Session struct { - Sync *SyncSession - logger logger.Logger - context *Context -} - -func newSession(parentLogger logger.Logger, - context *Context, - username string, - password string, - label string, - sessionKey string) (*Session, error) { - - newSyncSession, err := newSyncSession(parentLogger, context.Sync, username, password, label, sessionKey) - if err != nil { - return nil, err - } - - return &Session{ - logger: parentLogger.GetChild("session"), - context: context, - Sync: newSyncSession, - }, nil -} - -func (s *Session) NewContainer(alias string) (*Container, error) { - return newContainer(s.logger, s, alias) -} - -func (s *Session) ListAll(input *ListAllInput, - context interface{}, - responseChan chan *Response) (*Request, error) { - - id := atomic.AddUint64(&requestID, 1) - requestResponse := &RequestResponse{ - Request: Request{ - ID: id, - Input: input, - Context: context, - responseChan: responseChan, - }, - } - - // point to container - requestResponse.Request.requestResponse = requestResponse - - if err := s.sendRequest(&requestResponse.Request); err != nil { - return nil, err - } - - return &requestResponse.Request, nil -} - -func (s *Session) sendRequest(request *Request) error { - - // set session - request.session = s - - // delegate to context - return s.context.sendRequest(request) -} diff --git a/vendor/github.com/v3io/v3io-go-http/synccontainer.go b/vendor/github.com/v3io/v3io-go-http/synccontainer.go deleted file mode 100644 index f52b99bf9da..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/synccontainer.go +++ /dev/null @@ -1,629 +0,0 @@ -package v3io - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "path" - "reflect" - "strconv" - "strings" - - "github.com/nuclio/logger" -) - -// function names -const ( - setObjectFunctionName = "ObjectSet" - putItemFunctionName = "PutItem" - updateItemFunctionName = "UpdateItem" - getItemFunctionName = "GetItem" - getItemsFunctionName = "GetItems" - createStreamFunctionName = "CreateStream" - putRecordsFunctionName = "PutRecords" - getRecordsFunctionName = "GetRecords" - seekShardsFunctionName = "SeekShard" -) - -// headers for set object -var setObjectHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": setObjectFunctionName, -} - -// headers for put item -var putItemHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": putItemFunctionName, -} - -// headers for update item -var updateItemHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": updateItemFunctionName, -} - -// headers for update item -var getItemHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": getItemFunctionName, -} - -// headers for update item -var getItemsHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": getItemsFunctionName, -} - -// headers for create stream -var createStreamHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": createStreamFunctionName, -} - -// headers for put records -var putRecordsHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": putRecordsFunctionName, -} - -// headers for put records -var getRecordsHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": getRecordsFunctionName, -} - -// headers for seek records -var seekShardsHeaders = map[string]string{ - "Content-Type": "application/json", - "X-v3io-function": seekShardsFunctionName, -} - -// map between SeekShardInputType and its encoded counterpart -var seekShardsInputTypeToString = [...]string{ - "TIME", - "SEQUENCE", - "LATEST", - "EARLIEST", -} - -type SyncContainer struct { - logger logger.Logger - session *SyncSession - alias string - uriPrefix string -} - -func newSyncContainer(parentLogger logger.Logger, session *SyncSession, alias string) (*SyncContainer, error) { - return &SyncContainer{ - logger: parentLogger.GetChild(alias), - session: session, - alias: alias, - uriPrefix: fmt.Sprintf("http://%s/%s", session.context.clusterURL, alias), - }, nil -} - -func (sc *SyncContainer) ListBucket(input *ListBucketInput) (*Response, error) { - output := ListBucketOutput{} - - // prepare the query path - fullPath := sc.uriPrefix - if input.Path != "" { - fullPath += "?prefix=" + input.Path - } - - return sc.session.sendRequestAndXMLUnmarshal("GET", fullPath, nil, nil, &output) -} - -func (sc *SyncContainer) GetObject(input *GetObjectInput) (*Response, error) { - response, err := sc.session.sendRequest("GET", sc.getPathURI(input.Path), nil, nil, false) - if err != nil { - return nil, err - } - - return response, nil -} - -func (sc *SyncContainer) DeleteObject(input *DeleteObjectInput) error { - _, err := sc.session.sendRequest("DELETE", sc.getPathURI(input.Path), nil, nil, true) - if err != nil { - return err - } - - return nil -} - -func (sc *SyncContainer) PutObject(input *PutObjectInput) error { - _, err := sc.session.sendRequest("PUT", sc.getPathURI(input.Path), nil, input.Body, true) - if err != nil { - return err - } - - return nil -} - -func (sc *SyncContainer) GetItem(input *GetItemInput) (*Response, error) { - - // no need to marshal, just sprintf - body := fmt.Sprintf(`{"AttributesToGet": "%s"}`, strings.Join(input.AttributeNames, ",")) - - response, err := sc.session.sendRequest("PUT", sc.getPathURI(input.Path), getItemHeaders, []byte(body), false) - if err != nil { - return nil, err - } - - // ad hoc structure that contains response - item := struct { - Item map[string]map[string]string - }{} - - sc.logger.DebugWith("Body", "body", string(response.Body())) - - // unmarshal the body - err = json.Unmarshal(response.Body(), &item) - if err != nil { - return nil, err - } - - // decode the response - attributes, err := sc.decodeTypedAttributes(item.Item) - if err != nil { - return nil, err - } - - // attach the output to the response - response.Output = &GetItemOutput{attributes} - - return response, nil -} - -func (sc *SyncContainer) GetItems(input *GetItemsInput) (*Response, error) { - - // create GetItem Body - body := map[string]interface{}{ - "AttributesToGet": strings.Join(input.AttributeNames, ","), - } - - if input.Filter != "" { - body["FilterExpression"] = input.Filter - } - - if input.Marker != "" { - body["Marker"] = input.Marker - } - - if input.ShardingKey != "" { - body["ShardingKey"] = input.ShardingKey - } - - if input.Limit != 0 { - body["Limit"] = input.Limit - } - - if input.TotalSegments != 0 { - body["TotalSegment"] = input.TotalSegments - body["Segment"] = input.Segment - } - - if input.SortKeyRangeStart != "" { - body["SortKeyRangeStart"] = input.SortKeyRangeStart - } - - if input.SortKeyRangeEnd != "" { - body["SortKeyRangeEnd"] = input.SortKeyRangeEnd - } - - marshalledBody, err := json.Marshal(body) - if err != nil { - return nil, err - } - - response, err := sc.session.sendRequest("PUT", - sc.getPathURI(input.Path), - getItemsHeaders, - []byte(marshalledBody), - false) - - if err != nil { - return nil, err - } - - sc.logger.DebugWith("Body", "body", string(response.Body())) - - getItemsResponse := struct { - Items []map[string]map[string]string - NextMarker string - LastItemIncluded string - }{} - - // unmarshal the body into an ad hoc structure - err = json.Unmarshal(response.Body(), &getItemsResponse) - if err != nil { - return nil, err - } - - //validate getItems response to avoid infinite loop - if getItemsResponse.LastItemIncluded != "TRUE" && (getItemsResponse.NextMarker == "" || getItemsResponse.NextMarker == input.Marker) { - errMsg := fmt.Sprintf("Invalid getItems response: lastItemIncluded=false and nextMarker='%s', "+ - "startMarker='%s', probably due to object size bigger than 2M. Query is: %+v", getItemsResponse.NextMarker, input.Marker, input) - sc.logger.Warn(errMsg) - } - - getItemsOutput := GetItemsOutput{ - NextMarker: getItemsResponse.NextMarker, - Last: getItemsResponse.LastItemIncluded == "TRUE", - } - - // iterate through the items and decode them - for _, typedItem := range getItemsResponse.Items { - - item, err := sc.decodeTypedAttributes(typedItem) - if err != nil { - return nil, err - } - - getItemsOutput.Items = append(getItemsOutput.Items, item) - } - - // attach the output to the response - response.Output = &getItemsOutput - - return response, nil -} - -func (sc *SyncContainer) GetItemsCursor(input *GetItemsInput) (*SyncItemsCursor, error) { - return newSyncItemsCursor(sc, input) -} - -func (sc *SyncContainer) PutItem(input *PutItemInput) error { - - // prepare the query path - _, err := sc.putItem(input.Path, putItemFunctionName, input.Attributes, input.Condition, putItemHeaders, nil) - return err -} - -func (sc *SyncContainer) PutItems(input *PutItemsInput) (*Response, error) { - response := allocateResponse() - if response == nil { - return nil, errors.New("Failed to allocate response") - } - - putItemsOutput := PutItemsOutput{ - Success: true, - } - - for itemKey, itemAttributes := range input.Items { - - // try to post the item - _, err := sc.putItem( - input.Path+"/"+itemKey, putItemFunctionName, itemAttributes, input.Condition, putItemHeaders, nil) - - // if there was an error, shove it to the list of errors - if err != nil { - - // create the map to hold the errors since at least one exists - if putItemsOutput.Errors == nil { - putItemsOutput.Errors = map[string]error{} - } - - putItemsOutput.Errors[itemKey] = err - - // clear success, since at least one error exists - putItemsOutput.Success = false - } - } - - response.Output = &putItemsOutput - - return response, nil -} - -func (sc *SyncContainer) UpdateItem(input *UpdateItemInput) error { - var err error - - if input.Attributes != nil { - - // specify update mode as part of body. "Items" will be injected - body := map[string]interface{}{ - "UpdateMode": "CreateOrReplaceAttributes", - } - - _, err = sc.putItem(input.Path, putItemFunctionName, input.Attributes, input.Condition, putItemHeaders, body) - - } else if input.Expression != nil { - - _, err = sc.updateItemWithExpression( - input.Path, updateItemFunctionName, *input.Expression, input.Condition, updateItemHeaders) - } - - return err -} - -func (sc *SyncContainer) CreateStream(input *CreateStreamInput) error { - body := fmt.Sprintf(`{"ShardCount": %d, "RetentionPeriodHours": %d}`, - input.ShardCount, - input.RetentionPeriodHours) - - _, err := sc.session.sendRequest("POST", sc.getPathURI(input.Path), createStreamHeaders, []byte(body), true) - if err != nil { - return err - } - - return nil -} - -func (sc *SyncContainer) DeleteStream(input *DeleteStreamInput) error { - - // get all shards in the stream - response, err := sc.ListBucket(&ListBucketInput{ - Path: input.Path, - }) - - if err != nil { - return err - } - - defer response.Release() - - // delete the shards one by one - for _, content := range response.Output.(*ListBucketOutput).Contents { - - // TODO: handle error - stop deleting? return multiple errors? - sc.DeleteObject(&DeleteObjectInput{ - Path: content.Key, - }) - } - - // delete the actual stream - return sc.DeleteObject(&DeleteObjectInput{ - Path: path.Dir(input.Path) + "/", - }) -} - -func (sc *SyncContainer) PutRecords(input *PutRecordsInput) (*Response, error) { - - // TODO: set this to an initial size through heuristics? - // This function encodes manually - var buffer bytes.Buffer - - buffer.WriteString(`{"Records": [`) - - for recordIdx, record := range input.Records { - buffer.WriteString(`{"Data": "`) - buffer.WriteString(base64.StdEncoding.EncodeToString(record.Data)) - buffer.WriteString(`"`) - - if record.ClientInfo != nil { - buffer.WriteString(`,"ClientInfo": "`) - buffer.WriteString(base64.StdEncoding.EncodeToString(record.ClientInfo)) - buffer.WriteString(`"`) - } - - if record.ShardID != nil { - buffer.WriteString(`, "ShardId": `) - buffer.WriteString(strconv.Itoa(*record.ShardID)) - } - - if record.PartitionKey != "" { - buffer.WriteString(`, "PartitionKey": `) - buffer.WriteString(`"` + record.PartitionKey + `"`) - } - - // add comma if not last - if recordIdx != len(input.Records)-1 { - buffer.WriteString(`}, `) - } else { - buffer.WriteString(`}`) - } - } - - buffer.WriteString(`]}`) - str := string(buffer.Bytes()) - fmt.Println(str) - - response, err := sc.session.sendRequest("POST", sc.getPathURI(input.Path), putRecordsHeaders, buffer.Bytes(), false) - if err != nil { - return nil, err - } - - putRecordsOutput := PutRecordsOutput{} - - // unmarshal the body into an ad hoc structure - err = json.Unmarshal(response.Body(), &putRecordsOutput) - if err != nil { - return nil, err - } - - // set the output in the response - response.Output = &putRecordsOutput - - return response, nil -} - -func (sc *SyncContainer) SeekShard(input *SeekShardInput) (*Response, error) { - var buffer bytes.Buffer - - buffer.WriteString(`{"Type": "`) - buffer.WriteString(seekShardsInputTypeToString[input.Type]) - buffer.WriteString(`"`) - - if input.Type == SeekShardInputTypeSequence { - buffer.WriteString(`, "StartingSequenceNumber": `) - buffer.WriteString(strconv.Itoa(input.StartingSequenceNumber)) - } else if input.Type == SeekShardInputTypeTime { - buffer.WriteString(`, "TimestampSec": `) - buffer.WriteString(strconv.Itoa(input.Timestamp)) - buffer.WriteString(`, "TimestampNSec": 0`) - } - - buffer.WriteString(`}`) - - response, err := sc.session.sendRequest("POST", sc.getPathURI(input.Path), seekShardsHeaders, buffer.Bytes(), false) - if err != nil { - return nil, err - } - - seekShardOutput := SeekShardOutput{} - - // unmarshal the body into an ad hoc structure - err = json.Unmarshal(response.Body(), &seekShardOutput) - if err != nil { - return nil, err - } - - // set the output in the response - response.Output = &seekShardOutput - - return response, nil -} - -func (sc *SyncContainer) GetRecords(input *GetRecordsInput) (*Response, error) { - body := fmt.Sprintf(`{"Location": "%s", "Limit": %d}`, - input.Location, - input.Limit) - - response, err := sc.session.sendRequest("POST", sc.getPathURI(input.Path), getRecordsHeaders, []byte(body), false) - if err != nil { - return nil, err - } - - getRecordsOutput := GetRecordsOutput{} - - // unmarshal the body into an ad hoc structure - err = json.Unmarshal(response.Body(), &getRecordsOutput) - if err != nil { - return nil, err - } - - // set the output in the response - response.Output = &getRecordsOutput - - return response, nil -} - -func (sc *SyncContainer) putItem(path string, - functionName string, - attributes map[string]interface{}, - condition string, - headers map[string]string, - body map[string]interface{}) (*Response, error) { - - // iterate over all attributes and encode them with their types - typedAttributes, err := sc.encodeTypedAttributes(attributes) - if err != nil { - return nil, err - } - - // create an empty body if the user didn't pass anything - if body == nil { - body = map[string]interface{}{} - } - - // set item in body (use what the user passed as a base) - body["Item"] = typedAttributes - - if condition != "" { - body["ConditionExpression"] = condition - } - - jsonEncodedBodyContents, err := json.Marshal(body) - if err != nil { - return nil, err - } - - return sc.session.sendRequest("PUT", sc.getPathURI(path), headers, jsonEncodedBodyContents, false) -} - -func (sc *SyncContainer) updateItemWithExpression(path string, - functionName string, - expression string, - condition string, - headers map[string]string) (*Response, error) { - - body := map[string]interface{}{ - "UpdateExpression": expression, - "UpdateMode": "CreateOrReplaceAttributes", - } - - if condition != "" { - body["ConditionExpression"] = condition - } - - jsonEncodedBodyContents, err := json.Marshal(body) - if err != nil { - return nil, err - } - - return sc.session.sendRequest("POST", sc.getPathURI(path), headers, jsonEncodedBodyContents, false) -} - -// {"age": 30, "name": "foo"} -> {"age": {"N": 30}, "name": {"S": "foo"}} -func (sc *SyncContainer) encodeTypedAttributes(attributes map[string]interface{}) (map[string]map[string]string, error) { - typedAttributes := make(map[string]map[string]string) - - for attributeName, attributeValue := range attributes { - typedAttributes[attributeName] = make(map[string]string) - switch value := attributeValue.(type) { - default: - return nil, fmt.Errorf("Unexpected attribute type for %s: %T", attributeName, reflect.TypeOf(attributeValue)) - case int: - typedAttributes[attributeName]["N"] = strconv.Itoa(value) - // this is a tmp bypass to the fact Go maps Json numbers to float64 - case float64: - typedAttributes[attributeName]["N"] = strconv.FormatFloat(value, 'E', -1, 64) - case string: - typedAttributes[attributeName]["S"] = value - case []byte: - typedAttributes[attributeName]["B"] = base64.StdEncoding.EncodeToString(value) - } - } - - return typedAttributes, nil -} - -// {"age": {"N": 30}, "name": {"S": "foo"}} -> {"age": 30, "name": "foo"} -func (sc *SyncContainer) decodeTypedAttributes(typedAttributes map[string]map[string]string) (map[string]interface{}, error) { - var err error - attributes := map[string]interface{}{} - - for attributeName, typedAttributeValue := range typedAttributes { - - // try to parse as number - if numberValue, ok := typedAttributeValue["N"]; ok { - - // try int - if intValue, err := strconv.Atoi(numberValue); err != nil { - - // try float - floatValue, err := strconv.ParseFloat(numberValue, 64) - if err != nil { - return nil, fmt.Errorf("Value for %s is not int or float: %s", attributeName, numberValue) - } - - // save as float - attributes[attributeName] = floatValue - } else { - attributes[attributeName] = intValue - } - } else if stringValue, ok := typedAttributeValue["S"]; ok { - attributes[attributeName] = stringValue - } else if byteSliceValue, ok := typedAttributeValue["B"]; ok { - attributes[attributeName], err = base64.StdEncoding.DecodeString(byteSliceValue) - if err != nil { - return nil, err - } - } - } - - return attributes, nil -} - -func (sc *SyncContainer) getContext() *SyncContext { - return sc.session.context -} - -func (sc *SyncContainer) getPathURI(path string) string { - return sc.uriPrefix + "/" + path -} diff --git a/vendor/github.com/v3io/v3io-go-http/synccontext.go b/vendor/github.com/v3io/v3io-go-http/synccontext.go deleted file mode 100644 index a6b890c5360..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/synccontext.go +++ /dev/null @@ -1,36 +0,0 @@ -package v3io - -import ( - "time" - - "github.com/nuclio/logger" - "github.com/valyala/fasthttp" -) - -type SyncContext struct { - logger logger.Logger - httpClient *fasthttp.HostClient - clusterURL string - Timeout time.Duration -} - -func newSyncContext(parentLogger logger.Logger, clusterURL string) (*SyncContext, error) { - newSyncContext := &SyncContext{ - logger: parentLogger.GetChild("v3io"), - httpClient: &fasthttp.HostClient{ - Addr: clusterURL, - }, - clusterURL: clusterURL, - } - - return newSyncContext, nil -} - -func (sc *SyncContext) sendRequest(request *fasthttp.Request, response *fasthttp.Response) error { - - if sc.Timeout <= 0 { - return sc.httpClient.Do(request, response) - } else { - return sc.httpClient.DoTimeout(request, response, sc.Timeout) - } -} diff --git a/vendor/github.com/v3io/v3io-go-http/syncitemscursor.go b/vendor/github.com/v3io/v3io-go-http/syncitemscursor.go deleted file mode 100644 index 2638ba42511..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/syncitemscursor.go +++ /dev/null @@ -1,143 +0,0 @@ -package v3io - -import ( - "errors" -) - -var ErrInvalidTypeConversion = errors.New("Invalid type conversion") - -type SyncItemsCursor struct { - currentItem Item - currentError error - currentResponse *Response - nextMarker string - moreItemsExist bool - itemIndex int - items []Item - input *GetItemsInput - container *SyncContainer -} - -func newSyncItemsCursor(container *SyncContainer, input *GetItemsInput) (*SyncItemsCursor, error) { - newSyncItemsCursor := &SyncItemsCursor{ - container: container, - input: input, - } - - response, err := container.GetItems(input) - if err != nil { - return nil, err - } - - newSyncItemsCursor.setResponse(response) - - return newSyncItemsCursor, nil -} - -// Err returns the last error -func (ic *SyncItemsCursor) Err() error { - return ic.currentError -} - -// Release releases a cursor and its underlying resources -func (ic *SyncItemsCursor) Release() { - if ic.currentResponse != nil { - ic.currentResponse.Release() - } -} - -// Next gets the next matching item. this may potentially block as this lazy loads items from the collection -func (ic *SyncItemsCursor) Next() bool { - item, err := ic.NextItem() - - if item == nil || err != nil { - return false - } - - return true -} - -// NextItem gets the next matching item. this may potentially block as this lazy loads items from the collection -func (ic *SyncItemsCursor) NextItem() (Item, error) { - - // are there any more items left in the previous response we received? - if ic.itemIndex < len(ic.items) { - ic.currentItem = ic.items[ic.itemIndex] - ic.currentError = nil - - // next time we'll give next item - ic.itemIndex++ - - return ic.currentItem, nil - } - - // are there any more items up stream? - if !ic.moreItemsExist { - ic.currentError = nil - return nil, nil - } - - // get the previous request input and modify it with the marker - ic.input.Marker = ic.nextMarker - - // invoke get items - newResponse, err := ic.container.GetItems(ic.input) - if err != nil { - return nil, err - } - - // release the previous response - ic.currentResponse.Release() - - // set the new response - read all the sub information from it - ic.setResponse(newResponse) - - // and recurse into next now that we repopulated response - return ic.NextItem() -} - -// gets all items -func (ic *SyncItemsCursor) All() ([]Item, error) { - var items []Item - - for ic.Next() { - items = append(items, ic.GetItem()) - } - - if ic.Err() != nil { - return nil, ic.Err() - } - - return items, nil -} - -func (ic *SyncItemsCursor) GetField(name string) interface{} { - return ic.currentItem[name] -} - -func (ic *SyncItemsCursor) GetFieldInt(name string) (int, error) { - return ic.currentItem.GetFieldInt(name) -} - -func (ic *SyncItemsCursor) GetFieldString(name string) (string, error) { - return ic.currentItem.GetFieldString(name) -} - -func (ic *SyncItemsCursor) GetFields() map[string]interface{} { - return ic.currentItem -} - -func (ic *SyncItemsCursor) GetItem() Item { - return ic.currentItem -} - -func (ic *SyncItemsCursor) setResponse(response *Response) { - ic.currentResponse = response - - getItemsOutput := response.Output.(*GetItemsOutput) - - ic.moreItemsExist = !getItemsOutput.Last - ic.nextMarker = getItemsOutput.NextMarker - ic.items = getItemsOutput.Items - ic.itemIndex = 0 -} diff --git a/vendor/github.com/v3io/v3io-go-http/syncsession.go b/vendor/github.com/v3io/v3io-go-http/syncsession.go deleted file mode 100644 index aad26927cf9..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/syncsession.go +++ /dev/null @@ -1,146 +0,0 @@ -package v3io - -import ( - "encoding/base64" - "encoding/xml" - "fmt" - - "github.com/nuclio/logger" - "github.com/valyala/fasthttp" -) - -type SyncSession struct { - logger logger.Logger - context *SyncContext - authenticatioHeaderKey string - authenticatioHeaderValue string -} - -func newSyncSession(parentLogger logger.Logger, - context *SyncContext, - username string, - password string, - label string, - sessionKey string) (*SyncSession, error) { - - if sessionKey != "" { - //if sessionKey not empty - return &SyncSession{ - logger: parentLogger.GetChild("session"), - context: context, - authenticatioHeaderKey: "X-v3io-session-key", - authenticatioHeaderValue: sessionKey, - }, nil - } - // generate token for basic authentication - usernameAndPassword := fmt.Sprintf("%s:%s", username, password) - encodedUsernameAndPassword := base64.StdEncoding.EncodeToString([]byte(usernameAndPassword)) - - return &SyncSession{ - logger: parentLogger.GetChild("session"), - context: context, - authenticatioHeaderKey: "Authorization", - authenticatioHeaderValue: "Basic " + encodedUsernameAndPassword, - }, nil -} - -func (ss *SyncSession) ListAll() (*Response, error) { - output := ListAllOutput{} - - return ss.sendRequestAndXMLUnmarshal("GET", fmt.Sprintf("http://%s/", ss.context.clusterURL), nil, nil, &output) -} - -func (ss *SyncSession) sendRequestViaContext(request *fasthttp.Request, response *fasthttp.Response) error { - - request.Header.Set(ss.authenticatioHeaderKey, ss.authenticatioHeaderValue) - - // delegate to context - return ss.context.sendRequest(request, response) -} - -func (ss *SyncSession) sendRequest( - method string, - uri string, - headers map[string]string, - body []byte, - releaseResponse bool) (*Response, error) { - - var success bool - var statusCode int - - request := fasthttp.AcquireRequest() - response := allocateResponse() - - // init request - request.SetRequestURI(uri) - request.Header.SetMethod(method) - request.SetBody(body) - - if headers != nil { - for headerName, headerValue := range headers { - request.Header.Add(headerName, headerValue) - } - } - - // execute the request - err := ss.sendRequestViaContext(request, response.response) - if err != nil { - goto cleanup - } - - statusCode = response.response.StatusCode() - - // did we get a 2xx response? - success = statusCode >= 200 && statusCode < 300 - - // make sure we got expected status - if !success { - err = NewErrorWithStatusCode(statusCode, "Failed %s with status %d", method, statusCode) - goto cleanup - } - -cleanup: - - // we're done with the request - the response must be released by the user - // unless there's an error - fasthttp.ReleaseRequest(request) - - if err != nil { - response.Release() - return nil, err - } - - // if the user doesn't need the response, release it - if releaseResponse { - response.Release() - return nil, nil - } - - return response, nil -} - -func (ss *SyncSession) sendRequestAndXMLUnmarshal( - method string, - uri string, - headers map[string]string, - body []byte, - output interface{}) (*Response, error) { - - response, err := ss.sendRequest(method, uri, headers, body, false) - if err != nil { - return nil, err - } - - // unmarshal the body into the output - err = xml.Unmarshal(response.response.Body(), output) - if err != nil { - response.Release() - - return nil, err - } - - // set output in response - response.Output = output - - return response, nil -} diff --git a/vendor/github.com/v3io/v3io-go-http/types.go b/vendor/github.com/v3io/v3io-go-http/types.go deleted file mode 100644 index 60266429399..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/types.go +++ /dev/null @@ -1,276 +0,0 @@ -package v3io - -import ( - "encoding/xml" - - "github.com/valyala/fasthttp" -) - -// -// Request / response -// - -type Request struct { - ID uint64 - - // the container on which the request was performed (if applicable) - container *Container - - // the session on which the request was performed (if applicable) - session *Session - - // holds the input (e.g. ListBucketInput, GetItemInput) - Input interface{} - - // a user supplied context - Context interface{} - - // the channel to which the response must be posted - responseChan chan *Response - - // pointer to container - requestResponse *RequestResponse - - // Request time - SendTimeNanoseconds int64 -} - -type Response struct { - response *fasthttp.Response - - // hold a decoded output, if any - Output interface{} - - // Equal to the ID of request - ID uint64 - - // holds the error for async responses - Error error - - // a user supplied context - Context interface{} - - // pointer to container - requestResponse *RequestResponse -} - -func (r *Response) Release() { - if r.response != nil { - fasthttp.ReleaseResponse(r.response) - } -} - -func (r *Response) Body() []byte { - return r.response.Body() -} - -func (r *Response) Request() *Request { - return &r.requestResponse.Request -} - -// holds both a request and response -type RequestResponse struct { - Request Request - Response Response -} - -type ListBucketInput struct { - Path string -} - -type Content struct { - XMLName xml.Name `xml:"Contents"` - Key string `xml:"Key"` - Size int `xml:"Size"` - LastSequenceId int `xml:"LastSequenceId"` - ETag string `xml:"ETag"` - LastModified string `xml:"LastModified"` -} - -type CommonPrefix struct { - XMLName xml.Name `xml:"CommonPrefixes"` - Prefix string `xml:"Prefix"` -} - -type ListBucketOutput struct { - XMLName xml.Name `xml:"ListBucketResult"` - Name string `xml:"Name"` - NextMarker string `xml:"NextMarker"` - MaxKeys string `xml:"MaxKeys"` - Contents []Content `xml:"Contents"` - CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"` -} - -type ListAllInput struct { -} - -type ListAllOutput struct { - XMLName xml.Name `xml:"ListAllMyBucketsResult"` - Owner interface{} `xml:"Owner"` - Buckets Buckets `xml:"Buckets"` -} - -type Buckets struct { - XMLName xml.Name `xml:"Buckets"` - Bucket []Bucket `xml:"Bucket"` -} - -type Bucket struct { - XMLName xml.Name `xml:"Bucket"` - Name string `xml:"Name"` - CreationDate string `xml:"CreationDate"` - Id int `xml:"Id"` -} - -type GetObjectInput struct { - Path string -} - -type PutObjectInput struct { - Path string - Body []byte -} - -type DeleteObjectInput struct { - Path string -} - -type SetObjectInput struct { - Path string - ValidationModifiedTimeSec uint64 - ValidationModifiedTimeNsec uint64 - ValidationOperation string - ValidationMask uint64 - ValidationValue uint64 - SetOperation string - DataMask uint64 - DataValue uint64 -} - -type PutItemInput struct { - Path string - Condition string - Attributes map[string]interface{} -} - -type PutItemsInput struct { - Path string - Condition string - Items map[string]map[string]interface{} -} - -type PutItemsOutput struct { - Success bool - Errors map[string]error -} - -type UpdateItemInput struct { - Path string - Attributes map[string]interface{} - Expression *string - Condition string -} - -type GetItemInput struct { - Path string - AttributeNames []string -} - -type GetItemOutput struct { - Item Item -} - -type GetItemsInput struct { - Path string - AttributeNames []string - Filter string - Marker string - ShardingKey string - Limit int - Segment int - TotalSegments int - SortKeyRangeStart string - SortKeyRangeEnd string -} - -type GetItemsOutput struct { - Last bool - NextMarker string - Items []Item -} - -type CreateStreamInput struct { - Path string - ShardCount int - RetentionPeriodHours int -} - -type StreamRecord struct { - ShardID *int - Data []byte - ClientInfo []byte - PartitionKey string -} - -type PutRecordsInput struct { - Path string - Records []*StreamRecord -} - -type PutRecordResult struct { - SequenceNumber int - ShardID int `json:"ShardId"` - ErrorCode int - ErrorMessage string -} - -type PutRecordsOutput struct { - FailedRecordCount int - Records []PutRecordResult -} - -type DeleteStreamInput struct { - Path string -} - -type SeekShardInputType int - -const ( - SeekShardInputTypeTime SeekShardInputType = iota - SeekShardInputTypeSequence - SeekShardInputTypeLatest - SeekShardInputTypeEarliest -) - -type SeekShardInput struct { - Path string - Type SeekShardInputType - StartingSequenceNumber int - Timestamp int -} - -type SeekShardOutput struct { - Location string -} - -type GetRecordsInput struct { - Path string - Location string - Limit int -} - -type GetRecordsResult struct { - ArrivalTimeSec int - ArrivalTimeNSec int - SequenceNumber int - ClientInfo []byte - PartitionKey string - Data []byte -} - -type GetRecordsOutput struct { - NextLocation string - MSecBehindLatest int - RecordsBehindLatest int - Records []GetRecordsResult -} diff --git a/vendor/github.com/v3io/v3io-go-http/utils.go b/vendor/github.com/v3io/v3io-go-http/utils.go deleted file mode 100644 index da5d19e7140..00000000000 --- a/vendor/github.com/v3io/v3io-go-http/utils.go +++ /dev/null @@ -1,11 +0,0 @@ -package v3io - -import ( - "github.com/valyala/fasthttp" -) - -func allocateResponse() *Response { - return &Response{ - response: fasthttp.AcquireResponse(), - } -} diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index a07ee49ea39..4bb86aa0fe5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -994,6 +994,20 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) } +// SetsockoptSockFprog attaches a classic BPF or an extended BPF program to a +// socket to filter incoming packets. See 'man 7 socket' for usage information. +func SetsockoptSockFprog(fd, level, opt int, fprog *SockFprog) error { + return setsockopt(fd, level, opt, unsafe.Pointer(fprog), unsafe.Sizeof(*fprog)) +} + +func SetsockoptCanRawFilter(fd, level, opt int, filter []CanFilter) error { + var p unsafe.Pointer + if len(filter) > 0 { + p = unsafe.Pointer(&filter[0]) + } + return setsockopt(fd, level, opt, p, uintptr(len(filter)*SizeofCanFilter)) +} + // Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html) // KeyctlInt calls keyctl commands in which each argument is an int. diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index d262150cc08..3e9c18e6814 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -405,6 +405,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -434,6 +439,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index e492caacda5..14365ff6cf3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -406,6 +406,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -435,6 +440,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index ad4342156e6..80ad473c614 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -409,6 +409,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -438,6 +443,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index ef76a362d9c..20e78cc1f6d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -407,6 +407,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -436,6 +441,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index dbf05903d42..bdeb0cb24f6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -408,6 +408,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -437,6 +442,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 1b7e6707934..2d3f5911290 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -407,6 +407,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -436,6 +441,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 57379005b58..5fb57ff2a38 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -407,6 +407,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -436,6 +441,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 0e88bf47bcd..b46b26f6ce1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -408,6 +408,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -437,6 +442,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 5ac91b3f7aa..e14e3c90abf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -408,6 +408,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -437,6 +442,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 1e59b45068c..2332e8fd126 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -408,6 +408,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -437,6 +442,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 508885f11f0..efec4f8193b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -407,6 +407,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -436,6 +441,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index d315f2c3a7a..71cc23f2e13 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -406,6 +406,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -435,6 +440,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index a1a9279c225..48805ba1952 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -410,6 +410,11 @@ type TCPInfo struct { Total_retrans uint32 } +type CanFilter struct { + Id uint32 + Mask uint32 +} + const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c @@ -439,6 +444,7 @@ const ( SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0x68 + SizeofCanFilter = 0x8 ) const ( diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 4f17a3331fd..9f946da6fe5 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -149,7 +149,7 @@ const ( DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = 0x22b DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = 0x22c DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = 0x22d - DOMAIN_ALIAS_RID_MONITORING_USERS = 0X22e + DOMAIN_ALIAS_RID_MONITORING_USERS = 0x22e DOMAIN_ALIAS_RID_LOGGING_USERS = 0x22f DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = 0x230 DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = 0x231 diff --git a/vendor/modules.txt b/vendor/modules.txt index 509efc6acf6..5cd3a4e218a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -201,9 +201,9 @@ github.com/klauspost/compress/zlib github.com/klauspost/cpuid # github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 github.com/kr/logfmt -# github.com/mattn/go-colorable v0.0.9 +# github.com/mattn/go-colorable v0.1.1 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.4 +# github.com/mattn/go-isatty v0.0.5 github.com/mattn/go-isatty # github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/matttproud/golang_protobuf_extensions/pbutil @@ -219,6 +219,8 @@ github.com/modern-go/concurrent github.com/modern-go/reflect2 # github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 github.com/mwitkow/go-conntrack +# github.com/nuclio/errors v0.0.1 +github.com/nuclio/errors # github.com/nuclio/logger v0.0.1 github.com/nuclio/logger # github.com/nuclio/zap v0.0.2 @@ -233,7 +235,7 @@ github.com/opentracing-contrib/go-stdlib/nethttp github.com/opentracing/opentracing-go github.com/opentracing/opentracing-go/log github.com/opentracing/opentracing-go/ext -# github.com/pavius/zap v0.0.0-20180228181622-8d52692529b8 +# github.com/pavius/zap v1.4.2-0.20180228181622-8d52692529b8 github.com/pavius/zap github.com/pavius/zap/zapcore github.com/pavius/zap/internal/bufferpool @@ -299,9 +301,11 @@ github.com/stretchr/testify/assert # github.com/v3io/frames v0.0.0-20190328123118-1dad1ff610509e7b087d9cd390ed1b452caecf15 => github.com/v3io/frames v0.0.0-20190328123118-1dad1ff610509e7b087d9cd390ed1b452caecf15 github.com/v3io/frames github.com/v3io/frames/pb -# github.com/v3io/v3io-go-http v0.0.0-20190221115935-53e2b487c9a2 -github.com/v3io/v3io-go-http -# github.com/v3io/v3io-tsdb v0.9.0 => github.com/v3io/v3io-tsdb v0.0.0-20190410160018-de081cf7a8519d2c67e31b6202046b1defa87559 +# github.com/v3io/v3io-go v0.0.0-20180415000000-1486c75b0e590a14580f7d9b6cef7a944a231ca7 +github.com/v3io/v3io-go/pkg/dataplane +github.com/v3io/v3io-go/pkg/errors +github.com/v3io/v3io-go/pkg/dataplane/http +# github.com/v3io/v3io-tsdb v0.9.2 github.com/v3io/v3io-tsdb/pkg/aggregate github.com/v3io/v3io-tsdb/pkg/appender github.com/v3io/v3io-tsdb/pkg/config @@ -315,7 +319,7 @@ github.com/v3io/v3io-tsdb/pkg/querier github.com/v3io/v3io-tsdb/pkg/tsdb/schema # github.com/valyala/bytebufferpool v1.0.0 github.com/valyala/bytebufferpool -# github.com/valyala/fasthttp v1.0.0 +# github.com/valyala/fasthttp v1.2.0 github.com/valyala/fasthttp github.com/valyala/fasthttp/fasthttputil github.com/valyala/fasthttp/stackless @@ -374,7 +378,7 @@ golang.org/x/oauth2/jwt # golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a +# golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.0