diff --git a/README.md b/README.md index 4161357d..71c04351 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# dispatch [![Build Status](https://travis-ci.org/khlieng/dispatch.svg?branch=master)](https://travis-ci.org/khlieng/dispatch) +# dispatch [![Build Status](https://travis-ci.com/khlieng/dispatch.svg?branch=master)](https://travis-ci.com/khlieng/dispatch) #### [Try it!](https://dispatch.khlieng.com) diff --git a/client/package.json b/client/package.json index 201dc722..8457a7f8 100644 --- a/client/package.json +++ b/client/package.json @@ -62,7 +62,7 @@ "workbox-webpack-plugin": "^5.1.3" }, "dependencies": { - "@sindresorhus/fnv1a": "^2.0.1", + "@sindresorhus/fnv1a": "^1.2.0", "autolinker": "^3.14.1", "backo": "^1.1.0", "classnames": "^2.2.6", diff --git a/client/yarn.lock b/client/yarn.lock index e4c05046..3d8b13e3 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1804,9 +1804,10 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@sindresorhus/fnv1a@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@sindresorhus/fnv1a/-/fnv1a-2.0.1.tgz#2aefdfa7eb5b7f29a7936978218e986c70c603fc" +"@sindresorhus/fnv1a@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/fnv1a/-/fnv1a-1.2.0.tgz#d554da64c406f3b62ad06dfce9efd537a4a55de4" + integrity sha512-5ezb/dBSTWtKQ4sLQwMgOJyREXJcZZkTMbendMwKrXTghUhWjZhstzkkmt4/WkFy/GSTSGzfJOKU7dEXv3C/XQ== "@sinonjs/commons@^1.7.0": version "1.7.2" @@ -2649,8 +2650,9 @@ bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== bn.js@^5.1.1: version "5.1.1" @@ -2707,6 +2709,7 @@ braces@^3.0.1: brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= brotli@^1.3.1: version "1.3.2" @@ -3874,8 +3877,9 @@ electron-to-chromium@^1.3.413: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.430.tgz#33914f7c2db771bdcf30977bd4fd6258ee8a2f37" elliptic@^6.0.0, elliptic@^6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" + version "6.5.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -5123,6 +5127,7 @@ hash-base@^3.0.0: hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" minimalistic-assert "^1.0.1" @@ -5141,6 +5146,7 @@ history@^5.0.0-beta.8: hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -6489,8 +6495,9 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" @@ -6691,10 +6698,12 @@ mini-css-extract-plugin@^0.9.0: minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= minimatch@^3.0.4: version "3.0.4" diff --git a/go.sum b/go.sum index 9378a3b1..695a7c8e 100644 --- a/go.sum +++ b/go.sum @@ -146,24 +146,18 @@ github.com/eyedeekay/ramp v0.0.0-20190429201811-305b382042ab/go.mod h1:h7mvUAMgZ github.com/eyedeekay/sam3 v0.32.2/go.mod h1:Y3igFVzN4ybqkkpfUWULGhw7WRp8lieq0ORXbLBbcZM= github.com/eyedeekay/sam3 v0.32.3 h1:PW1vQoo2H7c3Q4l2DngJqpSdsdJprMCk9NOkUHtcdmM= github.com/eyedeekay/sam3 v0.32.3/go.mod h1:qRA9KIIVxbrHlkj+ZB+OoxFGFgdKeGp1vSgPw26eOVU= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 h1:Ujru1hufTHVb++eG6OuNDKMxZnGIvF6o/u8q/8h2+I4= github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a h1:FQqoVvjbiUioBBFUL5up+h+GdCa/AnJsL/1bIs/veSI= github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-acme/lego/v3 v3.7.0 h1:qC5/8/CbltyAE8fGLE6bGlqucj7pXc/vBxiLwLOsmAQ= github.com/go-acme/lego/v3 v3.7.0/go.mod h1:4eDjjYkAsDXyNcwN8IhhZAwxz9Ltiks1Zmpv0q20J7A= @@ -192,9 +186,7 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= 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= @@ -203,12 +195,10 @@ github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi 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 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= 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-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -217,7 +207,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ 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 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -233,12 +222,10 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -268,7 +255,6 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO 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 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= @@ -276,7 +262,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= -github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -288,7 +273,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -296,28 +280,22 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kjk/betterguid v0.0.0-20170621091430-c442874ba63a h1:b+Gt8sQs//Sl5Dcem5zP9Qc2FgEUAygREa2AAa2Vmcw= github.com/kjk/betterguid v0.0.0-20170621091430-c442874ba63a/go.mod h1:uxRAhHE1nl34DpWgfe0CYbNYbCnYplaB6rZH9ReWtUk= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.3.0 h1:2JqaNE1hGdABW2YbA3TenkO7RiPFRvSWnEnGqWh9sHE= github.com/klauspost/cpuid v1.3.0/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= -github.com/kljensen/snowball v0.6.0 h1:6DZLCcZeL0cLfodx+Md4/OLC6b/bfurWUOUGs1ydfOU= github.com/kljensen/snowball v0.6.0/go.mod h1:27N7E8fVU5H68RlUmnWwZCfxgt4POBJfENGMvNRhldw= github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= 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.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA= github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -343,7 +321,6 @@ github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaC 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 v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -351,7 +328,6 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= @@ -364,21 +340,15 @@ github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2 github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= @@ -414,7 +384,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20190512091148-babf20351dd7 h1:FUL3b97ZY2EPqg2NbXKuMHs5pXJB9hjj1fDHnF2vl28= github.com/remyoudompheng/bigfft v0.0.0-20190512091148-babf20351dd7/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= 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= @@ -427,35 +396,27 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= 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.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= @@ -463,28 +424,21 @@ github.com/steveyen/gtreap v0.1.0 h1:CjhzTa274PyJLJuMZwIzCO1PfC00oRa8d1Kc78bFXJM github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y= 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 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/tdewolff/minify/v2 v2.7.6 h1:b6UzNphZeDm3AVmk0a69orkNLPJzJx3k/AQ/W2xoMs8= github.com/tdewolff/minify/v2 v2.7.6/go.mod h1:Mt3hGbK/ETDplEP9EMNZo1lPkM3TZq0rDIVV76nFgY0= github.com/tdewolff/parse/v2 v2.4.3 h1:k24zHgTRGm7LkvbTEreuavyZTf0k8a/lIenggv62OiU= github.com/tdewolff/parse/v2 v2.4.3/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho= -github.com/tdewolff/test v1.0.6 h1:76mzYJQ83Op284kMT+63iCNCI7NEERsIN8dLM+RiKr4= github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= -github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= @@ -500,7 +454,6 @@ github.com/willf/bitset v1.1.10 h1:NotGKqX0KwQ72NUzqrjZq5ipPNDQex9lo3WpaS8L2sc= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xdg-go/scram v0.0.0-20180814205039-7eeb5667e42c h1:Wm21TPasVdeOUTg1m/uNkRdMuvI+jIeYfTIwq98Z2V0= github.com/xdg-go/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:FV1RpvYFmF8wnKtr3ArzkC0b+tAySCbw8eP7QSIvLKM= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= @@ -509,7 +462,6 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -527,16 +479,13 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/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-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= 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-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -578,7 +527,6 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r 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-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/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= @@ -605,15 +553,11 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= 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 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= 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 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -655,7 +599,6 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200610111108-226ff32320da h1:bGb80FudwxpeucJUjPYJXuJ8Hk91vNtfvrymzwiei38= golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -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/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -701,7 +644,6 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -752,45 +694,34 @@ google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLY 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 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= 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 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= 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 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw= gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 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 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 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.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/eyedeekay/goSam/.gitignore b/vendor/github.com/eyedeekay/goSam/.gitignore new file mode 100644 index 00000000..b0e54296 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +itp-golang-github-eyedeekay-gosam.txt +.pc +deb/ diff --git a/vendor/github.com/eyedeekay/goSam/CONTRIBUTING.md b/vendor/github.com/eyedeekay/goSam/CONTRIBUTING.md new file mode 100644 index 00000000..6df463c6 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/CONTRIBUTING.md @@ -0,0 +1,195 @@ +How to make contributions to goSam +================================== + +Welcome to goSam, the easy-to-use http client for i2p. We're glad you're here +and interested in contributing. Here's some help getting started. + +Table of Contents +----------------- + + * (1) Environment + * (2) Testing + * (3) Filing Issues/Reporting Bugs/Making Suggestions + * (4) Contributing Code/Style Guide + - (a) Adding i2cp and tunnel Options + - (b) Writing Tests + - (c) Style + - (d) Other kinds of modification? + * (5) Conduct + +### (1) Environment + +goSam is a simple go library. You are free to use an IDE if you wish, but all +that is required to build and test the library are a go compiler and the gofmt +tool. Git is the version control system. All the files in the library are in a +single root directory. Invoking go build from this directory not generate any +files. + +### (2) Testing + +Tests are implemented using the standard go "testing" library in files named +"file\_test.go," so tests of the client go in client\_test.go, name lookups +in naming\_test.go, et cetera. Everything that can be tested, should be tested. + +Testing is done by running + + go test + +More information about designing tests is below in the +**Contributing Code/Style Guide** section below. + +### (3) Filing issues/Reporting bugs/Making suggestions + +If you discover the library doing something you don't think is right, please let +us know! Just filing an issue here is OK. + +If you need to suggest a feature, we're happy to hear from you too. Filing an +issue will give us a place to discuss how it's implemented openly and publicly. + +Please file an issue for your new code contributions in order to provide us with +a place to discuss them for inclusion. + +### (4) Contributing Code/Style Guide + +Welcome new coders. We have good news for you, this library is really easy to +contribute to. The easiest contributions take the form of i2cp and tunnel +options. + +#### (a) Adding i2cp and tunnel Options + +First, add a variable to store the state of your new option. For example, the +existing variables are in the Client class [here:](https://github.com/cryptix/goSam/blob/701d7fcf03ddb354262fe213163dcf6f202a24f1/client.go#L29) + +i2cp and tunnel options are added in a highly uniform process of basically three +steps. First, you create a functional argument in the options.go file, in the +form: + +``` Go + // SetOPTION sets $OPTION + func SetOPTION(arg type) func(*Client) error { // arg type + return func(c *Client) error { // pass a client to the inner function and declare error return function + if arg == valid { // validate the argument + c.option = s // set the variable to the argument value + return nil // if option is set successfully return nil error + } + return fmt.Errorf("Invalid argument:" arg) // return a descriptive error if arg is invalid + } + } +``` + +[example](https://github.com/cryptix/goSam/blob/701d7fcf03ddb354262fe213163dcf6f202a24f1/options.go#L187) + +Next, you create a getter which prepares the option. Regardless of the type of +option that is set, these must return strings representing valid i2cp options. + +``` Go + //return the OPTION as a string. + func (c *Client) option() string { + return fmt.Sprintf("i2cp.option=%d", c.option) + } +``` + +[example](https://github.com/cryptix/goSam/blob/701d7fcf03ddb354262fe213163dcf6f202a24f1/options.go#L299) + +Lastly, you'll need to add it to the allOptions function and the +Client.NewClient() function. To add it to allOptions, it looks like this: + +``` Go + //return all options as string ready for passing to sendcmd + func (c *Client) allOptions() string { + return c.inlength() + " " + + c.outlength() + " " + + ... //other options removed from example for brevity + c.option() + } +``` + +``` Go + //return all options as string ready for passing to sendcmd + func (c *Client) NewClient() (*Client, error) { + return NewClientFromOptions( + SetHost(c.host), + SetPort(c.port), + ... //other options removed from example for brevity + SetCompression(c.compression), + setlastaddr(c.lastaddr), + setid(c.id), + ) + } +``` + +[example](https://github.com/cryptix/goSam/blob/701d7fcf03ddb354262fe213163dcf6f202a24f1/options.go#L333) + +#### (b) Writing Tests + +Before the feature can be added, you'll need to add a test for it to +options_test.go. To do this, just add your new option to the long TestOptions +functions in options_test.go. + +``` Go + func TestOptionHost(t *testing.T) { + client, err := NewClientFromOptions( + SetHost("127.0.0.1"), + SetPort("7656"), + ... //other options removed from example for brevity + SetCloseIdleTime(300001), + ) + if err != nil { + t.Fatalf("NewClientFromOptions() Error: %q\n", err) + } + if result, err := client.validCreate(); err != nil { + t.Fatalf(err.Error()) + } else { + t.Log(result) + } + client.CreateStreamSession("") + if err := client.Close(); err != nil { + t.Fatalf("client.Close() Error: %q\n", err) + } + } + + func TestOptionPortInt(t *testing.T) { + client, err := NewClientFromOptions( + SetHost("127.0.0.1"), + SetPortInt(7656), + ... //other options removed from example for brevity + SetUnpublished(true), + ) + if err != nil { + t.Fatalf("NewClientFromOptions() Error: %q\n", err) + } + if result, err := client.validCreate(); err != nil { + t.Fatalf(err.Error()) + } else { + t.Log(result) + } + client.CreateStreamSession("") + if err := client.Close(); err != nil { + t.Fatalf("client.Close() Error: %q\n", err) + } + } + +``` + +If any of these tasks fail, then the test should fail. + +#### (c) Style + +It's pretty simple to make sure the code style is right, just run gofmt over it +to adjust the indentation, and golint over it to ensure that your comments are +of the correct form for the documentation generator. + +#### (d) Other kinds of modification? + +It may be useful to extend goSam in other ways. Since there's not a +one-size-fits-all uniform way of dealing with these kinds of changes, open an +issue for discussion and + +### (5) Conduct + +This is a small-ish, straightforward library intended to enable a clear +technical task. We should be able to be civil with eachother, and give and +accept criticism contructively and respectfully. + +This document was drawn from the examples given by Mozilla +[here](mozillascience.github.io/working-open-workshop/contributing/) diff --git a/vendor/github.com/eyedeekay/goSam/LICENSE b/vendor/github.com/eyedeekay/goSam/LICENSE new file mode 100644 index 00000000..e870cb4c --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Henry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/vendor/github.com/eyedeekay/goSam/Makefile b/vendor/github.com/eyedeekay/goSam/Makefile new file mode 100644 index 00000000..94fdae3f --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/Makefile @@ -0,0 +1,27 @@ + +USER_GH=eyedeekay +VERSION=0.32.27 +packagename=gosam + +echo: fmt + @echo "type make version to do release $(VERSION)" + +version: + gothub release -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(packagename) -t v$(VERSION) -d "version $(VERSION)" + +del: + gothub delete -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(packagename) -t v$(VERSION) + +tar: + tar --exclude .git \ + --exclude .go \ + --exclude bin \ + --exclude examples \ + -cJvf ../$(packagename)_$(VERSION).orig.tar.xz . + +link: + rm -f ../goSam + ln -sf . ../goSam + +fmt: + gofmt -w -s *.go */*.go diff --git a/vendor/github.com/eyedeekay/goSam/README.md b/vendor/github.com/eyedeekay/goSam/README.md new file mode 100644 index 00000000..5fae8727 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/README.md @@ -0,0 +1,93 @@ +goSam +===== + +A go library for using the [I2P](https://geti2p.net/en/) Simple Anonymous +Messaging ([SAM version 3.0](https://geti2p.net/en/docs/api/samv3)) bridge. It +has support for SAM version 3.1 signature types. + +This is in an **early development stage**. I would love to hear about any +issues or ideas for improvement. + +## Installation +``` +go get github.com/eyedeekay/goSam +``` + +## Using it for HTTP Transport + +I implemented `Client.Dial` like `net.Dial` so you can use go's library packages like http. + +```go +package main + +import ( + "io" + "log" + "net/http" + "os" + + "github.com/cryptix/goSam" +) + +func main() { + // create a default sam client + sam, err := goSam.NewDefaultClient() + checkErr(err) + + log.Println("Client Created") + + // create a transport that uses SAM to dial TCP Connections + tr := &http.Transport{ + Dial: sam.Dial, + } + + // create a client using this transport + client := &http.Client{Transport: tr} + + // send a get request + resp, err := client.Get("http://stats.i2p/") + checkErr(err) + defer resp.Body.Close() + + log.Printf("Get returned %+v\n", resp) + + // create a file for the response + file, err := os.Create("stats.html") + checkErr(err) + defer file.Close() + + // copy the response to the file + _, err = io.Copy(file, resp.Body) + checkErr(err) + + log.Println("Done.") +} + +func checkErr(err error) { + if err != nil { + log.Fatal(err) + } +} +``` + +### .deb package + +A package for installing this on Debian is buildable, and a version for Ubuntu +is available as a PPA and mirrored via i2p. To build the deb package, from the +root of this repository with the build dependencies installed(git, i2p, go, +debuild) run the command + + debuild -us -uc + +to produce an unsigned deb for personal use only. For packagers, + + debuild -S + +will produce a viable source package for use with Launchpad PPA's and other +similar systems. +### TODO + +* Improve recovery on failed sockets +* Implement `STREAM FORWARD` +* Implement datagrams (Repliable and Anon) + diff --git a/vendor/github.com/eyedeekay/goSam/accept.go b/vendor/github.com/eyedeekay/goSam/accept.go new file mode 100644 index 00000000..4c4dba3d --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/accept.go @@ -0,0 +1,63 @@ +package goSam + +import ( + "fmt" + "net" +) + +// AcceptI2P creates a new Client and accepts a connection on it +func (c *Client) AcceptI2P() (net.Conn, error) { + listener, err := c.Listen() + if err != nil { + return nil, err + } + return listener.Accept() +} + +// Listen creates a new Client and returns a net.listener which *must* be started +// with Accept +func (c *Client) Listen() (net.Listener, error) { + return c.ListenI2P(c.destination) +} + +// ListenI2P creates a new Client and returns a net.listener which *must* be started +// with Accept +func (c *Client) ListenI2P(dest string) (net.Listener, error) { + var err error + c.id = c.NewID() + c.destination, err = c.CreateStreamSession(c.id, dest) + d := c.destination + if err != nil { + return nil, err + } + fmt.Println("Listening on destination:", c.Base32()+".b32.i2p") + + c, err = c.NewClient() + if err != nil { + return nil, err + } + c.destination = d + + if c.debug { + c.SamConn = WrapConn(c.SamConn) + } + + return c, nil +} + +// Accept accepts a connection on a listening goSam.Client(Implements net.Listener) +// or, if the connection isn't listening yet, just calls AcceptI2P for compatibility +// with older versions. +func (c *Client) Accept() (net.Conn, error) { + if c.id == 0 { + return c.AcceptI2P() + } + resp, err := c.StreamAccept(c.id) + if err != nil { + return nil, err + } + + fmt.Println("Accept Resp:", resp) + + return c.SamConn, nil +} diff --git a/vendor/github.com/eyedeekay/goSam/client.go b/vendor/github.com/eyedeekay/goSam/client.go new file mode 100644 index 00000000..cafd1958 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/client.go @@ -0,0 +1,243 @@ +package goSam + +import ( + "bufio" + "crypto/sha256" + "encoding/base32" + "encoding/base64" + "encoding/binary" + "fmt" + "math" + "math/rand" + "net" + "strings" + "sync" +) + +// A Client represents a single Connection to the SAM bridge +type Client struct { + host string + port string + fromport string + toport string + + SamConn net.Conn + rd *bufio.Reader + + sigType string + destination string + + inLength uint + inVariance int + inQuantity uint + inBackups uint + + outLength uint + outVariance int + outQuantity uint + outBackups uint + + dontPublishLease bool + encryptLease bool + leaseSetEncType string + + reduceIdle bool + reduceIdleTime uint + reduceIdleQuantity uint + + closeIdle bool + closeIdleTime uint + + compression bool + + debug bool + //NEVER, EVER modify lastaddr or id yourself. They are used internally only. + lastaddr string + id int32 + ml sync.Mutex +} + +var SAMsigTypes = []string{ + "SIGNATURE_TYPE=DSA_SHA1", + "SIGNATURE_TYPE=ECDSA_SHA256_P256", + "SIGNATURE_TYPE=ECDSA_SHA384_P384", + "SIGNATURE_TYPE=ECDSA_SHA512_P521", + "SIGNATURE_TYPE=EdDSA_SHA512_Ed25519", +} + +var ( + i2pB64enc *base64.Encoding = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~") + i2pB32enc *base32.Encoding = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567") +) + +// NewDefaultClient creates a new client, connecting to the default host:port at localhost:7656 +func NewDefaultClient() (*Client, error) { + return NewClient("localhost:7656") +} + +// NewClient creates a new client, connecting to a specified port +func NewClient(addr string) (*Client, error) { + return NewClientFromOptions(SetAddr(addr)) +} + +// NewID generates a random number to use as an tunnel name +func (c *Client) NewID() int32 { + return rand.Int31n(math.MaxInt32) +} + +// Destination returns the full destination of the local tunnel +func (c *Client) Destination() string { + return c.destination +} + +// Base32 returns the base32 of the local tunnel +func (c *Client) Base32() string { + // hash := sha256.New() + b64, err := i2pB64enc.DecodeString(c.Base64()) + if err != nil { + return "" + } + //hash.Write([]byte(b64)) + var s []byte + for _, e := range sha256.Sum256(b64) { + s = append(s, e) + } + return strings.ToLower(strings.Replace(i2pB32enc.EncodeToString(s), "=", "", -1)) +} + +func (c *Client) base64() []byte { + if c.destination != "" { + s, _ := i2pB64enc.DecodeString(c.destination) + alen := binary.BigEndian.Uint16(s[385:387]) + return s[:387+alen] + } + return []byte("") +} + +// Base64 returns the base64 of the local tunnel +func (c *Client) Base64() string { + return i2pB64enc.EncodeToString(c.base64()) +} + +// NewClientFromOptions creates a new client, connecting to a specified port +func NewClientFromOptions(opts ...func(*Client) error) (*Client, error) { + var c Client + c.host = "127.0.0.1" + c.port = "7656" + c.inLength = 3 + c.inVariance = 0 + c.inQuantity = 1 + c.inBackups = 1 + c.outLength = 3 + c.outVariance = 0 + c.outQuantity = 1 + c.outBackups = 1 + c.dontPublishLease = true + c.encryptLease = false + c.reduceIdle = false + c.reduceIdleTime = 300000 + c.reduceIdleQuantity = 1 + c.closeIdle = true + c.closeIdleTime = 600000 + c.debug = true + c.sigType = SAMsigTypes[4] + c.id = 0 + c.lastaddr = "invalid" + c.destination = "" + c.leaseSetEncType = "4,0" + c.fromport = "" + c.toport = "" + for _, o := range opts { + if err := o(&c); err != nil { + return nil, err + } + } + conn, err := net.Dial("tcp", c.samaddr()) + if err != nil { + return nil, err + } + if c.debug { + conn = WrapConn(conn) + } + c.SamConn = conn + c.rd = bufio.NewReader(conn) + return &c, c.hello() +} + +func (p *Client) ID() string { + return fmt.Sprintf("%d", p.id) +} + +func (p *Client) Addr() net.Addr { + return nil +} + +//return the combined host:port of the SAM bridge +func (c *Client) samaddr() string { + return fmt.Sprintf("%s:%s", c.host, c.port) +} + +// send the initial handshake command and check that the reply is ok +func (c *Client) hello() error { + r, err := c.sendCmd("HELLO VERSION MIN=3.0 MAX=3.2\n") + if err != nil { + return err + } + + if r.Topic != "HELLO" { + return fmt.Errorf("Client Hello Unknown Reply: %+v\n", r) + } + + if r.Pairs["RESULT"] != "OK" { + return fmt.Errorf("Handshake did not succeed\nReply:%+v\n", r) + } + + return nil +} + +// helper to send one command and parse the reply by sam +func (c *Client) sendCmd(str string, args ...interface{}) (*Reply, error) { + if _, err := fmt.Fprintf(c.SamConn, str, args...); err != nil { + return nil, err + } + + line, err := c.rd.ReadString('\n') + if err != nil { + return nil, err + } + + return parseReply(line) +} + +// Close the underlying socket to SAM +func (c *Client) Close() error { + c.rd = nil + return c.SamConn.Close() +} + +// NewClient generates an exact copy of the client with the same options +func (c *Client) NewClient() (*Client, error) { + return NewClientFromOptions( + SetHost(c.host), + SetPort(c.port), + SetDebug(c.debug), + SetInLength(c.inLength), + SetOutLength(c.outLength), + SetInVariance(c.inVariance), + SetOutVariance(c.outVariance), + SetInQuantity(c.inQuantity), + SetOutQuantity(c.outQuantity), + SetInBackups(c.inBackups), + SetOutBackups(c.outBackups), + SetUnpublished(c.dontPublishLease), + SetEncrypt(c.encryptLease), + SetReduceIdle(c.reduceIdle), + SetReduceIdleTime(c.reduceIdleTime), + SetReduceIdleQuantity(c.reduceIdleQuantity), + SetCloseIdle(c.closeIdle), + SetCloseIdleTime(c.closeIdleTime), + SetCompression(c.compression), + setlastaddr(c.lastaddr), + setid(c.id), + ) +} diff --git a/vendor/github.com/eyedeekay/goSam/conn.go b/vendor/github.com/eyedeekay/goSam/conn.go new file mode 100644 index 00000000..798bb953 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/conn.go @@ -0,0 +1,68 @@ +/* +The MIT License (MIT) + +Copyright (c) 2014 Henry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package goSam + +import ( + "log" + "net" + "time" +) + +type Conn struct { + RWC + conn net.Conn +} + +func WrapConn(c net.Conn) *Conn { + wrap := Conn{ + conn: c, + } + wrap.Reader = NewReadLogger("<", c) + wrap.Writer = NewWriteLogger(">", c) + wrap.RWC.c = c + return &wrap +} + +func (c *Conn) LocalAddr() net.Addr { + return c.conn.LocalAddr() +} + +func (c *Conn) RemoteAddr() net.Addr { + return c.conn.RemoteAddr() +} + +func (c *Conn) SetDeadline(t time.Time) error { + log.Println("WARNING: SetDeadline() not sure this works") + return c.conn.SetDeadline(t) +} + +func (c *Conn) SetReadDeadline(t time.Time) error { + log.Println("WARNING: SetReadDeadline() not sure this works") + return c.conn.SetReadDeadline(t) +} +func (c *Conn) SetWriteDeadline(t time.Time) error { + log.Println("WARNING: SetWriteDeadline() not sure this works") + return c.conn.SetWriteDeadline(t) +} diff --git a/vendor/github.com/eyedeekay/goSam/dial.go b/vendor/github.com/eyedeekay/goSam/dial.go new file mode 100644 index 00000000..7bd9dac7 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/dial.go @@ -0,0 +1,75 @@ +package goSam + +import ( + "context" + "fmt" + "net" + "strings" +) + +// DialContext implements the net.DialContext function and can be used for http.Transport +func (c *Client) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { + errCh := make(chan error, 1) + connCh := make(chan net.Conn, 1) + go func() { + if conn, err := c.Dial(network, addr); err != nil { + errCh <- err + } else if ctx.Err() != nil { + conn.Close() + } else { + connCh <- conn + } + }() + select { + case err := <-errCh: + return nil, err + case conn := <-connCh: + return conn, nil + case <-ctx.Done(): + return nil, ctx.Err() + } +} + +func (c *Client) dialCheck(addr string) (int32, bool) { + if c.lastaddr == "invalid" { + fmt.Println("Preparing to dial new address.") + return c.NewID(), true + } else if c.lastaddr != addr { + fmt.Println("Preparing to dial next new address.") + return c.NewID(), true + } + return c.id, false +} + +// Dial implements the net.Dial function and can be used for http.Transport +func (c *Client) Dial(network, addr string) (net.Conn, error) { + c.ml.Lock() + defer c.ml.Unlock() + portIdx := strings.Index(addr, ":") + if portIdx >= 0 { + addr = addr[:portIdx] + } + addr, err := c.Lookup(addr) + if err != nil { + return nil, err + } + + var test bool + if c.id, test = c.dialCheck(addr); test == true { + c.destination, err = c.CreateStreamSession(c.id, c.destination) + if err != nil { + return nil, err + } + c.lastaddr = addr + } + c, err = c.NewClient() + if err != nil { + return nil, err + } + + err = c.StreamConnect(c.id, addr) + if err != nil { + return nil, err + } + return c.SamConn, nil +} diff --git a/vendor/github.com/eyedeekay/goSam/go.mod b/vendor/github.com/eyedeekay/goSam/go.mod new file mode 100644 index 00000000..159bc0aa --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/go.mod @@ -0,0 +1,11 @@ +module github.com/eyedeekay/goSam + +require github.com/eyedeekay/sam3 v0.32.2 + +//replace github.com/eyedeekay/gosam v0.1.1-0.20190814195658-27e786578944 => github.com/eyedeekay/goSam ./ + +replace github.com/eyedeekay/gosam v0.32.1 => ./ + +replace github.com/eyedeekay/goSam v0.32.1 => ./ + +go 1.13 diff --git a/vendor/github.com/eyedeekay/goSam/go.sum b/vendor/github.com/eyedeekay/goSam/go.sum new file mode 100644 index 00000000..6f9cf05b --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/go.sum @@ -0,0 +1,3 @@ +github.com/eyedeekay/ramp v0.0.0-20190429201811-305b382042ab/go.mod h1:h7mvUAMgZ/rtRDUOkvKTK+8LnDMeUhJSoa5EPdB51fc= +github.com/eyedeekay/sam3 v0.32.2 h1:xODDY5nBVg0oK7KaYk7ofkXFoHPsmI1umhSv1TZlS7s= +github.com/eyedeekay/sam3 v0.32.2/go.mod h1:Y3igFVzN4ybqkkpfUWULGhw7WRp8lieq0ORXbLBbcZM= diff --git a/vendor/github.com/eyedeekay/goSam/naming.go b/vendor/github.com/eyedeekay/goSam/naming.go new file mode 100644 index 00000000..e1d68e70 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/naming.go @@ -0,0 +1,73 @@ +package goSam + +import ( + "context" + "fmt" + "io" + "net" + "os" +) + +// Lookup askes SAM for the internal i2p address from name +func (c *Client) Lookup(name string) (string, error) { + r, err := c.sendCmd("NAMING LOOKUP NAME=%s\n", name) + if err != nil { + return "", nil + } + + // TODO: move check into sendCmd() + if r.Topic != "NAMING" || r.Type != "REPLY" { + return "", fmt.Errorf("Naming Unknown Reply: %+v\n", r) + } + + result := r.Pairs["RESULT"] + if result != "OK" { + return "", ReplyError{result, r} + } + + if r.Pairs["NAME"] != name { + // somehow different on i2pd + if r.Pairs["NAME"] != "ME" { + return "", fmt.Errorf("Lookup() Replyed to another name.\nWanted:%s\nGot: %+v\n", name, r) + } + fmt.Fprintln(os.Stderr, "WARNING: Lookup() Replyed to another name. assuming i2pd c++ fluke") + } + + return r.Pairs["VALUE"], nil +} + +func (c *Client) forward(client, conn net.Conn) { + go func() { + defer client.Close() + defer conn.Close() + io.Copy(client, conn) + }() + go func() { + defer client.Close() + defer conn.Close() + io.Copy(conn, client) + }() +} + +func (c *Client) Resolve(ctx context.Context, name string) (context.Context, net.IP, error) { + if c.lastaddr == "invalid" || c.lastaddr != name { + client, err := c.DialContext(ctx, "", name) + if err != nil { + return ctx, nil, err + } + ln, err := net.Listen("tcp", "127.0.0.1:") + if err != nil { + return ctx, nil, err + } + go func() { + for { + conn, err := ln.Accept() + if err != nil { + fmt.Println(err.Error()) + } + go c.forward(client, conn) + } + }() + } + return ctx, nil, nil +} diff --git a/vendor/github.com/eyedeekay/goSam/options.go b/vendor/github.com/eyedeekay/goSam/options.go new file mode 100644 index 00000000..b812d45b --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/options.go @@ -0,0 +1,525 @@ +package goSam + +import ( + "fmt" + "strconv" + "strings" +) + +//Option is a client Option +type Option func(*Client) error + +//SetAddr sets a clients's address in the form host:port or host, port +func SetAddr(s ...string) func(*Client) error { + return func(c *Client) error { + if len(s) == 1 { + split := strings.SplitN(s[0], ":", 2) + if len(split) == 2 { + if i, err := strconv.Atoi(split[1]); err == nil { + if i < 65536 { + c.host = split[0] + c.port = split[1] + return nil + } + return fmt.Errorf("Invalid port") + } + return fmt.Errorf("Invalid port; non-number") + } + return fmt.Errorf("Invalid address; use host:port %s", split) + } else if len(s) == 2 { + if i, err := strconv.Atoi(s[1]); err == nil { + if i < 65536 { + c.host = s[0] + c.port = s[1] + return nil + } + return fmt.Errorf("Invalid port") + } + return fmt.Errorf("Invalid port; non-number") + } else { + return fmt.Errorf("Invalid address") + } + } +} + +//SetAddrMixed sets a clients's address in the form host, port(int) +func SetAddrMixed(s string, i int) func(*Client) error { + return func(c *Client) error { + if i < 65536 && i > 0 { + c.host = s + c.port = strconv.Itoa(i) + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetHost sets the host of the client's SAM bridge +func SetHost(s string) func(*Client) error { + return func(c *Client) error { + c.host = s + return nil + } +} + +//SetLocalDestination sets the local destination of the tunnel from a private +//key +func SetLocalDestination(s string) func(*Client) error { + return func(c *Client) error { + c.destination = s + return nil + } +} + +func setlastaddr(s string) func(*Client) error { + return func(c *Client) error { + c.lastaddr = s + return nil + } +} + +func setid(s int32) func(*Client) error { + return func(c *Client) error { + c.id = s + return nil + } +} + +//SetPort sets the port of the client's SAM bridge using a string +func SetPort(s string) func(*Client) error { + return func(c *Client) error { + port, err := strconv.Atoi(s) + if err != nil { + return fmt.Errorf("Invalid port; non-number") + } + if port < 65536 && port > -1 { + c.port = s + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetPortInt sets the port of the client's SAM bridge using a string +func SetPortInt(i int) func(*Client) error { + return func(c *Client) error { + if i < 65536 && i > -1 { + c.port = strconv.Itoa(i) + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetFromPort sets the port of the client's SAM bridge using a string +func SetFromPort(s string) func(*Client) error { + return func(c *Client) error { + port, err := strconv.Atoi(s) + if err != nil { + return fmt.Errorf("Invalid port; non-number") + } + if port < 65536 && port > -1 { + c.fromport = s + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetFromPortInt sets the port of the client's SAM bridge using a string +func SetFromPortInt(i int) func(*Client) error { + return func(c *Client) error { + if i < 65536 && i > -1 { + c.fromport = strconv.Itoa(i) + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetToPort sets the port of the client's SAM bridge using a string +func SetToPort(s string) func(*Client) error { + return func(c *Client) error { + port, err := strconv.Atoi(s) + if err != nil { + return fmt.Errorf("Invalid port; non-number") + } + if port < 65536 && port > -1 { + c.toport = s + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetToPortInt sets the port of the client's SAM bridge using a string +func SetToPortInt(i int) func(*Client) error { + return func(c *Client) error { + if i < 65536 && i > -1 { + c.fromport = strconv.Itoa(i) + return nil + } + return fmt.Errorf("Invalid port") + } +} + +//SetDebug enables debugging messages +func SetDebug(b bool) func(*Client) error { + return func(c *Client) error { + c.debug = b + return nil + } +} + +//SetInLength sets the number of hops inbound +func SetInLength(u uint) func(*Client) error { + return func(c *Client) error { + if u < 7 { + c.inLength = u + return nil + } + return fmt.Errorf("Invalid inbound tunnel length") + } +} + +//SetOutLength sets the number of hops outbound +func SetOutLength(u uint) func(*Client) error { + return func(c *Client) error { + if u < 7 { + c.outLength = u + return nil + } + return fmt.Errorf("Invalid outbound tunnel length") + } +} + +//SetInVariance sets the variance of a number of hops inbound +func SetInVariance(i int) func(*Client) error { + return func(c *Client) error { + if i < 7 && i > -7 { + c.inVariance = i + return nil + } + return fmt.Errorf("Invalid inbound tunnel length") + } +} + +//SetOutVariance sets the variance of a number of hops outbound +func SetOutVariance(i int) func(*Client) error { + return func(c *Client) error { + if i < 7 && i > -7 { + c.outVariance = i + return nil + } + return fmt.Errorf("Invalid outbound tunnel variance") + } +} + +//SetInQuantity sets the inbound tunnel quantity +func SetInQuantity(u uint) func(*Client) error { + return func(c *Client) error { + if u <= 16 { + c.inQuantity = u + return nil + } + return fmt.Errorf("Invalid inbound tunnel quantity") + } +} + +//SetOutQuantity sets the outbound tunnel quantity +func SetOutQuantity(u uint) func(*Client) error { + return func(c *Client) error { + if u <= 16 { + c.outQuantity = u + return nil + } + return fmt.Errorf("Invalid outbound tunnel quantity") + } +} + +//SetInBackups sets the inbound tunnel backups +func SetInBackups(u uint) func(*Client) error { + return func(c *Client) error { + if u < 6 { + c.inBackups = u + return nil + } + return fmt.Errorf("Invalid inbound tunnel backup quantity") + } +} + +//SetOutBackups sets the inbound tunnel backups +func SetOutBackups(u uint) func(*Client) error { + return func(c *Client) error { + if u < 6 { + c.outBackups = u + return nil + } + return fmt.Errorf("Invalid outbound tunnel backup quantity") + } +} + +//SetUnpublished tells the router to not publish the client leaseset +func SetUnpublished(b bool) func(*Client) error { + return func(c *Client) error { + c.dontPublishLease = b + return nil + } +} + +//SetEncrypt tells the router to use an encrypted leaseset +func SetEncrypt(b bool) func(*Client) error { + return func(c *Client) error { + c.encryptLease = b + return nil + } +} + +//SetLeaseSetEncType tells the router to use an encrypted leaseset of a specific type. +//defaults to 4,0 +func SetLeaseSetEncType(b string) func(*Client) error { + return func(c *Client) error { + c.leaseSetEncType = b + return nil + } +} + +//SetReduceIdle sets the created tunnels to be reduced during extended idle time to avoid excessive resource usage +func SetReduceIdle(b bool) func(*Client) error { + return func(c *Client) error { + c.reduceIdle = b + return nil + } +} + +//SetReduceIdleTime sets time to wait before the tunnel quantity is reduced +func SetReduceIdleTime(u uint) func(*Client) error { + return func(c *Client) error { + if u > 299999 { + c.reduceIdleTime = u + return nil + } + return fmt.Errorf("Invalid reduce idle time %v", u) + } +} + +//SetReduceIdleQuantity sets number of tunnels to keep alive during an extended idle period +func SetReduceIdleQuantity(u uint) func(*Client) error { + return func(c *Client) error { + if u < 5 { + c.reduceIdleQuantity = u + return nil + } + return fmt.Errorf("Invalid reduced tunnel quantity %v", u) + } +} + +//SetCloseIdle sets the tunnels to close after a specific amount of time +func SetCloseIdle(b bool) func(*Client) error { + return func(c *Client) error { + c.closeIdle = b + return nil + } +} + +//SetCloseIdleTime sets the time in milliseconds to wait before closing tunnels +func SetCloseIdleTime(u uint) func(*Client) error { + return func(c *Client) error { + if u > 299999 { + c.closeIdleTime = u + return nil + } + return fmt.Errorf("Invalid close idle time %v", u) + } +} + +//SetCompression sets the tunnels to close after a specific amount of time +func SetCompression(b bool) func(*Client) error { + return func(c *Client) error { + c.compression = b + return nil + } +} + +/* SAM v 3.1 Options*/ + +//SetSignatureType tells gosam to pass SAM a signature_type parameter with one +// of the following values: +// "SIGNATURE_TYPE=DSA_SHA1", +// "SIGNATURE_TYPE=ECDSA_SHA256_P256", +// "SIGNATURE_TYPE=ECDSA_SHA384_P384", +// "SIGNATURE_TYPE=ECDSA_SHA512_P521", +// "SIGNATURE_TYPE=EdDSA_SHA512_Ed25519", +// or an empty string +func SetSignatureType(s string) func(*Client) error { + return func(c *Client) error { + if s == "" { + c.sigType = "" + return nil + } + for _, valid := range SAMsigTypes { + if s == valid { + c.sigType = valid + return nil + } + } + return fmt.Errorf("Invalid signature type specified at construction time") + } +} + +//return the from port as a string. +func (c *Client) from() string { + if c.fromport == "" { + return "" + } + return fmt.Sprintf(" FROM_PORT=%v ", c.fromport) +} + +//return the to port as a string. +func (c *Client) to() string { + if c.toport == "" { + return "" + } + return fmt.Sprintf(" TO_PORT=%v ", c.toport) +} + +//return the signature type as a string. +func (c *Client) sigtype() string { + return fmt.Sprintf(" %s ", c.sigType) +} + +//return the inbound length as a string. +func (c *Client) inlength() string { + return fmt.Sprintf(" inbound.length=%d ", c.inLength) +} + +//return the outbound length as a string. +func (c *Client) outlength() string { + return fmt.Sprintf(" outbound.length=%d ", c.outLength) +} + +//return the inbound length variance as a string. +func (c *Client) invariance() string { + return fmt.Sprintf(" inbound.lengthVariance=%d ", c.inVariance) +} + +//return the outbound length variance as a string. +func (c *Client) outvariance() string { + return fmt.Sprintf(" outbound.lengthVariance=%d ", c.outVariance) +} + +//return the inbound tunnel quantity as a string. +func (c *Client) inquantity() string { + return fmt.Sprintf(" inbound.quantity=%d ", c.inQuantity) +} + +//return the outbound tunnel quantity as a string. +func (c *Client) outquantity() string { + return fmt.Sprintf(" outbound.quantity=%d ", c.outQuantity) +} + +//return the inbound tunnel quantity as a string. +func (c *Client) inbackups() string { + return fmt.Sprintf(" inbound.backupQuantity=%d ", c.inQuantity) +} + +//return the outbound tunnel quantity as a string. +func (c *Client) outbackups() string { + return fmt.Sprintf(" outbound.backupQuantity=%d ", c.outQuantity) +} + +func (c *Client) encryptlease() string { + if c.encryptLease { + return " i2cp.encryptLeaseSet=true " + } + return " i2cp.encryptLeaseSet=false " +} + +func (c *Client) leasesetenctype() string { + if c.encryptLease { + return fmt.Sprintf(" i2cp.leaseSetEncType=%s ", c.leaseSetEncType) + } + return " i2cp.leaseSetEncType=4,0 " +} + +func (c *Client) dontpublishlease() string { + if c.dontPublishLease { + return " i2cp.dontPublishLeaseSet=true " + } + return " i2cp.dontPublishLeaseSet=false " +} + +func (c *Client) closeonidle() string { + if c.closeIdle { + return " i2cp.closeOnIdle=true " + } + return " i2cp.closeOnIdle=false " +} + +func (c *Client) closeidletime() string { + return fmt.Sprintf(" i2cp.closeIdleTime=%d ", c.closeIdleTime) +} + +func (c *Client) reduceonidle() string { + if c.reduceIdle { + return " i2cp.reduceOnIdle=true " + } + return " i2cp.reduceOnIdle=false " +} + +func (c *Client) reduceidletime() string { + return fmt.Sprintf(" i2cp.reduceIdleTime=%d ", c.reduceIdleTime) +} + +func (c *Client) reduceidlecount() string { + return fmt.Sprintf(" i2cp.reduceIdleQuantity=%d ", c.reduceIdleQuantity) +} + +func (c *Client) compresion() string { + if c.compression { + return " i2cp.gzip=true " + } + return " i2cp.gzip=false " +} + +//return all options as string ready for passing to sendcmd +func (c *Client) allOptions() string { + return c.inlength() + + c.outlength() + + c.invariance() + + c.outvariance() + + c.inquantity() + + c.outquantity() + + c.inbackups() + + c.outbackups() + + c.dontpublishlease() + + c.encryptlease() + + c.leasesetenctype() + + c.reduceonidle() + + c.reduceidletime() + + c.reduceidlecount() + + c.closeonidle() + + c.closeidletime() + + c.compresion() +} + +//Print return all options as string +func (c *Client) Print() string { + return c.inlength() + + c.outlength() + + c.invariance() + + c.outvariance() + + c.inquantity() + + c.outquantity() + + c.inbackups() + + c.outbackups() + + c.dontpublishlease() + + c.encryptlease() + + c.leasesetenctype() + + c.reduceonidle() + + c.reduceidletime() + + c.reduceidlecount() + + c.closeonidle() + + c.closeidletime() + + c.compresion() +} diff --git a/vendor/github.com/eyedeekay/goSam/replyParser.go b/vendor/github.com/eyedeekay/goSam/replyParser.go new file mode 100644 index 00000000..c5d2e616 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/replyParser.go @@ -0,0 +1,72 @@ +package goSam + +import ( + "fmt" + "strings" +) + +// The Possible Results send by SAM +const ( + ResultOk = "OK" //Operation completed successfully + ResultCantReachPeer = "CANT_REACH_PEER" //The peer exists, but cannot be reached + ResultDuplicatedID = "DUPLICATED_ID" //If the nickname is already associated with a session : + ResultDuplicatedDest = "DUPLICATED_DEST" //The specified Destination is already in use + ResultI2PError = "I2P_ERROR" //A generic I2P error (e.g. I2CP disconnection, etc.) + ResultInvalidKey = "INVALID_KEY" //The specified key is not valid (bad format, etc.) + ResultKeyNotFound = "KEY_NOT_FOUND" //The naming system can't resolve the given name + ResultPeerNotFound = "PEER_NOT_FOUND" //The peer cannot be found on the network + ResultTimeout = "TIMEOUT" // Timeout while waiting for an event (e.g. peer answer) +) + +// A ReplyError is a custom error type, containing the Result and full Reply +type ReplyError struct { + Result string + Reply *Reply +} + +func (r ReplyError) Error() string { + return fmt.Sprintf("ReplyError: Result:%s - Reply:%+v", r.Result, r.Reply) +} + +// Reply is the parsed result of a SAM command, containing a map of all the key-value pairs +type Reply struct { + Topic string + Type string + From string + To string + + Pairs map[string]string +} + +func parseReply(line string) (*Reply, error) { + fmt.Println("PARSER PARTS", line) + line = strings.TrimSpace(line) + parts := strings.Split(line, " ") + if len(parts) < 3 { + return nil, fmt.Errorf("Malformed Reply.\n%s\n", line) + } + + r := &Reply{ + Topic: parts[0], + Type: parts[1], + Pairs: make(map[string]string, len(parts)-2), + } + + for _, v := range parts[2:] { + if strings.Contains(v, "FROM_PORT") { + r.From = v + } else if strings.Contains(v, "TO_PORT") { + r.To = v + } else { + kvPair := strings.SplitN(v, "=", 2) + if kvPair != nil { + if len(kvPair) != 2 { + return nil, fmt.Errorf("Malformed key-value-pair.\n%s\n", kvPair) + } + } + r.Pairs[kvPair[0]] = kvPair[len(kvPair)-1] + } + } + + return r, nil +} diff --git a/vendor/github.com/eyedeekay/goSam/rw.go b/vendor/github.com/eyedeekay/goSam/rw.go new file mode 100644 index 00000000..18d54609 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/rw.go @@ -0,0 +1,101 @@ +/* +The MIT License (MIT) + +Copyright (c) 2014 Henry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package goSam + +import ( + "encoding/hex" + "io" + "log" +) + +/* +Copy of testing/iotest Read- and WriteLogger, but using %q instead of %x for printing +*/ + +type writeLogger struct { + prefix string + w io.Writer +} + +func (l *writeLogger) Write(p []byte) (n int, err error) { + n, err = l.w.Write(p) + if err != nil { + log.Printf("%s %q: %v", l.prefix, string(p[0:n]), err) + } else { + log.Printf("%s %q", l.prefix, string(p[0:n])) + } + return +} + +// NewWriteLogger returns a writer that behaves like w except +// that it logs (using log.Printf) each write to standard error, +// printing the prefix and the hexadecimal data written. +func NewWriteLogger(prefix string, w io.Writer) io.Writer { + return &writeLogger{prefix, w} +} + +type readLogger struct { + prefix string + r io.Reader +} + +func (l *readLogger) Read(p []byte) (n int, err error) { + n, err = l.r.Read(p) + if err != nil { + log.Printf("%s %q: %v", l.prefix, string(p[0:n]), err) + } else { + log.Printf("%s %q", l.prefix, string(p[0:n])) + } + return +} + +// NewReadLogger returns a reader that behaves like r except +// that it logs (using log.Print) each read to standard error, +// printing the prefix and the hexadecimal data written. +func NewReadLogger(prefix string, r io.Reader) io.Reader { + return &readLogger{prefix, r} +} + +type readHexLogger struct { + prefix string + r io.Reader +} + +func (l *readHexLogger) Read(p []byte) (n int, err error) { + n, err = l.r.Read(p) + if err != nil { + log.Printf("%s (%d bytes) Error: %v", l.prefix, n, err) + } else { + log.Printf("%s (%d bytes)", l.prefix, n) + } + log.Print("\n" + hex.Dump(p[:n])) + return +} + +// NewReadHexLogger returns a reader that behaves like r except +// that it logs to stderr using ecoding/hex. +func NewReadHexLogger(prefix string, r io.Reader) io.Reader { + return &readHexLogger{prefix, r} +} diff --git a/vendor/github.com/eyedeekay/goSam/rwc.go b/vendor/github.com/eyedeekay/goSam/rwc.go new file mode 100644 index 00000000..4327a0db --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/rwc.go @@ -0,0 +1,80 @@ +/* +The MIT License (MIT) + +Copyright (c) 2014 Henry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package goSam + +import ( + "io" + //"github.com/miolini/datacounter" +) + +type RWC struct { + io.Reader + io.Writer + c io.Closer +} + +func WrapRWC(c io.ReadWriteCloser) io.ReadWriteCloser { + rl := NewReadLogger("<", c) + wl := NewWriteLogger(">", c) + + return &RWC{ + Reader: rl, + Writer: wl, + c: c, + } +} + +func (c *RWC) Close() error { + return c.c.Close() +} + +/* +type Counter struct { + io.Reader + io.Writer + c io.Closer + + Cr *datacounter.ReaderCounter + Cw *datacounter.WriterCounter +} + +func WrapCounter(c io.ReadWriteCloser) *Counter { + rc := datacounter.NewReaderCounter(c) + wc := datacounter.NewWriterCounter(c) + + return &Counter{ + Reader: rc, + Writer: wc, + c: c, + + Cr: rc, + Cw: wc, + } +} + +func (c *Counter) Close() error { + return c.c.Close() +} +*/ diff --git a/vendor/github.com/eyedeekay/goSam/sessions.go b/vendor/github.com/eyedeekay/goSam/sessions.go new file mode 100644 index 00000000..89424736 --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/sessions.go @@ -0,0 +1,45 @@ +package goSam + +import ( + "fmt" + // "math" + "math/rand" + "time" +) + +func init() { + rand.Seed(time.Now().UnixNano()) +} + +// CreateStreamSession creates a new STREAM Session. +// Returns the Id for the new Client. +func (c *Client) CreateStreamSession(id int32, dest string) (string, error) { + if dest == "" { + dest = "TRANSIENT" + } + c.id = id + r, err := c.sendCmd( + "SESSION CREATE STYLE=STREAM ID=%d DESTINATION=%s %s %s %s %s \n", + c.id, + dest, + c.from(), + c.to(), + c.sigtype(), + c.allOptions(), + ) + if err != nil { + return "", err + } + + // TODO: move check into sendCmd() + if r.Topic != "SESSION" || r.Type != "STATUS" { + return "", fmt.Errorf("Session Unknown Reply: %+v\n", r) + } + + result := r.Pairs["RESULT"] + if result != "OK" { + return "", ReplyError{ResultKeyNotFound, r} + } + c.destination = r.Pairs["DESTINATION"] + return c.destination, nil +} diff --git a/vendor/github.com/eyedeekay/goSam/stream.go b/vendor/github.com/eyedeekay/goSam/stream.go new file mode 100644 index 00000000..517b2fae --- /dev/null +++ b/vendor/github.com/eyedeekay/goSam/stream.go @@ -0,0 +1,45 @@ +package goSam + +import ( + "fmt" +) + +// StreamConnect asks SAM for a TCP-Like connection to dest, has to be called on a new Client +func (c *Client) StreamConnect(id int32, dest string) error { + r, err := c.sendCmd("STREAM CONNECT ID=%d DESTINATION=%s %s %s\n", id, dest, c.from(), c.to()) + if err != nil { + return err + } + + // TODO: move check into sendCmd() + if r.Topic != "STREAM" || r.Type != "STATUS" { + return fmt.Errorf("Stream Connect Unknown Reply: %+v\n", r) + } + + result := r.Pairs["RESULT"] + if result != "OK" { + return ReplyError{result, r} + } + + return nil +} + +// StreamAccept asks SAM to accept a TCP-Like connection +func (c *Client) StreamAccept(id int32) (*Reply, error) { + r, err := c.sendCmd("STREAM ACCEPT ID=%d SILENT=false\n", id) + if err != nil { + return nil, err + } + + // TODO: move check into sendCmd() + if r.Topic != "STREAM" || r.Type != "STATUS" { + return nil, fmt.Errorf("Stream Accept Unknown Reply: %+v\n", r) + } + + result := r.Pairs["RESULT"] + if result != "OK" { + return nil, ReplyError{result, r} + } + + return r, nil +}