diff --git a/Gopkg.lock b/Gopkg.lock index f5256d33c2..136d6f9757 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,11 +3,14 @@ [[projects]] branch = "default" + digest = "1:c0164b6d52877372590085b45f53a160f47c24e8a2312bb815489223044f5914" name = "bitbucket.org/ww/goautoneg" packages = ["."] + pruneopts = "NUT" revision = "75cd24fc2f2c2a2088577d12123ddee5f54e0675" [[projects]] + digest = "1:00e79d6128a3291e16e50c06b741dea303a14022a9ad0933e282b56f5718da25" name = "cloud.google.com/go" packages = [ "compute/metadata", @@ -16,21 +19,25 @@ "internal/optional", "internal/trace", "internal/version", - "storage" + "storage", ] + pruneopts = "NUT" revision = "4b98a6370e36d7a85192e7bad08a4ebd82eac2a8" version = "v0.20.0" [[projects]] + digest = "1:5ed72db0f83da719e9a160afe288b9dd8767889284a749e3c6eb5fa0206bc066" name = "github.com/Azure/azure-sdk-for-go" packages = [ "arm/storage", - "storage" + "storage", ] + pruneopts = "NUT" revision = "57db66900881e9fd21fd041a9d013514700ecab3" version = "v10.3.0-beta" [[projects]] + digest = "1:3d4bc3d8959e07ccb7e6695f8554045d2b12cb6d31fb87e88a769602edaf4d9e" name = "github.com/Azure/go-autorest" packages = [ "autorest", @@ -38,18 +45,22 @@ "autorest/azure", "autorest/date", "autorest/validation", - "version" + "version", ] + pruneopts = "NUT" revision = "bca49d5b51a50dc5bb17bbf6204c711c6dbded06" version = "v10.14.0" [[projects]] branch = "master" + digest = "1:600d8310944edc9be6ec62ca6ea867578640bb5622a8f248667e2f9fae963c65" name = "github.com/Azure/go-ntlmssp" packages = ["."] + pruneopts = "NUT" revision = "4b934ac9dad38d389d34f0b98d98b2467c422012" [[projects]] + digest = "1:04e92cbfbbf1a8ff3da2d1b2f74e60e3162fd65954011abfa8d9ab2da5d3e974" name = "github.com/ChrisTrenkamp/goxpath" packages = [ ".", @@ -65,96 +76,126 @@ "tree/xmltree", "tree/xmltree/xmlbuilder", "tree/xmltree/xmlele", - "tree/xmltree/xmlnode" + "tree/xmltree/xmlnode", ] + pruneopts = "NUT" revision = "2ad3b31cf4a21db70fc0cacd0e0120eaae566f98" version = "v1.0-alpha3" [[projects]] + digest = "1:a26f8da48b22e6176c1c6a2459904bb30bd0c49ada04b2963c2c3a203e81a620" name = "github.com/Masterminds/semver" packages = ["."] + pruneopts = "NUT" revision = "c7af12943936e8c39859482e61f0574c2fd7fc75" version = "v1.4.2" [[projects]] + digest = "1:43f9a530dfe36fb355b05fbc7a5712f8149a7f6bdfd131bc0ccc634e25c4dd1e" name = "github.com/Masterminds/sprig" packages = ["."] + pruneopts = "NUT" revision = "6b2a58267f6a8b1dc8e2eb5519b984008fa85e8c" version = "v2.15.0" [[projects]] + digest = "1:99632bb2b4e2c066233ee9d19c1370a695ebd2be18625e31390476d356db5d8a" name = "github.com/Microsoft/go-winio" packages = ["."] + pruneopts = "NUT" revision = "a6d595ae73cf27a1b8fc32930668708f45ce1c85" version = "v0.4.9" [[projects]] + digest = "1:76939b72b6b2012e9aca613f33d947099178c9f0d3be5522485701031ebf3e49" name = "github.com/NYTimes/gziphandler" packages = ["."] + pruneopts = "NUT" revision = "2600fb119af974220d3916a5916d6e31176aac1b" version = "v1.0.1" [[projects]] + digest = "1:d8ebbd207f3d3266d4423ce4860c9f3794956306ded6c7ba312ecc69cdfbf04c" name = "github.com/PuerkitoBio/purell" packages = ["."] + pruneopts = "NUT" revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:8098cd40cd09879efbf12e33bcd51ead4a66006ac802cd563a66c4f3373b9727" name = "github.com/PuerkitoBio/urlesc" packages = ["."] + pruneopts = "NUT" revision = "de5bf2ad457846296e2031421a34e2568e304e35" [[projects]] + digest = "1:a1b2cc5ad53b08fbfb4dfe962a2e145325acb4b874ea44beb02d4b5b158c2079" name = "github.com/Unknwon/com" packages = ["."] + pruneopts = "NUT" revision = "28b053d5a2923b87ce8c5a08f3af779894a72758" version = "v1" [[projects]] + digest = "1:8bd40ec66a32437126e8ff3080f26b11ca5926917daa01eba1285d0b059416bc" name = "github.com/agext/levenshtein" packages = ["."] + pruneopts = "NUT" revision = "5f10fee965225ac1eecdc234c09daf5cd9e7f7b6" version = "v1.2.1" [[projects]] + digest = "1:975108e8d4f5dab096fc991326e96a5716ee8d02e5e7386bb4796171afc4ab9a" name = "github.com/aokoli/goutils" packages = ["."] + pruneopts = "NUT" revision = "3391d3790d23d03408670993e957e8f408993c34" version = "v1.0.1" [[projects]] branch = "master" + digest = "1:ef98942770803ae37c4787ad6bf70e401c99834dfba5e3034b97ba7c24e66c10" name = "github.com/apparentlymart/go-cidr" packages = ["cidr"] + pruneopts = "NUT" revision = "2bd8b58cf4275aeb086ade613de226773e29e853" [[projects]] branch = "master" + digest = "1:ca4ebf76293ee2653f577bf737fbcbd90b07abb54c58cf786c02411413e5fa15" name = "github.com/apparentlymart/go-textseg" packages = ["textseg"] + pruneopts = "NUT" revision = "b836f5c4d331d1945a2fead7188db25432d73b69" [[projects]] branch = "master" + digest = "1:8fc037b5238b59e5d87a2287748aba369a55d44e442a85081909c283f6dd9d71" name = "github.com/armon/circbuf" packages = ["."] + pruneopts = "NUT" revision = "bbbad097214e2918d8543d5201d12bfd7bca254d" [[projects]] branch = "master" + digest = "1:50dba5c53c526d131059a349872dd0db092e58d555748b1c59fa566735f2fab7" name = "github.com/armon/go-radix" packages = ["."] + pruneopts = "NUT" revision = "1fca145dffbcaa8fe914309b1ec0cfc67500fe61" [[projects]] + digest = "1:5a23cd3a5496a0b2da7e3b348d14e77b11a210738c398200d7d6f04ea8cf3bd8" name = "github.com/asaskevich/govalidator" packages = ["."] + pruneopts = "NUT" revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" version = "v9" [[projects]] + digest = "1:5101789b805ee6cad9dc0b32f9a506e9cfd8198944b0bca739d1e842ad27df0d" name = "github.com/aws/aws-sdk-go" packages = [ "aws", @@ -271,59 +312,77 @@ "service/sts", "service/swf", "service/waf", - "service/wafregional" + "service/wafregional", ] + pruneopts = "NUT" revision = "1186f7e6f000ce13edff71ed5ecc8b0e27ba38d7" version = "v1.15.33" [[projects]] + digest = "1:f4298c81d8a94ab68d9e387eaf6e653387df5da17702f06c6d8718a7a8e549d0" name = "github.com/beevik/etree" packages = ["."] + pruneopts = "NUT" revision = "9d7e8feddccb4ed1b8afb54e368bd323d2ff652c" version = "v1.0.1" [[projects]] branch = "master" + digest = "1:707ebe952a8b3d00b343c01536c79c73771d100f63ec6babeaed5c79e2b8a8dd" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "NUT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] branch = "master" + digest = "1:37011b20a70e205b93ebea5287e1afa5618db54bf3998c36ff5a8e4b146a170a" name = "github.com/bgentry/go-netrc" packages = ["netrc"] + pruneopts = "NUT" revision = "9fd32a8b3d3d3f9d43c341bfe098430e07609480" [[projects]] + digest = "1:aef384a4c419ec6504905842b9c70c6a800d95db9eb7543f54c061f4e3aee23b" name = "github.com/bgentry/speakeasy" packages = ["."] + pruneopts = "NUT" revision = "4aabc24848ce5fd31929f7d1e4ea74d3709c14cd" version = "v0.1.0" [[projects]] + digest = "1:aba270497eb2d49f5cba6f4162d524b9a1195a24cbce8be20bf56a0051f47deb" name = "github.com/blang/semver" packages = ["."] + pruneopts = "NUT" revision = "2ee87856327ba09384cabd113bc6b5d174e9ec0f" version = "v3.5.1" [[projects]] + digest = "1:063db6a0b87d39e99b3102a293cf675c23bb82074acea0a3e9276b3331216c2a" name = "github.com/cenkalti/backoff" packages = ["."] + pruneopts = "NUT" revision = "61153c768f31ee5f130071d08fc82b85208528de" version = "v1.1.0" [[projects]] + digest = "1:5bc013fc648abaa0bd7c78af20ae3c1a8a46c7a540a381f27d0038754c99d413" name = "github.com/chzyer/readline" packages = ["."] + pruneopts = "NUT" revision = "c914be64f07d9998f52bf0d598ec26d457168c0f" [[projects]] branch = "master" + digest = "1:fc8dbcc2a5de7c093e167828ebbdf551641761d2ad75431d3a167d467a264115" name = "github.com/containerd/continuity" packages = ["pathdriver"] + pruneopts = "NUT" revision = "0377f7d767206f3a9e8881d0f02267b0d89c7a62" [[projects]] + digest = "1:0685db67b1b106b0c1981e106209c7b7636f03826ddb38b243fcc135f0c722de" name = "github.com/coreos/etcd" packages = [ "auth/authpb", @@ -338,36 +397,46 @@ "pkg/tlsutil", "pkg/transport", "pkg/types", - "version" + "version", ] + pruneopts = "NUT" revision = "fca8add78a9d926166eb739b8e4a124434025ba3" version = "v3.3.9" [[projects]] + digest = "1:0ef770954bca104ee99b3b6b7f9b240605ac03517d9f98cbc1893daa03f3c038" name = "github.com/coreos/go-semver" packages = ["semver"] + pruneopts = "NUT" revision = "8ab6407b697782a06568d4b7f1db25550ec2e4c6" version = "v0.2.0" [[projects]] + digest = "1:1da3a221f0bc090792d3a2a080ff09008427c0e0f0533a4ed6abd8994421da73" name = "github.com/coreos/go-systemd" packages = ["daemon"] + pruneopts = "NUT" revision = "39ca1b05acc7ad1220e09f133283b8859a8b71ab" version = "v17" [[projects]] + digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "NUT" revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] + digest = "1:7a6852b35eb5bbc184561443762d225116ae630c26a7c4d90546619f1e7d2ad2" name = "github.com/dgrijalva/jwt-go" packages = ["."] + pruneopts = "NUT" revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" version = "v3.2.0" [[projects]] + digest = "1:689d0c6f8ce9d4c4a181316ec465c8773ae6f6720122aec53e635986d77f5930" name = "github.com/docker/docker" packages = [ "pkg/archive", @@ -377,139 +446,179 @@ "pkg/longpath", "pkg/mount", "pkg/pools", - "pkg/system" + "pkg/system", ] + pruneopts = "NUT" revision = "bc7424b4434443b036604277bfcdee3fa34a268a" [[projects]] + digest = "1:4340101f42556a9cb2f7a360a0e95a019bfef6247d92e6c4c46f2433cf86a482" name = "github.com/docker/go-units" packages = ["."] + pruneopts = "NUT" revision = "47565b4f722fb6ceae66b95f853feed578a4a51c" version = "v0.3.3" [[projects]] branch = "master" + digest = "1:aa68b3bef22149ebfeb6e74d90792b22df1813d5acdf1932bf58a0af9598700e" name = "github.com/dustinkirkland/golang-petname" packages = ["."] + pruneopts = "NUT" revision = "d3c2ba80e75eeef10c5cf2fc76d2c809637376b3" [[projects]] + digest = "1:73523214424821cb767652975a7612403d1f512396bb0e5d9461fbe122d88d13" name = "github.com/dylanmei/iso8601" packages = ["."] + pruneopts = "NUT" revision = "2075bf119b58e5576c6ed9f867b8f3d17f2e54d4" version = "v0.1.0" [[projects]] + digest = "1:d612f023556888f38ccbaf22cde164f88a23619d5877fcd34a707c6b021ae6da" name = "github.com/elazarl/go-bindata-assetfs" packages = ["."] + pruneopts = "NUT" revision = "30f82fa23fd844bd5bb1e5f216db87fd77b5eb43" version = "v1.0.0" [[projects]] + digest = "1:3537d33c077a9666720dc987fddfecb07270606ac0a58f67abd08e3b252c0a45" name = "github.com/emicklei/go-restful" packages = [ ".", - "log" + "log", ] + pruneopts = "NUT" revision = "3eb9738c1697594ea6e71a7156a9bb32ed216cf0" version = "v2.8.0" [[projects]] + digest = "1:27e00683ae7700cf7b286011dcd6ace672d542d236590dcc51bd10669cfb3366" name = "github.com/emicklei/go-restful-swagger12" packages = ["."] + pruneopts = "NUT" revision = "dcef7f55730566d41eae5db10e7d6981829720f6" version = "1.0.1" [[projects]] + digest = "1:ad32dc29f37281bacb5dcedff17c9461dc1739dc8a5f63a71ab491c6e92edf8d" name = "github.com/evanphx/json-patch" packages = ["."] + pruneopts = "NUT" revision = "afac545df32f2287a079e2dfb7ba2745a643747e" version = "v3.0.0" [[projects]] + digest = "1:ade392a843b2035effb4b4a2efa2c3bab3eb29b992e98bacf9c898b0ecb54e45" name = "github.com/fatih/color" packages = ["."] + pruneopts = "NUT" revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4" version = "v1.7.0" [[projects]] + digest = "1:52ec55889de2c93a772ceba253313c12f65444aac61a11182d4d119ef97479e8" name = "github.com/fatih/structs" packages = ["."] + pruneopts = "NUT" revision = "a720dfa8df582c51dee1b36feabb906bde1588bd" version = "v1.0" [[projects]] + digest = "1:81466b4218bf6adddac2572a30ac733a9255919bc2f470b4827a317bd4ee1756" name = "github.com/ghodss/yaml" packages = ["."] + pruneopts = "NUT" revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" version = "v1.0.0" [[projects]] + digest = "1:f59266de09e138237bf9df9deb57b9ebbdb1e33b8399bb739c3745e7d3d2787b" name = "github.com/go-ini/ini" packages = ["."] + pruneopts = "NUT" revision = "358ee7663966325963d4e8b2e1fbd570c5195153" version = "v1.38.1" [[projects]] + digest = "1:260f7ebefc63024c8dfe2c9f1a2935a89fa4213637a1f522f592f80c001cc441" name = "github.com/go-openapi/jsonpointer" packages = ["."] + pruneopts = "NUT" revision = "3a0015ad55fa9873f41605d3e8f28cd279c32ab2" version = "0.15.0" [[projects]] + digest = "1:98abd61947ff5c7c6fcfec5473d02a4821ed3a2dd99a4fbfdb7925b0dd745546" name = "github.com/go-openapi/jsonreference" packages = ["."] + pruneopts = "NUT" revision = "3fb327e6747da3043567ee86abd02bb6376b6be2" version = "0.15.0" [[projects]] + digest = "1:87216dc20d985010c4cbe3301b4f9d4c81eaea407a289bd6338d2ac66d61b5a4" name = "github.com/go-openapi/spec" packages = ["."] + pruneopts = "NUT" revision = "bce47c9386f9ecd6b86f450478a80103c3fe1402" version = "0.15.0" [[projects]] + digest = "1:d6dca21942524b423bf8d3e273c61874f7cd5511c2797e67685c33f4ab971f57" name = "github.com/go-openapi/swag" packages = ["."] + pruneopts = "NUT" revision = "2b0bd4f193d011c203529df626a65d63cb8a79e8" version = "0.15.0" [[projects]] + digest = "1:4c59c7d491a28441d9f8b1c78d861021b13562e7e6cb3a8f258cc6703b244a31" name = "github.com/go-ozzo/ozzo-validation" packages = [ ".", - "is" + "is", ] + pruneopts = "NUT" revision = "9d6782aa52aad2ec5f3ea5af63b7dc4bc5192c40" version = "v3.4.0" [[projects]] + digest = "1:cd4f86461732066e277335465962660cbf02999e18d5bbb5e9285eac4608b970" name = "github.com/gogo/protobuf" packages = [ "gogoproto", "proto", "protoc-gen-gogo/descriptor", - "sortkeys" + "sortkeys", ] + pruneopts = "NUT" revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] branch = "master" + digest = "1:e2b86e41f3d669fc36b50d31d32d22c8ac656c75aa5ea89717ce7177e134ff2a" name = "github.com/golang/glog" packages = ["."] + pruneopts = "NUT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] + digest = "1:7ded16107bddae6f7ad4bf105887304d35b13db44882bf516cb2d1854adb3fe2" name = "github.com/golang/mock" packages = [ "gomock", "mockgen", - "mockgen/model" + "mockgen/model", ] + pruneopts = "NUT" revision = "v1.1.1" [[projects]] + digest = "1:698b57d2e177534bca3e8ee5eee05968dd14dc4fe1d015e3fb6237ff10e8826a" name = "github.com/golang/protobuf" packages = [ "proto", @@ -517,58 +626,90 @@ "ptypes", "ptypes/any", "ptypes/duration", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "NUT" revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:7f114b78210bf5b75f307fc97cff293633c835bab1e0ea8a744a44b39c042dfe" name = "github.com/golang/snappy" packages = ["."] + pruneopts = "NUT" revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" [[projects]] branch = "master" + digest = "1:245bd4eb633039cd66106a5d340ae826d87f4e36a8602fcc940e14176fd26ea7" name = "github.com/google/btree" packages = ["."] + pruneopts = "NUT" revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4" [[projects]] branch = "master" + digest = "1:a63cff6b5d8b95638bfe300385d93b2a6d9d687734b863da8e09dc834510a690" name = "github.com/google/go-querystring" packages = ["query"] + pruneopts = "NUT" revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a" [[projects]] branch = "master" + digest = "1:c0c871240b85ea14304b4f6113c390b4390020cf4914c7ba78f63e9f54ef7927" + name = "github.com/google/goexpect" + packages = ["."] + pruneopts = "NUT" + revision = "88b7cf98484152f464f685e94dc4334205362983" + +[[projects]] + branch = "master" + digest = "1:52c5834e2bebac9030c97cc0798ac11c3aa8a39f098aeb419f142533da6cd3cc" name = "github.com/google/gofuzz" packages = ["."] + pruneopts = "NUT" revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] + branch = "master" + digest = "1:5b66c432b11dc4996e583c298c03a3120c9f2e1c68d05b72adceff13595892c3" + name = "github.com/google/goterm" + packages = ["term"] + pruneopts = "NUT" + revision = "70e1c263818522aa1ecbdd34d7e143639d447ced" + +[[projects]] + digest = "1:1bb197a3b5db4e06e00b7560f8e89836c486627f2a0338332ed37daa003d259e" name = "github.com/google/uuid" packages = ["."] + pruneopts = "NUT" revision = "064e2069ce9c359c118179501254f67d7d37ba24" version = "0.2" [[projects]] + digest = "1:fe852c57b4fc4d11e6ef79bce1e930ee2f2f7d148b370afef8f8d012a80960ea" name = "github.com/googleapis/gax-go" packages = ["."] + pruneopts = "NUT" revision = "317e0006254c44a0ac427cc52a0e083ff0b9622f" version = "v2.0.0" [[projects]] + digest = "1:06a7dadb7b760767341ffb6c8d377238d68a1226f2b21b5d497d2e3f6ecf6b4e" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", "compiler", - "extensions" + "extensions", ] + pruneopts = "NUT" revision = "7c663266750e7d82587642f65e60bc4083f1f84e" version = "v0.2.0" [[projects]] + digest = "1:302ddc9856c3d0ec9d8080c37fc57289f63da77d59d00fb12206c82d1d3194a1" name = "github.com/gophercloud/gophercloud" packages = [ ".", @@ -621,131 +762,169 @@ "openstack/objectstorage/v1/objects", "openstack/objectstorage/v1/swauth", "openstack/utils", - "pagination" + "pagination", ] + pruneopts = "NUT" revision = "3027adb1ce72bc52b87b2decccc7852574b90031" [[projects]] branch = "master" + digest = "1:7fdf3223c7372d1ced0b98bf53457c5e89d89aecbad9a77ba9fcc6e01f9e5621" name = "github.com/gregjones/httpcache" packages = [ ".", - "diskcache" + "diskcache", ] + pruneopts = "NUT" revision = "9cad4c3443a7200dd6400aef47183728de563a38" [[projects]] branch = "master" + digest = "1:d3480c33cf23e8c99df9101db329b898bfb56b8fb99b16e8a0cea5518b8e677c" name = "github.com/hashicorp/atlas-go" packages = [ "archive", - "v1" + "v1", ] + pruneopts = "NUT" revision = "8261ea0801056858f57a58ee6ce37b9365a78ce9" [[projects]] + digest = "1:58622dbf6fac92cb7bddfed5cb82a138815e22495912fc1ba6fa65d4fbaaba9a" name = "github.com/hashicorp/consul" packages = ["api"] + pruneopts = "NUT" revision = "39f93f011e591c842acc8053a7f5972aa6e592fd" version = "v1.2.1" [[projects]] branch = "master" + digest = "1:f0d9d74edbd40fdeada436d5ac9cb5197407899af3fef85ff0137077ffe8ae19" name = "github.com/hashicorp/errwrap" packages = ["."] + pruneopts = "NUT" revision = "d6c0cd88035724dd42e0f335ae30161c20575ecc" [[projects]] branch = "master" + digest = "1:45bb0c7cab76a8e3fc3e202b871039bd35e8ce865170b57befd8d122eb5382b5" name = "github.com/hashicorp/go-checkpoint" packages = ["."] + pruneopts = "NUT" revision = "1545e56e46dec3bba264e41fde2c1e2aa65b5dd4" [[projects]] branch = "master" + digest = "1:a5d940c38bf56f121721bfa747c66356df387cb9d5318c570c6d4170aab62862" name = "github.com/hashicorp/go-cleanhttp" packages = ["."] + pruneopts = "NUT" revision = "d5fe4b57a186c716b0e00b8c301cbd9b4182694d" [[projects]] branch = "master" + digest = "1:096df5bfd020b0be2621d2c400468b4956adc4dab078289661a0c00708c09227" name = "github.com/hashicorp/go-getter" packages = [ ".", - "helper/url" + "helper/url", ] + pruneopts = "NUT" revision = "a33f09ce9feed989941a4dfe08b3890a0f8aceb9" [[projects]] branch = "master" + digest = "1:27d609eb0e1e84ad3be8c5214835b7728557954e87b6a1222182e3664152f6ab" name = "github.com/hashicorp/go-hclog" packages = ["."] + pruneopts = "NUT" revision = "ff2cf002a8dd750586d91dddd4470c341f981fe1" [[projects]] branch = "master" + digest = "1:2ed138049ab373f696db2081ca48f15c5abdf20893803612a284f2bdce2bf443" name = "github.com/hashicorp/go-multierror" packages = ["."] + pruneopts = "NUT" revision = "3d5d8f294aa03d8e98859feac328afbdf1ae0703" [[projects]] branch = "master" + digest = "1:532090ffc3b05a7e4c0229dd2698d79149f2e0683df993224a8b202f607fb605" name = "github.com/hashicorp/go-plugin" packages = ["."] + pruneopts = "NUT" revision = "e8d22c780116115ae5624720c9af0c97afe4f551" [[projects]] + digest = "1:478ffbf24cda825e849769ce8eb3fc2a627fe9f548d5b973743eddc6785fbc8c" name = "github.com/hashicorp/go-retryablehttp" packages = ["."] + pruneopts = "NUT" revision = "6e85be8fee1dcaa02c0eaaac2df5a8fbecf94145" [[projects]] branch = "master" + digest = "1:cdb5ce76cd7af19e3d2d5ba9b6458a2ee804f0d376711215dd3df5f51100d423" name = "github.com/hashicorp/go-rootcerts" packages = ["."] + pruneopts = "NUT" revision = "6bb64b370b90e7ef1fa532be9e591a81c3493e00" [[projects]] branch = "master" + digest = "1:fbab03227343a0285fc74a68dd2ff46cda7edecbbe5a3e98d2cecd00cc67b217" name = "github.com/hashicorp/go-safetemp" packages = ["."] + pruneopts = "NUT" revision = "b1a1dbde6fdc11e3ae79efd9039009e22d4ae240" [[projects]] + digest = "1:f2f065a89823904b6220a905a8171c2f93ec518b2fa288de361655071a98263f" name = "github.com/hashicorp/go-slug" packages = ["."] + pruneopts = "NUT" revision = "cc9d70694ef317c2e6443e20b7927363d69c8b1e" version = "v0.1.0" [[projects]] + digest = "1:c5e31a62502492b0512a5b9497cae67c529f315e9b4fb0d396db8d8bd821a5ae" name = "github.com/hashicorp/go-tfe" packages = ["."] + pruneopts = "NUT" revision = "dffc938c010479f92b9ff565f78534861fa8bb76" version = "v0.1.2" [[projects]] branch = "master" + digest = "1:6c1c337aab3268149ef3fe6256dc79cc1abffa2269d3b222d00913956f317328" name = "github.com/hashicorp/go-uuid" packages = ["."] + pruneopts = "NUT" revision = "27454136f0364f2d44b1276c552d69105cf8c498" [[projects]] branch = "master" + digest = "1:0b06ffe0c0764e413a6738e3f045d6bb14117359aef80a09f8c60fbff2ecad6b" name = "github.com/hashicorp/go-version" packages = ["."] + pruneopts = "NUT" revision = "270f2f71b1ee587f3b609f00f422b76a6b28f348" [[projects]] branch = "master" + digest = "1:13e2fa5735a82a5fb044f290cfd0dba633d1c5e516b27da0509e0dbb3515a18e" name = "github.com/hashicorp/golang-lru" packages = [ ".", - "simplelru" + "simplelru", ] + pruneopts = "NUT" revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" [[projects]] branch = "master" + digest = "1:f50b4685fde77ecabe1871873960f5e5c22e31f5af9b6b6107380aa2fbfa69cf" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -758,12 +937,14 @@ "hcl/token", "json/parser", "json/scanner", - "json/token" + "json/token", ] + pruneopts = "NUT" revision = "ef8a98b0bbce4a65b5aa4c368430a80ddc533168" [[projects]] branch = "master" + digest = "1:380812f2b7c818a465fa54927d3c27acc443117fd255c3052ca2468098644480" name = "github.com/hashicorp/hcl2" packages = [ "gohcl", @@ -771,28 +952,34 @@ "hcl/hclsyntax", "hcl/json", "hcldec", - "hclparse" + "hclparse", ] + pruneopts = "NUT" revision = "41cff854d8157be197e6b4698a8d9570ced9476b" [[projects]] branch = "master" + digest = "1:0ba5dadb581f036a9d1e7a6fa9101ace3291334c86c1a6965adc43de64b2df3e" name = "github.com/hashicorp/hil" packages = [ ".", "ast", "parser", - "scanner" + "scanner", ] + pruneopts = "NUT" revision = "fa9f258a92500514cc8e9c67020487709df92432" [[projects]] branch = "master" + digest = "1:9e12c5649c4b1a47e113593d61acf2eb131dad59fea70a05111a89fa4aead0ee" name = "github.com/hashicorp/logutils" packages = ["."] + pruneopts = "NUT" revision = "0dc08b1671f34c4250ce212759ebd880f743d883" [[projects]] + digest = "1:9cab82db93e4e8de5cf1d7162dcddced1ffe8fe8a2adad5c101b61b52dbc578b" name = "github.com/hashicorp/packer" packages = [ "builder/amazon/common", @@ -812,18 +999,22 @@ "provisioner/shell", "template", "template/interpolate", - "version" + "version", ] + pruneopts = "NUT" revision = "d1cc5451e933f39986bdc1069e9d26e534cde548" version = "v1.2.5" [[projects]] + digest = "1:0dd7b7b01769f9df356dc99f9e4144bdbabf6c79041ea7c0892379c5737f3c44" name = "github.com/hashicorp/serf" packages = ["coordinate"] + pruneopts = "NUT" revision = "d6574a5bb1226678d7010325fb6c985db20ee458" version = "v0.8.1" [[projects]] + digest = "1:c66ea71a5c53c860ae0133e2d7c4e42aa62490e25823479817c793b7d3992df1" name = "github.com/hashicorp/terraform" packages = [ "backend", @@ -893,12 +1084,14 @@ "svchost/disco", "terraform", "tfdiags", - "version" + "version", ] + pruneopts = "NUT" revision = "6dfc4d748de9cda23835bc5704307ed45e839622" version = "v0.11.8" [[projects]] + digest = "1:88a0935f8819740dd6f50f25c5eea6d98fb79186d4b6b773a7f2ff46dfb6b644" name = "github.com/hashicorp/vault" packages = [ "api", @@ -906,115 +1099,147 @@ "helper/jsonutil", "helper/parseutil", "helper/pgpkeys", - "helper/strutil" + "helper/strutil", ] + pruneopts = "NUT" revision = "7e1fbde40afee241f81ef08700e7987d86fc7242" version = "v0.9.6" [[projects]] branch = "master" + digest = "1:63e0b20cfa3fe456480edf93a7995f776afb610e49da8e3da04d8904472a44cc" name = "github.com/hashicorp/yamux" packages = ["."] + pruneopts = "NUT" revision = "3520598351bb3500a49ae9563f5539666ae0a27c" [[projects]] branch = "master" + digest = "1:b7f860847a1d71f925ba9385ed95f1ebc0abfeb418a78e219ab61f48fdfeffad" name = "github.com/howeyc/gopass" packages = ["."] + pruneopts = "NUT" revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8" [[projects]] + digest = "1:f5db19d350bd0b542d17f7e7cf4e7068bac416c08adb6a129b3c6d1db8211051" name = "github.com/huandu/xstrings" packages = ["."] + pruneopts = "NUT" revision = "2bf18b218c51864a87384c06996e40ff9dcff8e1" version = "v1.0.0" [[projects]] + digest = "1:65300ccc4bcb38b107b868155c303312978981e56bca707c81efec57575b5e06" name = "github.com/imdario/mergo" packages = ["."] + pruneopts = "NUT" revision = "9316a62528ac99aaecb4e47eadd6dc8aa6533d58" version = "v0.3.5" [[projects]] + digest = "1:406338ad39ab2e37b7f4452906442a3dbf0eb3379dd1f06aafb5c07e769a5fbb" name = "github.com/inconshreveable/mousetrap" packages = ["."] + pruneopts = "NUT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] branch = "master" + digest = "1:62fe3a7ea2050ecbd753a71889026f83d73329337ada66325cbafd5dea5f713d" name = "github.com/jbenet/go-context" packages = ["io"] + pruneopts = "NUT" revision = "d14ea06fba99483203c19d92cfcd13ebe73135f4" [[projects]] branch = "master" + digest = "1:cd40c0a491c8de55ddb565a80aa2f288be12c6cc6eb82b8faafe11d5d0bce739" name = "github.com/jen20/awspolicyequivalence" packages = ["."] + pruneopts = "NUT" revision = "9fbcaca9f9f868b9560463d0790aae33b2322945" [[projects]] + digest = "1:d17f46f871bcc34d92ed9a80c9b2e2f9d9b3d4daad5050a74a75384976be50df" name = "github.com/jetstack/vault-helper" packages = ["pkg/kubernetes"] + pruneopts = "NUT" revision = "5f5e6092c69689f4d986c3aed3fb3e76159577a8" version = "0.9.13" [[projects]] + digest = "1:ebaf6032045257249e9ad6844477320091a71a963c058a2243275163b3998eaa" name = "github.com/jetstack/vault-unsealer" packages = [ "pkg/kv", "pkg/kv/aws_kms", "pkg/kv/aws_ssm", - "pkg/vault" + "pkg/vault", ] + pruneopts = "NUT" revision = "8c7e60f8a09d08ec2822d369cc71e77a2b6b98e0" version = "0.2.1" [[projects]] + digest = "1:ac6d01547ec4f7f673311b4663909269bfb8249952de3279799289467837c3cc" name = "github.com/jmespath/go-jmespath" packages = ["."] + pruneopts = "NUT" revision = "0b12d6b5" [[projects]] + digest = "1:3e27f2d5d0734852c4b402aadc7467c2f108503598768ddd7c6f3653984dedc8" name = "github.com/joyent/triton-go" packages = [ ".", "authentication", "client", "errors", - "storage" + "storage", ] + pruneopts = "NUT" revision = "456a0793b5f863d7a46f747df443788eaa627654" version = "1.3.1" [[projects]] + digest = "1:0243cffa4a3410f161ee613dfdd903a636d07e838a42d341da95d81f42cd1d41" name = "github.com/json-iterator/go" packages = ["."] + pruneopts = "NUT" revision = "ab8a2e0c74be9d3be70b3184d9acc634935ded82" version = "1.1.4" [[projects]] + digest = "1:5dbea5aeba908dc7350b9cd7c6309ec08e85a8e106d4e3c3194f08a5b1e879e5" name = "github.com/jteeuwen/go-bindata" packages = [ ".", - "go-bindata" + "go-bindata", ] + pruneopts = "NUT" revision = "a0ff2567cfb70903282db057e799fd826784d41d" [[projects]] + digest = "1:8b3234b10eacd5edea45bf0c13a585b608749da23f94aaf29b46d9ef8a8babf4" name = "github.com/juju/ratelimit" packages = ["."] + pruneopts = "NUT" revision = "59fac5042749a5afb9af70e813da1dd5474f0167" version = "1.0.1" [[projects]] branch = "master" + digest = "1:263f9b0a0bcbfff9d5e7d9f2aa11f53995d98214fe0fb97e429e7a5f4534a0f9" name = "github.com/kardianos/osext" packages = ["."] + pruneopts = "NUT" revision = "ae77be60afb1dcacde03767a8c37337fad28ac14" [[projects]] branch = "master" + digest = "1:aed6852ecc2fd1cbc6cf3fe7923261a5b51c07b04abe65373caf33751e6c514c" name = "github.com/keybase/go-crypto" packages = [ "brainpool", @@ -1029,412 +1254,534 @@ "openpgp/errors", "openpgp/packet", "openpgp/s2k", - "rsa" + "rsa", ] + pruneopts = "NUT" revision = "670ebd3adf7a737d69ffe83a777a8e34eadc1b32" [[projects]] + digest = "1:47fa0ef6ae6b0387dacb77c7ab8827b4ef621650fd613e43ece61de4cb3f5019" name = "github.com/kr/fs" packages = ["."] + pruneopts = "NUT" revision = "1455def202f6e05b95cc7bfc7e8ae67ae5141eba" version = "v0.1.0" [[projects]] branch = "master" + digest = "1:860c7eb9e2ce833cee135a74a991efaef82507cfa7d80900cb8d3d18cc914588" name = "github.com/lusis/go-artifactory" packages = ["src/artifactory.v401"] + pruneopts = "NUT" revision = "a47f63f234b2a2c87e52d7f1c72a9a7f87bd7880" [[projects]] branch = "master" + digest = "1:89cb38858ea53690cdcd952f35b6cdda405dc9f8fc5601872e01b49c88c59991" name = "github.com/mailru/easyjson" packages = [ "buffer", "jlexer", - "jwriter" + "jwriter", ] + pruneopts = "NUT" revision = "d5012789d6659eeed305f54c1b1542e7b65829e6" [[projects]] + digest = "1:2773a3d38a10f76a8ac624d50b8d6d42ab3e50224841e3c225b4aee2dc4921ba" name = "github.com/masterzen/azure-sdk-for-go" packages = [ "core/http", - "core/tls" + "core/tls", ] + pruneopts = "NUT" revision = "ee4f0065d00cd12b542f18f5bc45799e88163b12" [[projects]] branch = "master" + digest = "1:a7c1ab68a6cdeffcb148dc0d8b92c897f034aa38f58b69eab9bc6e77645b26fb" name = "github.com/masterzen/simplexml" packages = ["dom"] + pruneopts = "NUT" revision = "4572e39b1ab9fe03ee513ce6fc7e289e98482190" [[projects]] + digest = "1:d3ed15f66e790a534c6246598105cb986ab449a970cb6ab9613d12c6f5c594e6" name = "github.com/masterzen/winrm" packages = [ ".", - "soap" + "soap", ] + pruneopts = "NUT" revision = "7e40f93ae939004a1ef3bd5ff5c88c756ee762bb" [[projects]] + digest = "1:08c231ec84231a7e23d67e4b58f975e1423695a32467a362ee55a803f9de8061" name = "github.com/mattn/go-colorable" packages = ["."] + pruneopts = "NUT" revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" version = "v0.0.9" [[projects]] + digest = "1:bc4f7eec3b7be8c6cb1f0af6c1e3333d5bb71072951aaaae2f05067b0803f287" name = "github.com/mattn/go-isatty" packages = ["."] + pruneopts = "NUT" revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" version = "v0.0.3" [[projects]] + digest = "1:5985ef4caf91ece5d54817c11ea25f182697534f8ae6521eadcd628c142ac4b6" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "NUT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] branch = "master" + digest = "1:874dbb1944c970cb6c5c683cc947b7a849b5fb2e6bdce41b1f95b3187916ed4b" name = "github.com/mitchellh/cli" packages = ["."] + pruneopts = "NUT" revision = "c48282d14eba4b0817ddef3f832ff8d13851aefd" [[projects]] branch = "master" + digest = "1:58ed95018a7eb9f94125846e7cf1f12843c0d46308e9a7a6a58e895270da5b99" name = "github.com/mitchellh/colorstring" packages = ["."] + pruneopts = "NUT" revision = "8631ce90f28644f54aeedcb3e389a85174e067d1" [[projects]] branch = "master" + digest = "1:1e5a8bf6fb005f1808852ad1a4bedb7b4b3291af90dec12c4c9e4a955a42c9b2" name = "github.com/mitchellh/copystructure" packages = ["."] + pruneopts = "NUT" revision = "d23ffcb85de31694d6ccaa23ccb4a03e55c1303f" [[projects]] branch = "master" + digest = "1:a668ddce280476b37b426615cbae9b6c5582987e4529230e8c55afa4678c3024" name = "github.com/mitchellh/go-fs" packages = [ ".", - "fat" + "fat", ] + pruneopts = "NUT" revision = "b7b9ca407ffff465de12fc37ccbb81ea8b428c43" [[projects]] branch = "master" + digest = "1:9db29b604bd78452d167abed82386ddd2f93973df3841896fb6ab8aff936f1d6" name = "github.com/mitchellh/go-homedir" packages = ["."] + pruneopts = "NUT" revision = "3864e76763d94a6df2f9960b16a20a33da9f9a66" [[projects]] branch = "master" + digest = "1:f202ed5030198dd75b951732f403846323ed4ba17c84f61db6f98988c9343f32" name = "github.com/mitchellh/go-linereader" packages = ["."] + pruneopts = "NUT" revision = "07bab5fdd9580500aea6ada0e09df4aa28e68abd" [[projects]] branch = "master" + digest = "1:18b773b92ac82a451c1276bd2776c1e55ce057ee202691ab33c8d6690efcc048" name = "github.com/mitchellh/go-testing-interface" packages = ["."] + pruneopts = "NUT" revision = "a61a99592b77c9ba629d254a693acffaeb4b7e28" [[projects]] branch = "master" + digest = "1:9f63926f52745d1f9d6053f8fbbb3bd3983c2c97c0565957e682b8d2f7aad3af" name = "github.com/mitchellh/go-wordwrap" packages = ["."] + pruneopts = "NUT" revision = "ad45545899c7b13c020ea92b2072220eefad42b8" [[projects]] branch = "master" + digest = "1:e34decedbcec12332c5836d16a6838f864e0b43c5b4f9aa9d9a85101015f87c2" name = "github.com/mitchellh/hashstructure" packages = ["."] + pruneopts = "NUT" revision = "2bca23e0e452137f789efbc8610126fd8b94f73b" [[projects]] branch = "master" + digest = "1:bd418de31f64429ae8cb5d02676fc9de2557fd19077f4fb55a2577187c7fbbe7" name = "github.com/mitchellh/iochan" packages = ["."] + pruneopts = "NUT" revision = "87b45ffd0e9581375c491fef3d32130bb15c5bd7" [[projects]] branch = "master" + digest = "1:5fe20cfe4ef484c237cec9f947b2a6fa90bad4b8610fd014f0e4211e13d82d5d" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "NUT" revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac" [[projects]] branch = "master" + digest = "1:cc9e70fffd9a7855bf38ee40d6f64f98f5c7bffe6b1dcd886ce2444cf8482bdc" name = "github.com/mitchellh/panicwrap" packages = ["."] + pruneopts = "NUT" revision = "fce601fe55579125e1b3cb0b992287e7290f7b83" [[projects]] branch = "master" + digest = "1:44e35ced240c6d8316dc8d604a73774ab052d40ebe636fd8f2ba5934f6329034" name = "github.com/mitchellh/reflectwalk" packages = ["."] + pruneopts = "NUT" revision = "63d60e9d0dbc60cf9164e6510889b0db6683d98c" [[projects]] + digest = "1:2f42fa12d6911c7b7659738758631bec870b7e9b4c6be5444f963cdcfccc191f" name = "github.com/modern-go/concurrent" packages = ["."] + pruneopts = "NUT" revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" version = "1.0.3" [[projects]] + digest = "1:c6aca19413b13dc59c220ad7430329e2ec454cc310bc6d8de2c7e2b93c18a0f6" name = "github.com/modern-go/reflect2" packages = ["."] + pruneopts = "NUT" revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" [[projects]] branch = "master" + digest = "1:a6156889b651cc0bf3d9bef82b6ba8fbb9eb19aefd7bc5718357c38b67297cbc" name = "github.com/mxk/go-flowrate" packages = ["flowrate"] + pruneopts = "NUT" revision = "cca7078d478f8520f85629ad7c68962d31ed7682" [[projects]] branch = "master" + digest = "1:16bbae9910129be5a18b951eabacd54414d3faea094dfab92bb3c84884d46b11" name = "github.com/nu7hatch/gouuid" packages = ["."] + pruneopts = "NUT" revision = "179d4d0c4d8d407a32af483c2354df1d2c91e6c3" [[projects]] + digest = "1:3b517122f3aad1ecce45a630ea912b3092b4729f25532a911d0cb2935a1f9352" name = "github.com/oklog/run" packages = ["."] + pruneopts = "NUT" revision = "4dadeb3030eda0273a12382bb2348ffc7c9d1a39" version = "v1.0.0" [[projects]] + digest = "1:e0cc8395ea893c898ff5eb0850f4d9851c1f57c78c232304a026379a47a552d0" name = "github.com/opencontainers/go-digest" packages = ["."] + pruneopts = "NUT" revision = "279bed98673dd5bef374d3b6e4b09e2af76183bf" version = "v1.0.0-rc1" [[projects]] + digest = "1:11db38d694c130c800d0aefb502fb02519e514dc53d9804ce51d1ad25ec27db6" name = "github.com/opencontainers/image-spec" packages = [ "specs-go", - "specs-go/v1" + "specs-go/v1", ] + pruneopts = "NUT" revision = "d60099175f88c47cd379c4738d158884749ed235" version = "v1.0.1" [[projects]] + digest = "1:89aeefe3f578fba85c1a61fec0fcd25a52fa03f0022e84d3e107ece3b914efa6" name = "github.com/opencontainers/runc" packages = [ "libcontainer/system", - "libcontainer/user" + "libcontainer/user", ] + pruneopts = "NUT" revision = "a618ab5a0186905949ee463dbb762c3d23e12a80" [[projects]] branch = "master" + digest = "1:b001460ea94194a5d9961274289ff5b64af7eeb724c474ce6188a4eb33bd2a0f" name = "github.com/packer-community/winrmcp" packages = ["winrmcp"] + pruneopts = "NUT" revision = "81144009af586de8e7729b829266f09dd0d59701" [[projects]] + digest = "1:cce3a18fb0b96b5015cd8ca03a57d20a662679de03c4dc4b6ff5f17ea2050fa6" name = "github.com/pborman/uuid" packages = ["."] + pruneopts = "NUT" revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" version = "v1.1" [[projects]] branch = "master" + digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2" name = "github.com/petar/GoLLRB" packages = ["llrb"] + pruneopts = "NUT" revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" [[projects]] + digest = "1:6c6d91dc326ed6778783cff869c49fb2f61303cdd2ebbcf90abe53505793f3b6" name = "github.com/peterbourgon/diskv" packages = ["."] + pruneopts = "NUT" revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" version = "v2.0.1" [[projects]] branch = "master" + digest = "1:89fa4c7ac713710640c83ec0461b78fc21c2eda6deca064fe461eef1b8bca303" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "NUT" revision = "816c9085562cd7ee03e7f8188a1cfd942858cded" [[projects]] + digest = "1:8af064f64d63ee15210924be5d817dc92f0a8b48437915b46c1147b672d72f69" name = "github.com/pkg/sftp" packages = ["."] + pruneopts = "NUT" revision = "57673e38ea946592a59c26592b7e6fbda646975b" version = "v1.8.0" [[projects]] + digest = "1:a93157833850e0861fb691f7561c75dbdd4b321f2485caf197ca0dad5e11f4e6" name = "github.com/posener/complete" packages = [ ".", "cmd", "cmd/install", - "match" + "match", ] + pruneopts = "NUT" revision = "98eb9847f27ba2008d380a32c98be474dea55bdf" version = "v1.1.1" [[projects]] + digest = "1:3e5fd795ebf6a9e13e67d644da76130af7a6003286531f9573f8074c228b66a3" name = "github.com/prometheus/client_golang" packages = ["prometheus"] + pruneopts = "NUT" revision = "c5b7fccd204277076155f10851dad72b76a49317" version = "v0.8.0" [[projects]] branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "NUT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" + digest = "1:768b555b86742de2f28beb37f1dedce9a75f91f871d75b5717c96399c1a78c08" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "NUT" revision = "7600349dcfe1abd18d72d3a1770870d9800a7801" [[projects]] branch = "master" + digest = "1:6621142cd60b7150ab66f38ff36303ca55843dc5a635c1f9a28f95ecddab72b4" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs" + "xfs", ] + pruneopts = "NUT" revision = "ae68e2d4c00fed4943b5f6698d504a5fe083da8a" [[projects]] + digest = "1:40448654e044326566a6950a18a4e076388366f4e3186711a888d1706fa196a0" name = "github.com/ryanuber/columnize" packages = ["."] + pruneopts = "NUT" revision = "983d3a5fab1bf04d1b412465d2d9f8430e2e917e" version = "v2.1.0" [[projects]] + digest = "1:cb24eec7a9478395847671abfbea162885f0be9c7ff6ef20b699dc20804ae1a4" name = "github.com/ryanuber/go-glob" packages = ["."] + pruneopts = "NUT" revision = "572520ed46dbddaed19ea3d9541bdd0494163693" version = "v0.1" [[projects]] + digest = "1:6bc0652ea6e39e22ccd522458b8bdd8665bf23bdc5a20eec90056e4dc7e273ca" name = "github.com/satori/uuid" packages = ["."] + pruneopts = "NUT" revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3" version = "v1.2.0" [[projects]] + digest = "1:d917313f309bda80d27274d53985bc65651f81a5b66b820749ac7f8ef061fd04" name = "github.com/sergi/go-diff" packages = ["diffmatchpatch"] + pruneopts = "NUT" revision = "1744e2970ca51c86172c8190fadad617561ed6e7" version = "v1.0.0" [[projects]] + digest = "1:1835b88303bfc3b4ac7a6cd3fe84966aeae13544ca3e306e2eb6d6b879d5c9db" name = "github.com/sethgrid/pester" packages = ["."] + pruneopts = "NUT" revision = "03e26c9abbbf5accb8349790bf9f41bde09d72c3" version = "1.0.0" [[projects]] + digest = "1:b2339e83ce9b5c4f79405f949429a7f68a9a904fed903c672aac1e7ceb7f5f02" name = "github.com/sirupsen/logrus" packages = ["."] + pruneopts = "NUT" revision = "3e01752db0189b9157070a0e1668a620f9a85da2" version = "v1.0.6" [[projects]] branch = "master" + digest = "1:343d44e06621142ab09ae0c76c1799104cdfddd3ffb445d78b1adf8dc3ffaf3d" name = "github.com/spf13/cobra" packages = ["."] + pruneopts = "NUT" revision = "7c4570c3ebeb8129a1f7456d0908a8b676b6f9f1" [[projects]] + digest = "1:15e5c398fbd9d2c439b635a08ac161b13d04f0c2aa587fe256b65dc0c3efe8b7" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "NUT" revision = "583c0c0531f06d5278b7d917446061adc344b5cd" version = "v1.0.1" [[projects]] + digest = "1:ccca1dcd18bc54e23b517a3c5babeff2e3924a7d8fc1932162225876cfe4bfb0" name = "github.com/src-d/gcfg" packages = [ ".", "scanner", "token", - "types" + "types", ] + pruneopts = "NUT" revision = "f187355171c936ac84a82793659ebb4936bc1c23" version = "v1.3.0" [[projects]] + digest = "1:58752107b48e9f8925373932d47e6b8368b1398f8847ed0990d4739b469b61d5" name = "github.com/svanharmelen/jsonapi" packages = ["."] + pruneopts = "NUT" revision = "46d3ced0434461be12e555852e2f1a9ed382e139" version = "1.0.0" [[projects]] + digest = "1:cfb72b79a2e36c9d3be0b65feb81a73f8af00f494c53d2d0e64a0e2e666f9950" name = "github.com/terraform-providers/terraform-provider-aws" packages = ["aws"] + pruneopts = "NUT" revision = "7a246a13e15a1ab9a63b311129279972ef7dc273" version = "v1.35.0" [[projects]] + digest = "1:e9233f43efbc563025a92aa3b26266d4670ca579b2f5a14e37c8c50badd79d98" name = "github.com/terraform-providers/terraform-provider-openstack" packages = ["openstack"] + pruneopts = "NUT" revision = "808e7d1f5280fdc59733443c5605e11d9cbd8357" version = "v0.1.0" [[projects]] + digest = "1:31a7f8bae17ec284242aa6c319a5119619342ec8ecc7984214d04b4efb4860c4" name = "github.com/terraform-providers/terraform-provider-random" packages = ["random"] + pruneopts = "NUT" revision = "09c8354edefba5483d208f55b5112c84ebf9e773" version = "v2.0.0" [[projects]] + digest = "1:ce6f6bfbd0771c1a706842d45665723ee277a3b98b274b1dd3abee46c5160c2d" name = "github.com/terraform-providers/terraform-provider-template" packages = ["template"] + pruneopts = "NUT" revision = "d8fb0821ebc320ff3750c982f14eca1e7249660d" version = "v1.0.0" [[projects]] + digest = "1:d3d3775fcb1fe83202504c2a055bd4609bc0e4851fd41d3c6b74856eb16c8f05" name = "github.com/terraform-providers/terraform-provider-tls" packages = ["tls"] + pruneopts = "NUT" revision = "96687fa8c50f1793bd1c608286e21e1c46d36b18" version = "v1.2.0" [[projects]] + digest = "1:919fc2a81add8ac4a7a236dceaf3e4c29ba4df96d13c3f2ce13a4d0132ebefb8" name = "github.com/ugorji/go" packages = ["codec"] + pruneopts = "NUT" revision = "b4c50a2b199d93b13dc15e78929cfb23bfdf21ab" version = "v1.1.1" [[projects]] + digest = "1:07e8742c479bab0066149ad02a710024154e76874fd0a2dba002d87702725825" name = "github.com/ulikunitz/xz" packages = [ ".", "internal/hash", "internal/xlog", - "lzma" + "lzma", ] + pruneopts = "NUT" revision = "0c6b41e72360850ca4f98dc341fd999726ea007f" version = "v0.5.4" [[projects]] + digest = "1:3148cb3478c26a92b4c1a18abb9428234b281e278af6267840721a24b6cbc6a3" name = "github.com/xanzy/ssh-agent" packages = ["."] + pruneopts = "NUT" revision = "640f0ab560aeb89d523bb6ac322b1244d5c3796c" version = "v0.2.0" [[projects]] branch = "master" + digest = "1:8edd23b3f3bae6a23bc83f7c59f1a99de76debb62bfedaad7728deed278315d3" name = "github.com/xlab/treeprint" packages = ["."] + pruneopts = "NUT" revision = "d6fb6747feb6e7cfdc44682a024bddf87ef07ec2" [[projects]] branch = "master" + digest = "1:5f13505e93886b93911ccd27e2a10c85bbf990862aeff1f884973e674c464802" name = "github.com/zclconf/go-cty" packages = [ "cty", @@ -1443,11 +1790,13 @@ "cty/function/stdlib", "cty/gocty", "cty/json", - "cty/set" + "cty/set", ] + pruneopts = "NUT" revision = "02bd58e97b5759d478019c5a6333edbfdfed16a0" [[projects]] + digest = "1:51db8b83c5320ce0522433046efec5fda0d34a2308ff969627e1ca206de77f35" name = "go.opencensus.io" packages = [ ".", @@ -1462,13 +1811,15 @@ "tag", "trace", "trace/internal", - "trace/propagation" + "trace/propagation", ] + pruneopts = "NUT" revision = "e262766cd0d230a1bb7c37281e345e465f19b41b" version = "v0.14.0" [[projects]] branch = "master" + digest = "1:64ba6a89ab7f8b92d5de691f3b1908ddecc48c5954717de80ff1f578a327a635" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -1492,12 +1843,14 @@ "ssh", "ssh/agent", "ssh/knownhosts", - "ssh/terminal" + "ssh/terminal", ] + pruneopts = "NUT" revision = "c126467f60eb25f8f27e5a981f32a87e3965053f" [[projects]] branch = "master" + digest = "1:e3ce478619bc6a72256d3500d586ab7f2546681c804352abc138419c634cadf7" name = "golang.org/x/net" packages = [ "context", @@ -1513,32 +1866,38 @@ "internal/timeseries", "proxy", "trace", - "websocket" + "websocket", ] + pruneopts = "NUT" revision = "3673e40ba22529d22c3fd7c93e97b0ce50fa7bdd" [[projects]] branch = "master" + digest = "1:20be1c62ac412f0f743bb5afdf2b3e343cb2f5b6dbcfb5ea09dac0d3d476dc2f" name = "golang.org/x/oauth2" packages = [ ".", "google", "internal", "jws", - "jwt" + "jwt", ] + pruneopts = "NUT" revision = "3d292e4d0cdc3a0113e6d207bb137145ef1de42f" [[projects]] branch = "master" + digest = "1:a801d3c417117b67a96353daad340b250619780b75c29b652ea13697c946553e" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] + pruneopts = "NUT" revision = "e072cadbbdc8dd3d3ffa82b8b4b9304c261d9311" [[projects]] + digest = "1:2c4e3b27329379d7b5f889038b48086140ea60708fb92e4b19d6a775926ea30b" name = "golang.org/x/text" packages = [ "collate", @@ -1567,13 +1926,15 @@ "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width" + "width", ] + pruneopts = "NUT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] branch = "master" + digest = "1:90be4d5bd77ea891a49987956d4ebb734b84f24d08261f749261baf2e6b388e9" name = "google.golang.org/api" packages = [ "gensupport", @@ -1584,11 +1945,13 @@ "iterator", "option", "storage/v1", - "transport/http" + "transport/http", ] + pruneopts = "NUT" revision = "2c45710c7f3fb0ab63506810a1ba84325ab90ab8" [[projects]] + digest = "1:b5aeceb800276be69165a745328380c8a4b6f2edc7a6bac112e22c8596ed8a49" name = "google.golang.org/appengine" packages = [ ".", @@ -1600,23 +1963,27 @@ "internal/modules", "internal/remote_api", "internal/urlfetch", - "urlfetch" + "urlfetch", ] + pruneopts = "NUT" revision = "b1f26356af11148e710935ed1ac8a7f5702c7612" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:ff760a397fba1ee1a22e40fb75aced010dd149a000f868d754d39a31794ec058" name = "google.golang.org/genproto" packages = [ "googleapis/api/annotations", "googleapis/iam/v1", "googleapis/rpc/code", - "googleapis/rpc/status" + "googleapis/rpc/status", ] + pruneopts = "NUT" revision = "02b4e95473316948020af0b7a4f0f22c73929b0e" [[projects]] + digest = "1:04403ed28896279b683ae57464170afd8e196c273feeb853f0347fe0015b525c" name = "google.golang.org/grpc" packages = [ ".", @@ -1645,36 +2012,44 @@ "stats", "status", "tap", - "transport" + "transport", ] + pruneopts = "NUT" revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" version = "v1.13.0" [[projects]] + digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" packages = ["."] + pruneopts = "NUT" revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" version = "v0.9.1" [[projects]] + digest = "1:80c34337e8a734e190f2d1b716cae774cca74db98315166f92074434e9af0227" name = "gopkg.in/natefinch/lumberjack.v2" packages = ["."] + pruneopts = "NUT" revision = "a96e63847dc3c67d17befa69c303767e2f84e54f" version = "v2.1" [[projects]] + digest = "1:f11daa9c86676340504cd37e731874627a973993e2d8f1547ae367a0303e0d8b" name = "gopkg.in/src-d/go-billy.v3" packages = [ ".", "helper/chroot", "helper/polyfill", "osfs", - "util" + "util", ] + pruneopts = "NUT" revision = "c329b7bc7b9d24905d2bc1b85bfa29f7ae266314" version = "v3.1.0" [[projects]] + digest = "1:f5732360da2e6a9267f3a3611781944c5fad4cd82f406189741993af8b3b4e89" name = "gopkg.in/src-d/go-git.v4" packages = [ ".", @@ -1716,24 +2091,30 @@ "utils/merkletrie/filesystem", "utils/merkletrie/index", "utils/merkletrie/internal/frame", - "utils/merkletrie/noder" + "utils/merkletrie/noder", ] + pruneopts = "NUT" revision = "b08cc8dc5450981530af3e6f6ad1159ae8ea8705" [[projects]] + digest = "1:b233ad4ec87ac916e7bf5e678e98a2cb9e8b52f6de6ad3e11834fc7a71b8e3bf" name = "gopkg.in/warnings.v0" packages = ["."] + pruneopts = "NUT" revision = "ec4a0fea49c7b46c2aeb0b51aac55779c607e52b" version = "v0.1.2" [[projects]] + digest = "1:7c95b35057a0ff2e19f707173cc1a947fa43a6eb5c4d300d196ece0334046082" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "NUT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [[projects]] branch = "master" + digest = "1:8f9e69b2d242b3fd81e1b21d519d6efffe3f1f2cb44c175fb2c0f910af3028b0" name = "k8s.io/api" packages = [ "admission/v1beta1", @@ -1764,11 +2145,13 @@ "settings/v1alpha1", "storage/v1", "storage/v1alpha1", - "storage/v1beta1" + "storage/v1beta1", ] + pruneopts = "NUT" revision = "183f3326a9353bd6d41430fc80f96259331d029c" [[projects]] + digest = "1:33eba8ae7e1ed809bdf07a9995c434e79eb62c80618274f7b09453264f95550b" name = "k8s.io/apimachinery" packages = [ "pkg/api/equality", @@ -1828,12 +2211,14 @@ "pkg/watch", "third_party/forked/golang/json", "third_party/forked/golang/netutil", - "third_party/forked/golang/reflect" + "third_party/forked/golang/reflect", ] + pruneopts = "NUT" revision = "19e3f5aa3adca672c153d324e6b7d82ff8935f03" version = "kubernetes-1.9.3" [[projects]] + digest = "1:619cd377db413fa4b66e003ae1718effc975eb028282fe0b9873b33a615eea10" name = "k8s.io/apiserver" packages = [ "pkg/admission", @@ -1920,12 +2305,14 @@ "plugin/pkg/audit/log", "plugin/pkg/audit/webhook", "plugin/pkg/authenticator/token/webhook", - "plugin/pkg/authorizer/webhook" + "plugin/pkg/authorizer/webhook", ] + pruneopts = "NUT" revision = "40b00dd493d8fb98c255f0c6427f97fbf865a538" version = "kubernetes-1.9.3" [[projects]] + digest = "1:66f2c908042f39a895817938a188c8a698ccecf6cfb0d6365cb3947ce9371421" name = "k8s.io/client-go" packages = [ "discovery", @@ -2043,12 +2430,14 @@ "util/flowcontrol", "util/homedir", "util/integer", - "util/workqueue" + "util/workqueue", ] + pruneopts = "NUT" revision = "9389c055a838d4f208b699b3c7c51b70f2368861" version = "kubernetes-1.9.3" [[projects]] + digest = "1:e617800ddcdaa1d91774db51f5d2c11896992ed442b11f502d088bb4a1534012" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -2066,12 +2455,14 @@ "cmd/informer-gen", "cmd/informer-gen/generators", "cmd/lister-gen", - "cmd/lister-gen/generators" + "cmd/lister-gen/generators", ] + pruneopts = "T" revision = "91d3f6a57905178524105a085085901bb73bd3dc" version = "kubernetes-1.9.3" [[projects]] + digest = "1:eb419924141c38a590476e98cbdfe58d945f06268ac40fc5d2d10f5436b0ff70" name = "k8s.io/gengo" packages = [ "args", @@ -2081,25 +2472,204 @@ "generator", "namer", "parser", - "types" + "types", ] + pruneopts = "NUT" revision = "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" [[projects]] branch = "master" + digest = "1:a8a0fdd623b2a37c433d137bddfab6b155e988efbc7cd68c18f9923dce6c8742" name = "k8s.io/kube-openapi" packages = [ "pkg/builder", "pkg/common", "pkg/handler", "pkg/util", - "pkg/util/proto" + "pkg/util/proto", ] + pruneopts = "NUT" revision = "d8ea2fe547a448256204cfc68dfee7b26c720acb" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "039372d06cd2d7cfca5b51bbaef7765a055bfd844619cb8bf1a343115076647d" + input-imports = [ + "github.com/Masterminds/sprig", + "github.com/aws/aws-sdk-go/aws", + "github.com/aws/aws-sdk-go/aws/awserr", + "github.com/aws/aws-sdk-go/aws/credentials", + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", + "github.com/aws/aws-sdk-go/aws/credentials/stscreds", + "github.com/aws/aws-sdk-go/aws/defaults", + "github.com/aws/aws-sdk-go/aws/ec2metadata", + "github.com/aws/aws-sdk-go/aws/request", + "github.com/aws/aws-sdk-go/aws/session", + "github.com/aws/aws-sdk-go/service/acm", + "github.com/aws/aws-sdk-go/service/apigateway", + "github.com/aws/aws-sdk-go/service/applicationautoscaling", + "github.com/aws/aws-sdk-go/service/athena", + "github.com/aws/aws-sdk-go/service/autoscaling", + "github.com/aws/aws-sdk-go/service/batch", + "github.com/aws/aws-sdk-go/service/cloudformation", + "github.com/aws/aws-sdk-go/service/cloudfront", + "github.com/aws/aws-sdk-go/service/cloudtrail", + "github.com/aws/aws-sdk-go/service/cloudwatch", + "github.com/aws/aws-sdk-go/service/cloudwatchevents", + "github.com/aws/aws-sdk-go/service/cloudwatchlogs", + "github.com/aws/aws-sdk-go/service/codebuild", + "github.com/aws/aws-sdk-go/service/codecommit", + "github.com/aws/aws-sdk-go/service/codedeploy", + "github.com/aws/aws-sdk-go/service/codepipeline", + "github.com/aws/aws-sdk-go/service/cognitoidentity", + "github.com/aws/aws-sdk-go/service/cognitoidentityprovider", + "github.com/aws/aws-sdk-go/service/configservice", + "github.com/aws/aws-sdk-go/service/databasemigrationservice", + "github.com/aws/aws-sdk-go/service/devicefarm", + "github.com/aws/aws-sdk-go/service/directconnect", + "github.com/aws/aws-sdk-go/service/directoryservice", + "github.com/aws/aws-sdk-go/service/dynamodb", + "github.com/aws/aws-sdk-go/service/ec2", + "github.com/aws/aws-sdk-go/service/ecr", + "github.com/aws/aws-sdk-go/service/ecs", + "github.com/aws/aws-sdk-go/service/efs", + "github.com/aws/aws-sdk-go/service/elasticache", + "github.com/aws/aws-sdk-go/service/elasticbeanstalk", + "github.com/aws/aws-sdk-go/service/elasticsearchservice", + "github.com/aws/aws-sdk-go/service/elastictranscoder", + "github.com/aws/aws-sdk-go/service/elb", + "github.com/aws/aws-sdk-go/service/elbv2", + "github.com/aws/aws-sdk-go/service/emr", + "github.com/aws/aws-sdk-go/service/firehose", + "github.com/aws/aws-sdk-go/service/gamelift", + "github.com/aws/aws-sdk-go/service/glacier", + "github.com/aws/aws-sdk-go/service/glue", + "github.com/aws/aws-sdk-go/service/guardduty", + "github.com/aws/aws-sdk-go/service/iam", + "github.com/aws/aws-sdk-go/service/inspector", + "github.com/aws/aws-sdk-go/service/iot", + "github.com/aws/aws-sdk-go/service/kinesis", + "github.com/aws/aws-sdk-go/service/kms", + "github.com/aws/aws-sdk-go/service/lambda", + "github.com/aws/aws-sdk-go/service/lightsail", + "github.com/aws/aws-sdk-go/service/mediastore", + "github.com/aws/aws-sdk-go/service/mq", + "github.com/aws/aws-sdk-go/service/opsworks", + "github.com/aws/aws-sdk-go/service/rds", + "github.com/aws/aws-sdk-go/service/redshift", + "github.com/aws/aws-sdk-go/service/route53", + "github.com/aws/aws-sdk-go/service/s3", + "github.com/aws/aws-sdk-go/service/servicecatalog", + "github.com/aws/aws-sdk-go/service/servicediscovery", + "github.com/aws/aws-sdk-go/service/ses", + "github.com/aws/aws-sdk-go/service/sfn", + "github.com/aws/aws-sdk-go/service/simpledb", + "github.com/aws/aws-sdk-go/service/sns", + "github.com/aws/aws-sdk-go/service/sqs", + "github.com/aws/aws-sdk-go/service/ssm", + "github.com/aws/aws-sdk-go/service/sts", + "github.com/aws/aws-sdk-go/service/waf", + "github.com/aws/aws-sdk-go/service/wafregional", + "github.com/blang/semver", + "github.com/cenkalti/backoff", + "github.com/davecgh/go-spew/spew", + "github.com/docker/docker/pkg/archive", + "github.com/go-ozzo/ozzo-validation", + "github.com/go-ozzo/ozzo-validation/is", + "github.com/golang/glog", + "github.com/golang/mock/gomock", + "github.com/golang/mock/mockgen", + "github.com/google/goexpect", + "github.com/google/uuid", + "github.com/hashicorp/errwrap", + "github.com/hashicorp/go-cleanhttp", + "github.com/hashicorp/go-multierror", + "github.com/hashicorp/go-plugin", + "github.com/hashicorp/packer/builder/amazon/ebs", + "github.com/hashicorp/packer/packer", + "github.com/hashicorp/packer/provisioner/shell", + "github.com/hashicorp/packer/template", + "github.com/hashicorp/packer/version", + "github.com/hashicorp/terraform/backend/init", + "github.com/hashicorp/terraform/command", + "github.com/hashicorp/terraform/helper/hashcode", + "github.com/hashicorp/terraform/helper/logging", + "github.com/hashicorp/terraform/helper/mutexkv", + "github.com/hashicorp/terraform/helper/resource", + "github.com/hashicorp/terraform/helper/schema", + "github.com/hashicorp/terraform/plugin", + "github.com/hashicorp/terraform/terraform", + "github.com/hashicorp/terraform/version", + "github.com/hashicorp/vault/api", + "github.com/jetstack/vault-helper/pkg/kubernetes", + "github.com/jetstack/vault-unsealer/pkg/kv", + "github.com/jetstack/vault-unsealer/pkg/kv/aws_kms", + "github.com/jetstack/vault-unsealer/pkg/kv/aws_ssm", + "github.com/jetstack/vault-unsealer/pkg/vault", + "github.com/jteeuwen/go-bindata/go-bindata", + "github.com/kardianos/osext", + "github.com/mitchellh/cli", + "github.com/mitchellh/go-homedir", + "github.com/sirupsen/logrus", + "github.com/spf13/cobra", + "github.com/spf13/pflag", + "github.com/terraform-providers/terraform-provider-aws/aws", + "github.com/terraform-providers/terraform-provider-random/random", + "github.com/terraform-providers/terraform-provider-template/template", + "github.com/terraform-providers/terraform-provider-tls/tls", + "golang.org/x/crypto/ssh", + "golang.org/x/net/context", + "gopkg.in/src-d/go-git.v4", + "gopkg.in/src-d/go-git.v4/config", + "gopkg.in/src-d/go-git.v4/plumbing", + "k8s.io/apimachinery/pkg/api/errors", + "k8s.io/apimachinery/pkg/api/resource", + "k8s.io/apimachinery/pkg/api/testing/roundtrip", + "k8s.io/apimachinery/pkg/apimachinery/announced", + "k8s.io/apimachinery/pkg/apimachinery/registered", + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/apis/meta/v1/validation", + "k8s.io/apimachinery/pkg/conversion", + "k8s.io/apimachinery/pkg/fields", + "k8s.io/apimachinery/pkg/labels", + "k8s.io/apimachinery/pkg/runtime", + "k8s.io/apimachinery/pkg/runtime/schema", + "k8s.io/apimachinery/pkg/runtime/serializer", + "k8s.io/apimachinery/pkg/runtime/serializer/json", + "k8s.io/apimachinery/pkg/types", + "k8s.io/apimachinery/pkg/util/errors", + "k8s.io/apimachinery/pkg/util/runtime", + "k8s.io/apimachinery/pkg/util/sets", + "k8s.io/apimachinery/pkg/util/validation/field", + "k8s.io/apimachinery/pkg/util/wait", + "k8s.io/apimachinery/pkg/version", + "k8s.io/apimachinery/pkg/watch", + "k8s.io/apiserver/pkg/admission", + "k8s.io/apiserver/pkg/endpoints/request", + "k8s.io/apiserver/pkg/registry/generic", + "k8s.io/apiserver/pkg/registry/generic/registry", + "k8s.io/apiserver/pkg/registry/rest", + "k8s.io/apiserver/pkg/server", + "k8s.io/apiserver/pkg/server/options", + "k8s.io/apiserver/pkg/storage", + "k8s.io/apiserver/pkg/storage/names", + "k8s.io/apiserver/pkg/util/logs", + "k8s.io/client-go/discovery", + "k8s.io/client-go/discovery/fake", + "k8s.io/client-go/kubernetes", + "k8s.io/client-go/rest", + "k8s.io/client-go/testing", + "k8s.io/client-go/tools/cache", + "k8s.io/client-go/tools/clientcmd", + "k8s.io/client-go/tools/clientcmd/api", + "k8s.io/client-go/util/flowcontrol", + "k8s.io/client-go/util/workqueue", + "k8s.io/code-generator/cmd/client-gen", + "k8s.io/code-generator/cmd/conversion-gen", + "k8s.io/code-generator/cmd/deepcopy-gen", + "k8s.io/code-generator/cmd/defaulter-gen", + "k8s.io/code-generator/cmd/informer-gen", + "k8s.io/code-generator/cmd/lister-gen", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/cmd/tarmak/e2e/e2e_cluster_test.go b/cmd/tarmak/e2e/e2e_cluster_test.go new file mode 100644 index 0000000000..08d4da0a73 --- /dev/null +++ b/cmd/tarmak/e2e/e2e_cluster_test.go @@ -0,0 +1,120 @@ +// Copyright Jetstack Ltd. See LICENSE for details. +package e2e_test + +import ( + "fmt" + "os" + "testing" +) + +func TestAWSSingleCluster(t *testing.T) { + t.Parallel() + skipE2ETests(t) + + ti := NewTarmakInstance(t) + ti.singleCluster = true + ti.singleZone = true + + t.Log("initialise config for single cluster") + if err := ti.Init(); err != nil { + t.Errorf("unexpected error: %+v", err) + } + + t.Log("build tarmak image") + c := ti.Command("cluster", "image", "build") + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Errorf("unexpected error: %+v", err) + } + + defer func() { + t.Log("run cluster destroy command") + c = ti.Command("cluster", "destroy") + // write error out to my stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Errorf("unexpected error: %+v", err) + } + }() + t.Log("run cluster apply command") + c = ti.Command("cluster", "apply") + // write error out to my stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } + + t.Log("get component status") + c = ti.Command("cluster", "kubectl", "get", "cs", "-o", "yaml") + // write error out to my stdout + c.Stderr = os.Stderr + c.Stdout = os.Stdout + if err := c.Run(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } +} + +func TestAWSMultiCluster(t *testing.T) { + t.Parallel() + skipE2ETests(t) + + ti := NewTarmakInstance(t) + ti.singleCluster = false + ti.singleZone = false + + t.Log("initialise config for single cluster") + if err := ti.Init(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } + + t.Log("build tarmak image") + c := ti.Command("cluster", "image", "build") + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } + + defer func() { + t.Log("run hub destroy command") + c = ti.Command("--current-cluster", fmt.Sprintf("%s-hub", ti.environmentName), "cluster", "destroy") + // write error out to my stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Errorf("unexpected error: %+v", err) + } + }() + t.Log("run hub apply command") + c = ti.Command("--current-cluster", fmt.Sprintf("%s-hub", ti.environmentName), "cluster", "apply") + // write error out to my stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } + + defer func() { + t.Log("run cluster destroy command") + c = ti.Command("cluster", "destroy") + // write error out to my stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Errorf("unexpected error: %+v", err) + } + }() + t.Log("run cluster apply command") + c = ti.Command("cluster", "apply") + // write error out to my stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } + + t.Log("get component status") + c = ti.Command("cluster", "kubectl", "get", "cs", "-o", "yaml") + // write error out to my stdout + c.Stderr = os.Stderr + c.Stdout = os.Stdout + if err := c.Run(); err != nil { + t.Fatalf("unexpected error: %+v", err) + } + +} diff --git a/cmd/tarmak/e2e/tarmak_instance_test.go b/cmd/tarmak/e2e/tarmak_instance_test.go new file mode 100644 index 0000000000..2bf175f4b1 --- /dev/null +++ b/cmd/tarmak/e2e/tarmak_instance_test.go @@ -0,0 +1,293 @@ +// Copyright Jetstack Ltd. See LICENSE for details. +package e2e_test + +import ( + "context" + "flag" + "fmt" + "io/ioutil" + "math/rand" + "os" + "os/exec" + "runtime" + "syscall" + "testing" + "time" + + "github.com/google/goexpect" +) + +var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz") +var e2eEnable bool + +const tarmakInitPrompt = "> " +const tarmakInitYesNo = " \\[Y\\/n\\] " + +func init() { + // add custom e2e flag + flag.BoolVar(&e2eEnable, "e2e", false, "Enable E2E tests") + flag.Parse() + + // seed random + rand.Seed(time.Now().UnixNano()) +} + +func skipE2ETests(t *testing.T) { + goTestCmd := "go test -v -timeout 1h github.com/jetstack/tarmak/cmd/tarmak/e2e -e2e" + + if !e2eEnable { + t.Skipf("E2E tests are disabled. Run tests with '%s'", goTestCmd) + } + if timeoutFlag := flag.Lookup("test.timeout"); timeoutFlag != nil { + t.Logf("flag=%+v", timeoutFlag.Value.String()) + if timeout, err := time.ParseDuration(timeoutFlag.Value.String()); err != nil { + t.Fatal("Unparseable timeout: ", err) + } else { + if timeout < time.Hour { + t.Skipf("E2E tests are disabled, as timeout is set to short. Run tests with '%s'", goTestCmd) + } + } + } +} + +func randStringRunes(n int) string { + b := make([]rune, n) + for i := range b { + b[i] = letterRunes[rand.Intn(len(letterRunes))] + } + return string(b) +} + +type TarmakInstance struct { + t *testing.T + configPath string // config path + binPath string // bin path to tarmak binary + region string // region of the cluster + singleCluster bool // single or multi cluster + singleZone bool // single or multi zone + environmentName string // name of the tarmak environment + awsBucketDynamoPrefix string // aws bucket and dynamodb prefix + awsSTSVaultPath string // vault auth path +} + +func NewTarmakInstance(t *testing.T) *TarmakInstance { + ti := &TarmakInstance{ + t: t, + binPath: fmt.Sprintf("../../../tarmak_%s_%s", runtime.GOOS, runtime.GOARCH), + region: "eu-central-1", + singleCluster: true, + singleZone: true, + environmentName: fmt.Sprintf("e2e%s", randStringRunes(6)), + awsBucketDynamoPrefix: fmt.Sprintf("jetstack-e2e-%s", randStringRunes(6)), + awsSTSVaultPath: "jetstack/aws/jetstack-dev/sts/admin", + } + + if _, err := os.Stat(ti.binPath); os.IsNotExist(err) { + t.Fatal("tarmak binary not existing: ", ti.binPath) + } else if err != nil { + t.Fatal("error finding tarmak binary: ", ti.binPath) + } + + if dir, err := ioutil.TempDir("", "tarmak-config"); err != nil { + t.Fatal("error creating temporary config directory: ", err) + } else { + t.Logf("created temp config directory in %s", dir) + ti.configPath = dir + } + + return ti +} + +func (ti *TarmakInstance) Command(args ...string) *exec.Cmd { + c := exec.CommandContext( + context.Background(), + ti.binPath, + args..., + ) + + c.Env = append(os.Environ(), fmt.Sprintf("TARMAK_CONFIG=%s", ti.configPath)) + + return c +} + +func (ti *TarmakInstance) Init() error { + e, wait, err := ti.Expect("init") + if err != nil { + return fmt.Errorf("error init expect: %s", err) + } + defer e.Close() + + if err := ti.initProvider(e); err != nil { + return fmt.Errorf("error initialsing provider config: %s", err) + } + if err := ti.initEnvironment(e); err != nil { + return fmt.Errorf("error initialsing environment config: %s", err) + } + if err := ti.initCluster(e); err != nil { + return fmt.Errorf("error initialsing cluster config: %s", err) + } + + if err := wait(); err != nil { + return fmt.Errorf("error waiting for tarmak: %s", err) + } + + return nil + +} + +// This returns a GExpect. It needs to be closed if it's no longer used +func (ti *TarmakInstance) Expect(args ...string) (*expect.GExpect, func() error, error) { + c := ti.Command(args...) + + // write error out to my stdout + c.Stderr = os.Stderr + + stdIn, err := c.StdinPipe() + if err != nil { + return nil, nil, fmt.Errorf("error creating pipe: %s", err) + } + + stdOut, err := c.StdoutPipe() + if err != nil { + return nil, nil, fmt.Errorf("error creating pipe: %s", err) + } + + if err := c.Start(); err != nil { + return nil, nil, fmt.Errorf("Unexcepted error starting tarmak: %+v", err) + } + + waitCh := make(chan error, 1) + + e, _, err := expect.SpawnGeneric( + &expect.GenOptions{ + In: stdIn, + Out: stdOut, + Wait: func() error { + err := c.Wait() + waitCh <- err + return err + }, + Close: c.Process.Kill, + Check: func() bool { + if c.Process == nil { + return false + } + // Sending Signal 0 to a process returns nil if process can take a signal , something else if not. + return c.Process.Signal(syscall.Signal(0)) == nil + }, + }, + time.Second, + ) + if err != nil { + return nil, nil, fmt.Errorf("error creating expect: %s", err) + } + + wait := func() error { + err := <-waitCh + return err + } + + return e, wait, nil +} + +func (ti *TarmakInstance) initProvider(e *expect.GExpect) error { + ti.t.Log("setting up provider") + res, err := e.ExpectBatch([]expect.Batcher{ + &expect.BExp{R: tarmakInitPrompt}, + &expect.BSnd{S: "jetstack-dev\n"}, // enter provider name + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: "1\n"}, // select AWS + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: "2\n"}, // vault auth + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: fmt.Sprintf("%s\n", ti.awsSTSVaultPath)}, // path for vault endpoint + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: fmt.Sprintf("%s\n", ti.awsBucketDynamoPrefix)}, // bucket / dynamodb backend + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: "develop.tarmak.org\n"}, // public route 53 + &expect.BExp{R: tarmakInitYesNo}, // + &expect.BSnd{S: "Y\n"}, // save provider + }, 30*time.Second) + if err != nil { + return fmt.Errorf("unexpected expect flow for init provider res=%+v error: %+v", res, err) + } + return nil +} + +func (ti *TarmakInstance) initEnvironment(e *expect.GExpect) error { + ti.t.Logf("setting up environment %s", ti.environmentName) + res, err := e.ExpectBatch([]expect.Batcher{ + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: fmt.Sprintf("%s\n", ti.environmentName)}, // environment + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: fmt.Sprintf("%s\n", ti.environmentName)}, // enter project name + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: "tech+e2e@jetstack.io\n"}, // enter contact mail + &expect.BExp{R: tarmakInitPrompt}, // + &expect.BSnd{S: "7\n"}, // select eu-central-1 // TODO: this will break with AWS adding more regions + &expect.BExp{R: tarmakInitYesNo}, // + &expect.BSnd{S: "Y\n"}, // save environment + }, 30*time.Second) + if err != nil { + return fmt.Errorf("unexpected expect flow for init environment res=%+v error: %+v", res, err) + } + return nil +} + +func (ti *TarmakInstance) initCluster(e *expect.GExpect) error { + + batches := []expect.Batcher{ + &expect.BExp{R: tarmakInitPrompt}, // + } + + // single vs. multi cluster + if ti.singleCluster { + batches = append(batches, &expect.BSnd{S: "1\n"}) + } else { + batches = append(batches, &expect.BSnd{S: "2\n"}) + } + + // single vs. multi zone + if !ti.singleZone { + batches = append( + batches, + &expect.BExp{R: tarmakInitPrompt}, + &expect.BSnd{S: "2\n"}, // enable second zone + &expect.BExp{R: tarmakInitPrompt}, + &expect.BSnd{S: "3\n"}, // enable third zone + ) + } + + // continue zone selection + batches = append( + batches, + &expect.BExp{R: tarmakInitPrompt}, + &expect.BSnd{S: "4\n"}, // continue + ) + + // set cluster name for multi cluster + if !ti.singleCluster { + batches = append( + batches, + &expect.BExp{R: tarmakInitPrompt}, + &expect.BSnd{S: "greeen\n"}, + ) + } + + // save cluster + batches = append( + batches, + &expect.BExp{R: tarmakInitYesNo}, // + &expect.BSnd{S: "Y\n"}, // save cluster + ) + + ti.t.Logf("setting up cluster in environment %s", ti.environmentName) + res, err := e.ExpectBatch( + batches, + 30*time.Second, + ) + if err != nil { + return fmt.Errorf("unexpected expect flow for init cluster res=%+v error: %+v", res, err) + } + return nil +} diff --git a/packer/amazon/centos-puppet-agent-latest-kernel.json b/packer/amazon/centos-puppet-agent-latest-kernel.json index 6044064c0c..44a88c1747 100644 --- a/packer/amazon/centos-puppet-agent-latest-kernel.json +++ b/packer/amazon/centos-puppet-agent-latest-kernel.json @@ -23,7 +23,7 @@ "instance_type": "c4.xlarge", "ssh_username": "centos", "ssh_pty": "true", - "ami_name": "Tarmak CentOS 7 x86_64 with puppet-agent and latest upstream kernel{{isotime \"2006-01-02_030405\"}}", + "ami_name": "{{user `tarmak_environment`}} - Tarmak CentOS 7 x86_64 with puppet-agent {{isotime \"2006-01-02_030405\"}}", "tags": { "Name": "tarmak_{{user `tarmak_environment`}}_{{user `tarmak_base_image_name`}}", "tarmak_environment": "{{user `tarmak_environment`}}", diff --git a/packer/amazon/centos-puppet-agent.json b/packer/amazon/centos-puppet-agent.json index 98aae1bc2b..0cfd415b20 100644 --- a/packer/amazon/centos-puppet-agent.json +++ b/packer/amazon/centos-puppet-agent.json @@ -23,7 +23,7 @@ "instance_type": "c4.xlarge", "ssh_username": "centos", "ssh_pty": "true", - "ami_name": "Tarmak CentOS 7 x86_64 with puppet-agent {{isotime \"2006-01-02_030405\"}}", + "ami_name": "{{user `tarmak_environment`}} - Tarmak CentOS 7 x86_64 with puppet-agent {{isotime \"2006-01-02_030405\"}}", "tags": { "Name": "tarmak_{{user `tarmak_environment`}}_{{user `tarmak_base_image_name`}}", "tarmak_environment": "{{user `tarmak_environment`}}", diff --git a/vendor/github.com/google/goexpect/AUTHORS b/vendor/github.com/google/goexpect/AUTHORS new file mode 100644 index 0000000000..15167cd746 --- /dev/null +++ b/vendor/github.com/google/goexpect/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/google/goexpect/LICENSE b/vendor/github.com/google/goexpect/LICENSE new file mode 100644 index 0000000000..931520b99e --- /dev/null +++ b/vendor/github.com/google/goexpect/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2015 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/google/goexpect/expect.go b/vendor/github.com/google/goexpect/expect.go new file mode 100644 index 0000000000..de164d43d4 --- /dev/null +++ b/vendor/github.com/google/goexpect/expect.go @@ -0,0 +1,1181 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package expect is a Go version of the classic TCL Expect. +package expect + +import ( + "bytes" + "errors" + "fmt" + "io" + "log" + "os/exec" + "regexp" + "strconv" + "strings" + "sync" + "syscall" + "time" + + "golang.org/x/crypto/ssh" + "google.golang.org/grpc/codes" + + "github.com/google/goterm/term" +) + +// DefaultTimeout is the default Expect timeout. +const DefaultTimeout = 60 * time.Second + +const ( + bufferSize = 8192 // bufferSize sets the size of the io buffers. + checkDuration = 2 * time.Second // checkDuration how often to check for new output. +) + +// Status contains an errormessage and a status code. +type Status struct { + code codes.Code + msg string +} + +// NewStatus creates a Status with the provided code and message. +func NewStatus(code codes.Code, msg string) *Status { + return &Status{code, msg} +} + +// NewStatusf returns a Status with the providead code and a formatted message. +func NewStatusf(code codes.Code, format string, a ...interface{}) *Status { + return NewStatus(code, fmt.Sprintf(fmt.Sprintf(format, a...))) +} + +// Err is a helper to handle errors. +func (s *Status) Err() error { + if s == nil || s.code == codes.OK { + return nil + } + return s +} + +// Error is here to adhere to the error interface. +func (s *Status) Error() string { + return s.msg +} + +// Option represents one Expecter option. +type Option func(*GExpect) Option + +// CheckDuration changes the default duration checking for new incoming data. +func CheckDuration(d time.Duration) Option { + return func(e *GExpect) Option { + prev := e.chkDuration + e.chkDuration = d + return CheckDuration(prev) + } +} + +// Verbose enables/disables verbose logging of matches and sends. +func Verbose(v bool) Option { + return func(e *GExpect) Option { + prev := e.verbose + e.verbose = v + return Verbose(prev) + } +} + +// VerboseWriter sets an alternate destination for verbose logs. +func VerboseWriter(w io.Writer) Option { + return func(e *GExpect) Option { + prev := e.verboseWriter + e.verboseWriter = w + return VerboseWriter(prev) + } +} + +// NoCheck turns off the Expect alive checks. +func NoCheck() Option { + return changeChk(func(*GExpect) bool { + return true + }) +} + +// DebugCheck adds logging to the check function. +// The check function for the spawners are called at creation/timeouts and I/O so can +// be usable for printing current state during debugging. +func DebugCheck(l *log.Logger) Option { + lg := log.Printf + if l != nil { + lg = l.Printf + } + return func(e *GExpect) Option { + prev := e.chk + e.chkMu.Lock() + e.chk = func(ge *GExpect) bool { + res := prev(ge) + ge.mu.Lock() + lg("chk: %t, ge: %v", res, ge) + ge.mu.Unlock() + return res + } + e.chkMu.Unlock() + return changeChk(prev) + } +} + +// ChangeCheck changes the Expect check function. +func ChangeCheck(f func() bool) Option { + return changeChk(func(*GExpect) bool { + return f() + }) +} + +func changeChk(f func(*GExpect) bool) Option { + return func(e *GExpect) Option { + prev := e.chk + e.chkMu.Lock() + e.chk = f + e.chkMu.Unlock() + return changeChk(prev) + } +} + +// SetEnv sets the environmental variables of the spawned process. +func SetEnv(env []string) Option { + return func(e *GExpect) Option { + prev := e.cmd.Env + e.cmd.Env = env + return SetEnv(prev) + } +} + +// BatchCommands. +const ( + // BatchSend for invoking Send in a batch + BatchSend = iota + // BatchExpect for invoking Expect in a batch + BatchExpect + // BatchSwitchCase for invoking ExpectSwitchCase in a batch + BatchSwitchCase +) + +// TimeoutError is the error returned by all Expect functions upon timer expiry. +type TimeoutError int + +// Error implements the Error interface. +func (t TimeoutError) Error() string { + return fmt.Sprintf("expect: timer expired after %d seconds", time.Duration(t)/time.Second) +} + +// BatchRes returned from ExpectBatch for every Expect command executed. +type BatchRes struct { + // Idx is used to match the result with the []Batcher commands sent in. + Idx int + // Out output buffer for the expect command at Batcher[Idx]. + Output string + // Match regexp matches for expect command at Batcher[Idx]. + Match []string +} + +// Batcher interface is used to make it more straightforward and readable to create +// batches of Expects. +// +// var batch = []Batcher{ +// &BExpT{"password",8}, +// &BSnd{"password\n"}, +// &BExp{"olakar@router>"}, +// &BSnd{ "show interface description\n"}, +// &BExp{ "olakar@router>"}, +// } +// +// var batchSwCaseReplace = []Batcher{ +// &BCasT{[]Caser{ +// &BCase{`([0-9]) -- .*\(MASTER\)`, `\1` + "\n"}}, 1}, +// &BExp{`prompt/>`}, +// } +type Batcher interface { + // cmd returns the Batch command. + Cmd() int + // Arg returns the command argument. + Arg() string + // Timeout returns the timeout duration for the command , <0 gives default value. + Timeout() time.Duration + // Cases returns the Caser structure for SwitchCase commands. + Cases() []Caser +} + +// BExp implements the Batcher interface for Expect commands using the default timeout. +type BExp struct { + // R contains the Expect command regular expression. + R string +} + +// Cmd returns the Expect command (BatchExpect). +func (be *BExp) Cmd() int { + return BatchExpect +} + +// Arg returns the Expect regular expression. +func (be *BExp) Arg() string { + return be.R +} + +// Timeout always returns -1 which sets it to the value used to call the ExpectBatch function. +func (be *BExp) Timeout() time.Duration { + return -1 +} + +// Cases always returns nil for the Expect command. +func (be *BExp) Cases() []Caser { + return nil +} + +// BExpT implements the Batcher interface for Expect commands adding a timeout option to the BExp +// type. +type BExpT struct { + // R contains the Expect command regular expression. + R string + // T holds the Expect command timeout in seconds. + T int +} + +// Cmd returns the Expect command (BatchExpect). +func (bt *BExpT) Cmd() int { + return BatchExpect +} + +// Timeout returns the timeout in seconds. +func (bt *BExpT) Timeout() time.Duration { + return time.Duration(bt.T) * time.Second +} + +// Arg returns the Expect regular expression. +func (bt *BExpT) Arg() string { + return bt.R +} + +// Cases always return nil for the Expect command. +func (bt *BExpT) Cases() []Caser { + return nil +} + +// BSnd implements the Batcher interface for Send commands. +type BSnd struct { + S string +} + +// Cmd returns the Send command(BatchSend). +func (bs *BSnd) Cmd() int { + return BatchSend +} + +// Arg returns the data to be sent. +func (bs *BSnd) Arg() string { + return bs.S +} + +// Timeout always returns 0 , Send doesn't have a timeout. +func (bs *BSnd) Timeout() time.Duration { + return 0 +} + +// Cases always returns nil , not used for Send commands. +func (bs *BSnd) Cases() []Caser { + return nil +} + +// BCas implements the Batcher interface for SwitchCase commands. +type BCas struct { + // C holds the Caser array for the SwitchCase command. + C []Caser +} + +// Cmd returns the SwitchCase command(BatchSwitchCase). +func (bc *BCas) Cmd() int { + return BatchSwitchCase +} + +// Arg returns an empty string , not used for SwitchCase. +func (bc *BCas) Arg() string { + return "" +} + +// Timeout returns -1 , setting it to the default value. +func (bc *BCas) Timeout() time.Duration { + return -1 +} + +// Cases returns the Caser structure. +func (bc *BCas) Cases() []Caser { + return bc.C +} + +// BCasT implements the Batcher interfacs for SwitchCase commands, adding a timeout option +// to the BCas type. +type BCasT struct { + // Cs holds the Caser array for the SwitchCase command. + C []Caser + // Tout holds the SwitchCase timeout in seconds. + T int +} + +// Timeout returns the timeout in seconds. +func (bct *BCasT) Timeout() time.Duration { + return time.Duration(bct.T) * time.Second +} + +// Cmd returns the SwitchCase command(BatchSwitchCase). +func (bct *BCasT) Cmd() int { + return BatchSwitchCase +} + +// Arg returns an empty string , not used for SwitchCase. +func (bct *BCasT) Arg() string { + return "" +} + +// Cases returns the Caser structure. +func (bct *BCasT) Cases() []Caser { + return bct.C +} + +// Tag represents the state for a Caser. +type Tag int32 + +const ( + // OKTag marks the desired state was reached. + OKTag = Tag(iota) + // FailTag means reaching this state will fail the Switch/Case. + FailTag + // ContinueTag will recheck for matches. + ContinueTag + // NextTag skips match and continues to the next one. + NextTag + // NoTag signals no tag was set for this case. + NoTag +) + +// OK returns the OK Tag and status. +func OK() func() (Tag, *Status) { + return func() (Tag, *Status) { + return OKTag, NewStatus(codes.OK, "state reached") + } +} + +// Fail returns Fail Tag and status. +func Fail(s *Status) func() (Tag, *Status) { + return func() (Tag, *Status) { + return FailTag, s + } +} + +// Continue returns the Continue Tag and status. +func Continue(s *Status) func() (Tag, *Status) { + return func() (Tag, *Status) { + return ContinueTag, s + } +} + +// Next returns the Next Tag and status. +func Next() func() (Tag, *Status) { + return func() (Tag, *Status) { + return NextTag, NewStatus(codes.Unimplemented, "Next returns not implemented") + } +} + +// LogContinue logs the message and returns the Continue Tag and status. +func LogContinue(msg string, s *Status) func() (Tag, *Status) { + return func() (Tag, *Status) { + log.Print(msg) + return ContinueTag, s + } +} + +// Caser is an interface for ExpectSwitchCase and Batch to be able to handle +// both the Case struct and the more script friendly BCase struct. +type Caser interface { + // RE returns a compiled regexp + RE() (*regexp.Regexp, error) + // Send returns the send string + String() string + // Tag returns the Tag. + Tag() (Tag, *Status) + // Retry returns true if there are retries left. + Retry() bool +} + +// Case used by the ExpectSwitchCase to take different Cases. +// Implements the Caser interface. +type Case struct { + // R is the compiled regexp to match. + R *regexp.Regexp + // S is the string to send if Regexp matches. + S string + // T is the Tag for this Case. + T func() (Tag, *Status) + // Rt specifies number of times to retry, only used for cases tagged with Continue. + Rt int +} + +// Tag returns the tag for this case. +func (c *Case) Tag() (Tag, *Status) { + if c.T == nil { + return NoTag, NewStatus(codes.OK, "no Tag set") + } + return c.T() +} + +// RE returns the compiled regular expression. +func (c *Case) RE() (*regexp.Regexp, error) { + return c.R, nil +} + +// Retry decrements the Retry counter and checks if there are any retries left. +func (c *Case) Retry() bool { + defer func() { c.Rt-- }() + return c.Rt > 0 +} + +// Send returns the string to send if regexp matches +func (c *Case) String() string { + return c.S +} + +// BCase with just a string is a bit more friendly to scripting. +// Implements the Caser interface. +type BCase struct { + // R contains the string regular expression. + R string + // S contains the string to be sent if R matches. + S string + // T contains the Tag. + T func() (Tag, *Status) + // Rt contains the number of retries. + Rt int +} + +// RE returns the compiled regular expression. +func (b *BCase) RE() (*regexp.Regexp, error) { + if b.R == "" { + return nil, nil + } + return regexp.Compile(b.R) +} + +// Send returns the string to send. +func (b *BCase) String() string { + return b.S +} + +// Tag returns the BCase Tag. +func (b *BCase) Tag() (Tag, *Status) { + if b.T == nil { + return NoTag, NewStatus(codes.OK, "no Tag set") + } + return b.T() +} + +// Retry decrements the Retry counter and checks if there are any retries left. +func (b *BCase) Retry() bool { + b.Rt-- + return b.Rt > -1 +} + +// Expecter interface primarily to make testing easier. +type Expecter interface { + // Expect reads output from a spawned session and tries matching it with the provided regular expression. + // It returns all output found until match. + Expect(*regexp.Regexp, time.Duration) (string, []string, error) + // ExpectBatch takes an array of BatchEntries and runs through them in order. For every Expect + // command a BatchRes entry is created with output buffer and sub matches. + // Failure of any of the batch commands will stop the execution, returning the results up to the + // failure. + ExpectBatch([]Batcher, time.Duration) ([]BatchRes, error) + // ExpectSwitchCase makes it possible to Expect with multiple regular expressions and actions. Returns the + // full output and submatches of the commands together with an index for the matching Case. + ExpectSwitchCase([]Caser, time.Duration) (string, []string, int, error) + // Send sends data into the spawned session. + Send(string) error + // Close closes the spawned session and files. + Close() error +} + +// GExpect implements the Expecter interface. +type GExpect struct { + // pty holds the virtual terminal used to interact with the spawned commands. + pty *term.PTY + // cmd contains the cmd information for the spawned process. + cmd *exec.Cmd + ssh *ssh.Session + // snd is the channel used by the Send command to send data into the spawned command. + snd chan string + // rcv is used to signal the Expect commands that new data arrived. + rcv chan struct{} + // chkMu lock protecting the check function. + chkMu sync.RWMutex + // chk contains the function to check if the spawned command is alive. + chk func(*GExpect) bool + // cls contains the function to close spawned command. + cls func(*GExpect) error + // timeout contains the default timeout for a spawned command. + timeout time.Duration + // chkDuration contains the duration between checks for new incoming data. + chkDuration time.Duration + // verbose enables verbose logging. + verbose bool + // verboseWriter if set specifies where to write verbose information. + verboseWriter io.Writer + + // mu protects the output buffer. It must be held for any operations on out. + mu sync.Mutex + out bytes.Buffer +} + +// String implements the stringer interface. +func (e *GExpect) String() string { + res := fmt.Sprintf("%p: ", e) + if e.pty != nil { + _, name := e.pty.PTSName() + res += fmt.Sprintf("pty: %s ", name) + } + switch { + case e.cmd != nil: + res += fmt.Sprintf("cmd: %s(%d) ", e.cmd.Path, e.cmd.Process.Pid) + case e.ssh != nil: + res += fmt.Sprint("ssh session ") + } + res += fmt.Sprintf("buf: %q", e.out.String()) + return res +} + +// ExpectBatch takes an array of BatchEntry and executes them in order filling in the BatchRes +// array for any Expect command executed. +func (e *GExpect) ExpectBatch(batch []Batcher, timeout time.Duration) ([]BatchRes, error) { + res := []BatchRes{} + for i, b := range batch { + switch b.Cmd() { + case BatchExpect: + re, err := regexp.Compile(b.Arg()) + if err != nil { + return res, err + } + to := b.Timeout() + if to < 0 { + to = timeout + } + out, match, err := e.Expect(re, to) + res = append(res, BatchRes{i, out, match}) + if err != nil { + return res, err + } + case BatchSend: + if err := e.Send(b.Arg()); err != nil { + return res, err + } + case BatchSwitchCase: + to := b.Timeout() + if to < 0 { + to = timeout + } + out, match, _, err := e.ExpectSwitchCase(b.Cases(), to) + res = append(res, BatchRes{i, out, match}) + if err != nil { + return res, err + } + default: + return res, errors.New("unknown command:" + strconv.Itoa(b.Cmd())) + } + } + return res, nil +} + +func (e *GExpect) check() bool { + e.chkMu.RLock() + defer e.chkMu.RUnlock() + return e.chk(e) +} + +// ExpectSwitchCase checks each Case against the accumulated out buffer, sending specified +// string back. Leaving Send empty will Send nothing to the process. +// Substring expansion can be used eg. +// Case{`vf[0-9]{2}.[a-z]{3}[0-9]{2}\.net).*UP`,`show arp \1`} +// Given: vf11.hnd01.net UP 35 (4) 34 (4) CONNECTED 0 0/0 +// Would send: show arp vf11.hnd01.net +func (e *GExpect) ExpectSwitchCase(cs []Caser, timeout time.Duration) (string, []string, int, error) { + // Compile all regexps + rs := make([]*regexp.Regexp, 0, len(cs)) + for _, c := range cs { + re, err := c.RE() + if err != nil { + return "", []string{""}, -1, err + } + rs = append(rs, re) + } + // Setup timeouts + // timeout == 0 => Just dump the buffer and exit. + // timeout < 0 => Set default value. + if timeout < 0 { + timeout = e.timeout + } + timer := time.NewTimer(timeout) + check := e.chkDuration + // Check if any new data arrived every checkDuration interval. + // If timeout/4 is less than the checkout interval we set the checkout to + // timeout/4. If timeout ends up being 0 we bump it to one to keep the Ticker from + // panicking. + // All this b/c of the unreliable channel send setup in the read function,making it + // possible for Expect* functions to miss the rcv signal. + // + // from read(): + // // Ping Expect function + // select { + // case e.rcv <- struct{}{}: + // default: + // } + // + // A signal is only sent if any Expect function is running. Expect could miss it + // while playing around with buffers and matching regular expressions. + if timeout>>2 < check { + check = timeout >> 2 + if check <= 0 { + check = 1 + } + } + chTicker := time.NewTicker(check) + defer chTicker.Stop() + // Read in current data and start actively check for matches. + var tbuf bytes.Buffer + if _, err := io.Copy(&tbuf, e); err != nil { + return tbuf.String(), nil, -1, fmt.Errorf("io.Copy failed: %v", err) + } + for { + L1: + for i, c := range cs { + if rs[i] == nil { + continue + } + match := rs[i].FindStringSubmatch(tbuf.String()) + if match == nil { + continue + } + + t, s := c.Tag() + if t == NextTag && !c.Retry() { + continue + } + + if e.verbose { + if e.verboseWriter != nil { + vStr := fmt.Sprintln(term.Green("Match for RE:").String() + fmt.Sprintf(" %q found: %q Buffer: %s", rs[i].String(), match, tbuf.String())) + for n, bytesRead, err := 0, 0, error(nil); bytesRead < len(vStr); bytesRead += n { + n, err = e.verboseWriter.Write([]byte(vStr)[n:]) + if err != nil { + log.Printf("Write to Verbose Writer failed: %v", err) + break + } + } + } else { + log.Printf("Match for RE: %q found: %q Buffer: %q", rs[i].String(), match, tbuf.String()) + } + } + + // Clear the buffer directly after match. + o := tbuf.String() + tbuf.Reset() + + st := c.String() + // Replace the submatches \[0-9]+ in the send string. + if len(match) > 1 && len(st) > 0 { + for i := 1; i < len(match); i++ { + // \(submatch) will be expanded in the Send string. + // To escape use \\(number). + si := strconv.Itoa(i) + r := strings.NewReplacer(`\\`+si, `\`+si, `\`+si, `\\`+si) + st = r.Replace(st) + st = strings.Replace(st, `\\`+si, match[i], -1) + } + } + // Don't send anything if string is empty. + if st != "" { + if err := e.Send(st); err != nil { + return o, match, i, fmt.Errorf("failed to send: %q err: %v", st, err) + } + } + // Tag handling. + switch t { + case OKTag, FailTag, NoTag: + return o, match, i, s.Err() + case ContinueTag: + if !c.Retry() { + return o, match, i, s.Err() + } + break L1 + case NextTag: + break L1 + default: + s = NewStatusf(codes.Unknown, "Tag: %d unknown, err: %v", t, s) + } + return o, match, i, s.Err() + } + if !e.check() { + nr, err := io.Copy(&tbuf, e) + if err != nil { + return tbuf.String(), nil, -1, fmt.Errorf("io.Copy failed: %v", err) + } + if nr == 0 { + return tbuf.String(), nil, -1, errors.New("expect: Process not running") + } + } + select { + case <-timer.C: + // Expect timeout. + nr, err := io.Copy(&tbuf, e) + if err != nil { + return tbuf.String(), nil, -1, fmt.Errorf("io.Copy failed: %v", err) + } + // If we got no new data we return otherwise give it another chance to match. + if nr == 0 { + return tbuf.String(), nil, -1, TimeoutError(timeout) + } + timer = time.NewTimer(timeout) + case <-chTicker.C: + // Periodical timer to make sure data is handled in case the <-e.rcv channel + // was missed. + if _, err := io.Copy(&tbuf, e); err != nil { + return tbuf.String(), nil, -1, fmt.Errorf("io.Copy failed: %v", err) + } + case <-e.rcv: + // Data to fetch. + if _, err := io.Copy(&tbuf, e); err != nil { + return tbuf.String(), nil, -1, fmt.Errorf("io.Copy failed: %v", err) + } + } + } +} + +// GenOptions contains the options needed to set up a generic Spawner. +type GenOptions struct { + // In is where Expect Send messages will be written. + In io.WriteCloser + // Out will be read and matched by the expecter. + Out io.Reader + // Wait is used by expect to know when the session is over and cleanup of io Go routines should happen. + Wait func() error + // Close will be called as part of the expect Close, should normally include a Close of the In WriteCloser. + Close func() error + // Check is called everytime a Send or Expect function is called to makes sure the session is still running. + Check func() bool +} + +// SpawnGeneric is used to write generic Spawners. It returns an Expecter. The returned channel will give the return +// status of the spawned session, in practice this means the return value of the provided Wait function. +func SpawnGeneric(opt *GenOptions, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) { + switch { + case opt == nil: + return nil, nil, errors.New("GenOptions is ") + case opt.In == nil: + return nil, nil, errors.New("In can't be ") + case opt.Out == nil: + return nil, nil, errors.New("Out can't be ") + case opt.Wait == nil: + return nil, nil, errors.New("Wait can't be ") + case opt.Close == nil: + return nil, nil, errors.New("Close can't be ") + case opt.Check == nil: + return nil, nil, errors.New("Check can't be ") + } + if timeout < 1 { + timeout = DefaultTimeout + } + e := &GExpect{ + rcv: make(chan struct{}), + snd: make(chan string), + timeout: timeout, + chkDuration: checkDuration, + cls: func(e *GExpect) error { + return opt.Close() + }, + chk: func(e *GExpect) bool { + return opt.Check() + }, + } + for _, o := range opts { + o(e) + } + errCh := make(chan error, 1) + go e.waitForSession(errCh, opt.Wait, opt.In, opt.Out, nil) + return e, errCh, nil +} + +// SpawnFake spawns an expect.Batcher. +func SpawnFake(b []Batcher, timeout time.Duration, opt ...Option) (*GExpect, <-chan error, error) { + rr, rw := io.Pipe() + wr, ww := io.Pipe() + done := make(chan struct{}) + srv, _, err := SpawnGeneric(&GenOptions{ + In: ww, + Out: rr, + Wait: func() error { + <-done + return nil + }, + Close: func() error { + return ww.Close() + }, + Check: func() bool { return true }, + }, timeout, opt...) + if err != nil { + return nil, nil, err + } + + go func() { + res, err := srv.ExpectBatch(b, timeout) + if err != nil { + log.Printf("ExpectBatch(%v,%v) failed: %v, out: %v", b, timeout, err, res) + } + close(done) + }() + + return SpawnGeneric(&GenOptions{ + In: rw, + Out: wr, + Close: func() error { + return rw.Close() + }, + Check: func() bool { return true }, + Wait: func() error { + <-done + return nil + }, + }, timeout, opt...) +} + +// SpawnWithArgs starts a new process and collects the output. The error +// channel returns the result of the command Spawned when it finishes. +// Arguments may contain spaces. +func SpawnWithArgs(command []string, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) { + pty, err := term.OpenPTY() + if err != nil { + return nil, nil, err + } + var t term.Termios + t.Raw() + t.Set(pty.Slave) + + if timeout < 1 { + timeout = DefaultTimeout + } + // Get the command up and running + cmd := exec.Command(command[0], command[1:]...) + // This ties the commands Stdin,Stdout & Stderr to the virtual terminal we created + cmd.Stdin, cmd.Stdout, cmd.Stderr = pty.Slave, pty.Slave, pty.Slave + // New process needs to be the process leader and control of a tty + cmd.SysProcAttr = &syscall.SysProcAttr{ + Setsid: true, + Setctty: true} + e := &GExpect{ + rcv: make(chan struct{}), + snd: make(chan string), + cmd: cmd, + timeout: timeout, + chkDuration: checkDuration, + pty: pty, + cls: func(e *GExpect) error { + if e.cmd != nil { + return e.cmd.Process.Kill() + } + return nil + }, + chk: func(e *GExpect) bool { + if e.cmd.Process == nil { + return false + } + // Sending Signal 0 to a process returns nil if process can take a signal , something else if not. + return e.cmd.Process.Signal(syscall.Signal(0)) == nil + }, + } + for _, o := range opts { + o(e) + } + + res := make(chan error, 1) + go e.runcmd(res) + // Wait until command started + return e, res, <-res +} + +// Spawn starts a new process and collects the output. The error channel +// returns the result of the command Spawned when it finishes. Arguments may +// not contain spaces. +func Spawn(command string, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) { + return SpawnWithArgs(strings.Fields(command), timeout, opts...) +} + +// SpawnSSH starts an interactive SSH session,ties it to a PTY and collects the output. The returned channel sends the +// state of the SSH session after it finishes. +func SpawnSSH(sshClient *ssh.Client, timeout time.Duration, opts ...Option) (*GExpect, <-chan error, error) { + tios := term.Termios{} + tios.Raw() + tios.Wz.WsCol, tios.Wz.WsRow = sshTermWidth, sshTermHeight + return SpawnSSHPTY(sshClient, timeout, tios, opts...) +} + +const ( + sshTerm = "xterm" + sshTermWidth = 132 + sshTermHeight = 43 +) + +// SpawnSSHPTY starts an interactive SSH session and ties it to a local PTY, optionally requests a remote PTY. +func SpawnSSHPTY(sshClient *ssh.Client, timeout time.Duration, term term.Termios, opts ...Option) (*GExpect, <-chan error, error) { + if sshClient == nil { + return nil, nil, errors.New("*ssh.Client is nil") + } + if timeout < 1 { + timeout = DefaultTimeout + } + // Setup interactive session + session, err := sshClient.NewSession() + if err != nil { + return nil, nil, err + } + e := &GExpect{ + rcv: make(chan struct{}), + snd: make(chan string), + chk: func(e *GExpect) bool { + if e.ssh == nil { + return false + } + _, err := e.ssh.SendRequest("dummy", false, nil) + return err == nil + }, + cls: func(e *GExpect) error { + if e.ssh != nil { + return e.ssh.Close() + } + return nil + }, + ssh: session, + timeout: timeout, + chkDuration: checkDuration, + } + for _, o := range opts { + o(e) + } + if term.Wz.WsCol == 0 { + term.Wz.WsCol = sshTermWidth + } + if term.Wz.WsRow == 0 { + term.Wz.WsRow = sshTermHeight + } + if err := session.RequestPty(sshTerm, int(term.Wz.WsRow), int(term.Wz.WsCol), term.ToSSH()); err != nil { + return nil, nil, err + } + inPipe, err := session.StdinPipe() + if err != nil { + return nil, nil, err + } + outPipe, err := session.StdoutPipe() + if err != nil { + return nil, nil, err + } + errPipe, err := session.StderrPipe() + if err != nil { + return nil, nil, err + } + if err := session.Shell(); err != nil { + return nil, nil, err + } + // Shell started. + errCh := make(chan error, 1) + go e.waitForSession(errCh, session.Wait, inPipe, outPipe, errPipe) + return e, errCh, nil +} + +func (e *GExpect) waitForSession(r chan error, wait func() error, sIn io.WriteCloser, sOut io.Reader, sErr io.Reader) { + chDone := make(chan struct{}) + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + for { + select { + case <-chDone: + return + case sstr, ok := <-e.snd: + if !ok { + log.Printf("Send channel closed") + return + } + if _, err := sIn.Write([]byte(sstr)); err != nil || !e.check() { + log.Printf("Write failed: %v", err) + return + } + } + } + }() + rdr := func(out io.Reader) { + defer wg.Done() + buf := make([]byte, bufferSize) + for { + nr, err := out.Read(buf) + if err != nil || !e.check() { + if err == io.EOF { + if e.verbose { + log.Printf("read closing down: %v", err) + } + return + } + return + } + e.mu.Lock() + e.out.Write(buf[:nr]) + e.mu.Unlock() + // Inform Expect (if it's currently running) that there's some new data to look through. + select { + case e.rcv <- struct{}{}: + default: + } + } + } + wg.Add(1) + go rdr(sOut) + if sErr != nil { + wg.Add(1) + go rdr(sErr) + } + err := wait() + close(chDone) + wg.Wait() + r <- err +} + +// Close closes the Spawned session. +func (e *GExpect) Close() error { + return e.cls(e) +} + +// Read implements the reader interface for the out buffer. +func (e *GExpect) Read(p []byte) (nr int, err error) { + e.mu.Lock() + defer e.mu.Unlock() + return e.out.Read(p) +} + +// Send sends a string to spawned process. +func (e *GExpect) Send(in string) error { + if !e.check() { + return errors.New("expect: Process not running") + } + e.snd <- in + if e.verbose { + if e.verboseWriter != nil { + vStr := fmt.Sprintln(term.Blue("Sent:").String() + fmt.Sprintf(" %q", in)) + for n, bytesRead, err := 0, 0, error(nil); bytesRead < len(vStr); bytesRead += n { + n, err = e.verboseWriter.Write([]byte(vStr)[n:]) + if err != nil { + log.Printf("Write to Verbose Writer failed: %v", err) + break + } + return nil + } + } + log.Printf("Sent: %q", in) + } + return nil +} + +// runcmd executes the command and Wait for the return value. +func (e *GExpect) runcmd(res chan error) { + if err := e.cmd.Start(); err != nil { + res <- err + return + } + // Moving the go read/write functions here makes sure the command is started before first checking if it's running. + clean := make(chan struct{}) + chDone := e.goIO(clean) + // Signal command started + res <- nil + cErr := e.cmd.Wait() + close(chDone) + e.pty.Slave.Close() + // make sure the read/send routines are done before closing the pty. + <-clean + res <- cErr +} + +// goIO starts the io handlers. +func (e *GExpect) goIO(clean chan struct{}) (done chan struct{}) { + done = make(chan struct{}) + var ptySync sync.WaitGroup + ptySync.Add(2) + go e.read(done, &ptySync) + go e.send(done, &ptySync) + go func() { + ptySync.Wait() + e.pty.Master.Close() + close(clean) + }() + return done +} + +// Expect reads spawned processes output looking for input regular expression. +// Timeout set to 0 makes Expect return the current buffer. +// Negative timeout value sets it to Default timeout. +func (e *GExpect) Expect(re *regexp.Regexp, timeout time.Duration) (string, []string, error) { + out, match, _, err := e.ExpectSwitchCase([]Caser{&Case{re, "", nil, 0}}, timeout) + return out, match, err +} + +// Options sets the specified options. +func (e *GExpect) Options(opts ...Option) (prev Option) { + for _, o := range opts { + prev = o(e) + } + return prev +} + +// read reads from the PTY master and forwards to active Expect function. +func (e *GExpect) read(done chan struct{}, ptySync *sync.WaitGroup) { + defer ptySync.Done() + buf := make([]byte, bufferSize) + for { + nr, err := e.pty.Master.Read(buf) + if err != nil || !e.check() { + if err == io.EOF { + if e.verbose { + log.Printf("read closing down: %v", err) + } + return + } + return + } + // Add to buffer + e.mu.Lock() + e.out.Write(buf[:nr]) + e.mu.Unlock() + // Ping Expect function + select { + case e.rcv <- struct{}{}: + default: + } + } +} + +// send writes to the PTY master. +func (e *GExpect) send(done chan struct{}, ptySync *sync.WaitGroup) { + defer ptySync.Done() + for { + select { + case <-done: + return + case sstr, ok := <-e.snd: + if !ok { + return + } + if _, err := e.pty.Master.Write([]byte(sstr)); err != nil || !e.check() { + log.Printf("send failed: %v", err) + break + } + } + } +} diff --git a/vendor/github.com/google/goterm/AUTHORS b/vendor/github.com/google/goterm/AUTHORS new file mode 100644 index 0000000000..15167cd746 --- /dev/null +++ b/vendor/github.com/google/goterm/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/google/goterm/LICENSE b/vendor/github.com/google/goterm/LICENSE new file mode 100644 index 0000000000..931520b99e --- /dev/null +++ b/vendor/github.com/google/goterm/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2015 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/google/goterm/term/color.go b/vendor/github.com/google/goterm/term/color.go new file mode 100644 index 0000000000..4bba716073 --- /dev/null +++ b/vendor/github.com/google/goterm/term/color.go @@ -0,0 +1,677 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package term + +/* +Some simple functions to add colors and attributes to terminals. + +The base colors are types implementing the Stringer interface, this makes +it very simple to give a color to arbitrary strings. Also handy to have the raw string still +available for comparisons and such. + + g := Green("Green world") + fmt.Println("Hello",g) + fmt.Println(Red("Warning!")) + + var col fmt.Stringer + switch { + case atk == 0: + col = Blue("5 FADE OUT") + case atk < 4: + col = Green("4 DOUBLE TAKE") + case atk <10: + col = Yellow("3 ROUND HOUSE") + case atk <50: + col = Red("2 FAST PACE") + case atk >= 50: + col = Blinking("1 COCKED PISTOL") + } + fmt.Println("Defcon: ",col) +*/ + +import ( + "errors" + "fmt" + "math/rand" + "strconv" +) + +type stringer interface { + String() string +} + +// colorEnable toggles colors on/off. +var colorEnable = true + +// ColorEnable activates the terminal colors , this is the default. +func ColorEnable() { + colorEnable = true +} + +// ColorDisable disables the terminal colors. +func ColorDisable() { + colorEnable = false +} + +// Terminal Color and modifier codes +const ( + CSI = "\033[" + FgBlack = "30" + FgRed = "31" + FgGreen = "32" + FgYellow = "33" + FgBlue = "34" + FgMagenta = "35" + FgCyan = "36" + FgWhite = "37" + FgDefault = "39" + F256 = "38" + BgBlack = "40" + BgRed = "41" + BgGreen = "42" + BgYellow = "43" + BgBlue = "44" + BgMagenta = "45" + BgCyan = "46" + BgWhite = "47" + BgDefault = "49" + Bg256 = "48" + Blink = "5" + Ital = "3" + Underln = "4" + Faint = "2" + Bld = "1" + NoMode = "0" +) + +// Standard colors +// Foreground + +// Green implements the Stringer interface to print string foreground in Green color. +type Green string + +// Blue implements the Stringer interface to print string foreground in Blue color. +type Blue string + +// Red implements the Stringer interface to print string foreground in Red color. +type Red string + +// Yellow implements the Stringer interface to print string foreground in Yellow color. +type Yellow string + +// Magenta implements the Stringer interface to print string foreground in Magenta color. +type Magenta string + +// Cyan implements the Stringer interface to print string foreground in Cyan color. +type Cyan string + +// White implements the Stringer interface to print string foreground in White color. +type White string + +// Black implements the Stringer interface to print string foreground in Black color. +type Black string + +// Random implements the Stringer interface to print string foreground in Random color. +type Random string + +// Background + +// BGreen implements the Stringer interface to print string background in Green color. +type BGreen string + +// BBlue implements the Stringer interface to print string background in Blue color. +type BBlue string + +// BRed implements the Stringer interface to print string background in Red color. +type BRed string + +// BYellow implements the Stringer interface to print string background in Yellow color. +type BYellow string + +// BRandom implements the Stringer interface to print string background in Random color. +type BRandom string + +// BMagenta implements the Stringer interface to print string background in Magenta color. +type BMagenta string + +// BCyan implements the Stringer interface to print string background in Cyan color. +type BCyan string + +// BWhite implements the Stringer interface to print string background in White color. +type BWhite string + +// BBlack implements the Stringer interface to print string background in Black color. +type BBlack string + +// Set color + +// Color is the type returned by the colour setters to print any terminal colour. +type Color string + +// ColorRandom implements the Stringer interface to print string Random color. +type ColorRandom string + +// Color256Random implements the Stringer interface to print string random 256 color Term style. +type Color256Random string + +// Some modifiers + +// Blinking implements the Stringer interface to print string in Blinking mode. +type Blinking string + +// Underline implements the Stringer interface to print string in Underline mode. +type Underline string + +// Bold implements the Stringer interface to print string in Bold mode. +type Bold string + +//type Bright string -- Doesn't seem to work well + +// Italic implements the Stringer interface to print string foreground in Italic color. +type Italic string + +// colType takes all the base color types and generates proper modifiers. +func colType(col stringer) string { + nMode := FgDefault + var mode, res string + switch c := col.(type) { + case Black: + mode = FgBlack + res = string(c) + case Red: + mode = FgRed + res = string(c) + case Green: + mode = FgGreen + res = string(c) + case Yellow: + mode = FgYellow + res = string(c) + case Blue: + mode = FgBlue + res = string(c) + case Magenta: + mode = FgMagenta + res = string(c) + case Cyan: + mode = FgCyan + res = string(c) + case White: + mode = FgWhite + res = string(c) + case BBlack: + mode = BgBlack + res = string(c) + case BRed: + mode = BgRed + nMode = BgDefault + res = string(c) + case BGreen: + mode = BgGreen + nMode = BgDefault + res = string(c) + case BYellow: + mode = BgYellow + nMode = BgDefault + res = string(c) + case BBlue: + mode = BgBlue + nMode = BgDefault + res = string(c) + case BMagenta: + mode = BgMagenta + nMode = BgDefault + res = string(c) + case BCyan: + mode = BgCyan + nMode = BgDefault + res = string(c) + case BWhite: + mode = BgWhite + nMode = BgDefault + res = string(c) + case Blinking: + mode = Blink + nMode = NoMode + res = string(c) + case Italic: + mode = Ital + nMode = NoMode + res = string(c) + case Underline: + mode = Underln + nMode = NoMode + res = string(c) + case Bold: + nMode = NoMode + mode = Bld + res = string(c) + default: + return "unsupported type" + } + if !colorEnable { + return res + } + return CSI + mode + "m" + res + CSI + nMode + "m" +} + +// Stringers for all the base colors , just fill it in with something and print it +// Foreground + +// String implements the Stringer interface for type Green. +func (c Green) String() string { + return colType(c) +} + +// Greenf returns a Green formatted string. +func Greenf(format string, a ...interface{}) string { + return colType(Green(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type Blue. +func (c Blue) String() string { + return colType(c) +} + +// Bluef returns a Blue formatted string. +func Bluef(format string, a ...interface{}) string { + return colType(Blue(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type Red. +func (c Red) String() string { + return colType(c) +} + +// Redf returns a Red formatted string. +func Redf(format string, a ...interface{}) string { + return colType(Red(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type Yellow. +func (c Yellow) String() string { + return colType(c) +} + +// Yellowf returns a Yellow formatted string. +func Yellowf(format string, a ...interface{}) string { + return colType(Yellow(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type Magenta. +func (c Magenta) String() string { + return colType(c) +} + +// Magentaf returns a Magenta formatted string. +func Magentaf(format string, a ...interface{}) string { + return colType(Magenta(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type White. +func (c White) String() string { + return colType(c) +} + +// Whitef returns a White formatted string. +func Whitef(format string, a ...interface{}) string { + return colType(White(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type Black. +func (c Black) String() string { + return colType(c) +} + +// Blackf returns a Black formatted string. +func Blackf(format string, a ...interface{}) string { + return colType(Black(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type Cyan. +func (c Cyan) String() string { + return colType(c) +} + +// Cyanf returns a Cyan formatted string. +func Cyanf(format string, a ...interface{}) string { + return colType(Cyan(fmt.Sprintf(format, a...))) +} + +// Background + +// String implements the Stringer interface for type BGreen. +func (c BGreen) String() string { + return colType(c) +} + +// BGreenf returns a BGreen formatted string. +func BGreenf(format string, a ...interface{}) string { + return colType(BGreen(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BBlue. +func (c BBlue) String() string { + return colType(c) +} + +// BBluef returns a BBlue formatted string. +func BBluef(format string, a ...interface{}) string { + return colType(BBlue(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BRed. +func (c BRed) String() string { + return colType(c) +} + +// BRedf returns a BRed formatted string. +func BRedf(format string, a ...interface{}) string { + return colType(BRed(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BYellow. +func (c BYellow) String() string { + return colType(c) +} + +// BYellowf returns a BYellow formatted string. +func BYellowf(format string, a ...interface{}) string { + return colType(BYellow(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BMagenta. +func (c BMagenta) String() string { + return colType(c) +} + +// BMagentaf returns a BMagenta formatted string. +func BMagentaf(format string, a ...interface{}) string { + return colType(BMagenta(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BWhite. +func (c BWhite) String() string { + return colType(c) +} + +// BWhitef returns a BWhite formatted string. +func BWhitef(format string, a ...interface{}) string { + return colType(BWhite(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BBlack. +func (c BBlack) String() string { + return colType(c) +} + +// BBlackf returns a BBlack formatted string. +func BBlackf(format string, a ...interface{}) string { + return colType(BBlack(fmt.Sprintf(format, a...))) +} + +// String implements the Stringer interface for type BCyan. +func (c BCyan) String() string { + return colType(c) +} + +// BCyanf returns a BCyan formatted string. +func BCyanf(format string, a ...interface{}) string { + return colType(BCyan(fmt.Sprintf(format, a...))) +} + +// Modifier codes + +// String implements the Stringer interface for type Blinking. +func (c Blinking) String() string { + return colType(c) +} + +// String implements the Stringer interface for type Underline. +func (c Underline) String() string { + return colType(c) +} + +// String implements the Stringer interface for type Bold. +func (c Bold) String() string { + return colType(c) +} + +// String implements the Stringer interface for type Italic. +func (c Italic) String() string { + return colType(c) +} + +// NewColor gives a type Color back with specified fg/bg colors set that can +// be printed with anything using the Stringer iface. +func NewColor(str string, fg string, bg string) (Color, error) { + if fg != "" { + ifg, err := strconv.Atoi(fg) + if err != nil { + return Color(""), err + } + if ifg < 30 && ifg > 37 { + return Color(""), errors.New("fg: " + fg + "not a valid color 30-37") + } + } else { + fg = FgDefault + } + if bg != "" { + ibg, err := strconv.Atoi(bg) + if err != nil { + return Color(""), err + } + if ibg < 40 && ibg > 47 { + return Color(""), errors.New("fg: " + fg + "not a valid color 40-47") + } + } else { + bg = BgDefault + } + return Color(CSI + fg + ";" + bg + "m" + str + CSI + FgDefault + ";" + BgDefault + "m"), nil +} + +// String the stringer interface for all base color types. +func (c Color) String() string { + if !colorEnable { + clean := make([]byte, 0, len(c)) + src := []byte(c) + L1: + for i := 0; i < len(src); i++ { + // Shortest possible mod. + if len(src) < i+4 { + clean = append(clean, src[i:]...) + return string(clean) + } + if string(src[i:i+2]) == CSI { + // Save current index incase this is not a term mod code. + s := i + // skip forward to end of mod + for i += 2; i < len(src); i++ { + switch src[i] { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ';': + // Legal characters in a term mod code. + continue + case 'm': + // End of the term mod code. + continue L1 + default: + // Not a term mod code. + i = s + break + } + } + } + clean = append(clean, src[i]) + } + return string(clean) + } + return string(c) +} + +// NewColor256 gives a type Color back using Term 256 color that can be printed with anything using the Stringer iface. +func NewColor256(str string, fg string, bg string) (Color, error) { + if fg != "" { + ifg, err := strconv.Atoi(fg) + if err != nil { + return Color(""), err + } + if ifg < 0 && ifg > 256 { + return Color(""), errors.New("fg: " + fg + " not a valid color 0-256") + } + } + if bg != "" { + ibg, err := strconv.Atoi(bg) + if err != nil { + return Color(""), err + } + if ibg < 0 && ibg > 256 { + return Color(""), errors.New("bg: " + bg + " not a valid color 0-256") + } + } + tstr := CSI + F256 + ";5;" + fg + ";" + Bg256 + ";5;" + bg + "m" + tstr += str + return Color(tstr + CSI + FgDefault + ";5;" + BgDefault + ";5;" + "m"), nil +} + +// NewColorRGB takes R G B and returns a ColorRGB type that can be printed by anything using the Stringer iface. +// Only Konsole to my knowledge that supports 24bit color +func NewColorRGB(str string, red uint8, green uint8, blue uint8) Color { + ired := strconv.Itoa(int(red)) + igreen := strconv.Itoa(int(green)) + iblue := strconv.Itoa(int(blue)) + tstr := CSI + F256 + ";2;" + ired + ";" + igreen + ";" + iblue + "m" + tstr += str + return Color(tstr + CSI + FgDefault + ";5;" + BgDefault + ";5;" + "m") +} + +// String is a random color stringer. +func (c ColorRandom) String() string { + if !colorEnable { + return string(c) + } + ifg := rand.Int()%8 + 30 + ibg := rand.Int()%8 + 40 + res := CSI + strconv.Itoa(ifg) + ";" + strconv.Itoa(ibg) + "m" + res += string(c) + res += CSI + strconv.Itoa(ifg) + ";" + strconv.Itoa(ibg) + "m" + return res +} + +// String gives a random fg color everytime it's printed. +func (c Random) String() string { + if !colorEnable { + return string(c) + } + ifg := int(rand.Int()%8 + 30) + res := CSI + strconv.Itoa(ifg) + "m" + res += string(c) + strconv.Itoa(int(ifg)) + res += CSI + FgDefault + "m" + return res +} + +// String gives a random bg color everytime it's printed. +func (c BRandom) String() string { + if !colorEnable { + return string(c) + } + ibg := rand.Int()%8 + 40 + res := CSI + strconv.Itoa(ibg) + "m" + res += string(c) + strconv.Itoa(ibg) + res += CSI + BgDefault + "m" + return res +} + +// NewCombo Takes a combination of modes and return a string with them all combined. +func NewCombo(s string, mods ...string) Color { + var col, bcol, mod bool + modstr := CSI + tracking := make(map[string]bool) + for _, m := range mods { + switch m { + case FgBlack, FgRed, FgGreen, FgYellow, FgBlue, FgMagenta, FgCyan, FgWhite: + if col { + continue + } + col = true + case BgBlack, BgRed, BgGreen, BgYellow, BgBlue, BgMagenta, BgCyan, BgWhite: + if bcol { + continue + } + bcol = true + case Bld, Faint, Ital, Underln, Blink: + if tracking[m] { + continue + } + tracking[m] = true + mod = true + default: + continue + } + modstr += m + ";" + } + end := CSI + if col { + end += FgDefault + } + if bcol { + if col { + end += ";" + } + end += BgDefault + } + if mod { + if col || bcol { + end += ";" + } + end += NoMode + } + end += "m" + modstr = modstr[:len(modstr)-1] + "m" + modstr += s + modstr += end + return Color(modstr) +} + +// TestTerm tries out most of the functions in this package and return +// a colourful string. Could be used to check what your terminal supports. +func TestTerm() string { + res := "Standard 8:\n" + res += "Fg:\t" + for c := 30; c < 38; c++ { + tres, _ := NewColor("#", strconv.Itoa(c), "") + res += tres.String() + } + res += "\nBg:\t" + for c := 40; c < 48; c++ { + tres, _ := NewColor(" ", "", strconv.Itoa(c)) + res += tres.String() + } + res += "\nStandard 16:\t" + for c := 0; c < 16; c++ { + tcol, _ := NewColor256(" ", "", strconv.Itoa(c)) + res += tcol.String() + } + res += "\n" + res += "256 Col:\n" + // 6x6x6 cubes are trendy + for row, base := 1, 0; row <= 6; row++ { + base = (row * 6) + 9 // Step over the first 16 base colors + for cubes := 1; cubes <= 6; cubes++ { + for column := 1; column <= 6; column++ { + tcol, _ := NewColor256(" ", "", strconv.Itoa(base+column)) + res += tcol.String() + } + base += 36 // 6 * 6 + } + res += "\n" + } + // Grayscale left. + res += "Grayscales:\n" + for c := 232; c <= 255; c++ { + tcol, _ := NewColor256(" ", "", strconv.Itoa(c)) + res += tcol.String() + } + return res +} diff --git a/vendor/github.com/google/goterm/term/ssh.go b/vendor/github.com/google/goterm/term/ssh.go new file mode 100644 index 0000000000..2e7619cec6 --- /dev/null +++ b/vendor/github.com/google/goterm/term/ssh.go @@ -0,0 +1,203 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + + +package term + +const ( + // Terminal attribute types. + sshIflag = iota + sshOflag + sshCflag + sshLflag + sshCchar + sshTspeed + sshNOP + + // SSH terminal attributes. + sshTTYOPEND = 0 + sshVINTR = 1 + sshVQUIT = 2 + sshVERASE = 3 + sshVKILL = 4 + sshVEOF = 5 + sshVEOL = 6 + sshVEOL2 = 7 + sshVSTART = 8 + sshVSTOP = 9 + sshVSUSP = 10 + sshVDSUSP = 11 + sshVREPRINT = 12 + sshVWERASE = 13 + sshVLNEXT = 14 + sshVFLUSH = 15 + sshVSWTCH = 16 + sshVSTATUS = 17 + sshVDISCARD = 18 + sshIGNPAR = 30 + sshPARMRK = 31 + sshINPCK = 32 + sshISTRIP = 33 + sshINLCR = 34 + sshIGNCR = 35 + sshICRNL = 36 + sshIUCLC = 37 + sshIXON = 38 + sshIXANY = 39 + sshIXOFF = 40 + sshIMAXBEL = 41 + sshISIG = 50 + sshICANON = 51 + sshXCASE = 52 + sshECHO = 53 + sshECHOE = 54 + sshECHOK = 55 + sshECHONL = 56 + sshNOFLSH = 57 + sshTOSTOP = 58 + sshIEXTEN = 59 + sshECHOCTL = 60 + sshECHOKE = 61 + sshPENDIN = 62 + sshOPOST = 70 + sshOLCUC = 71 + sshONLCR = 72 + sshOCRNL = 73 + sshONOCR = 74 + sshONLRET = 75 + sshCS7 = 90 + sshCS8 = 91 + sshPARENB = 92 + sshPARODD = 93 + sshTTYOPISPEED = 128 + sshTTYOPOSPEED = 129 +) + +var convertSSH = map[uint8]struct { + tType uint + native uint32 +}{ + sshTTYOPEND: {tType: sshNOP}, + sshVINTR: {tType: sshCchar, native: VINTR}, + sshVQUIT: {tType: sshCchar, native: VQUIT}, + sshVERASE: {tType: sshCchar, native: VERASE}, + sshVKILL: {tType: sshCchar, native: VKILL}, + sshVEOF: {tType: sshCchar, native: VEOF}, + sshVEOL: {tType: sshCchar, native: VEOL}, + sshVEOL2: {tType: sshCchar, native: VEOL2}, + sshVSTART: {tType: sshCchar, native: VSTART}, + sshVSTOP: {tType: sshCchar, native: VSTOP}, + sshVSUSP: {tType: sshCchar, native: VSUSP}, + sshVDSUSP: {tType: sshCchar, native: sshNOP}, + sshVREPRINT: {tType: sshCchar, native: VREPRINT}, + sshVWERASE: {tType: sshCchar, native: VWERASE}, + sshVLNEXT: {tType: sshCchar, native: VLNEXT}, + sshVFLUSH: {tType: sshNOP}, + sshVSWTCH: {tType: sshCchar, native: VSWTC}, + sshVSTATUS: {tType: sshNOP}, + sshVDISCARD: {tType: sshCchar, native: VDISCARD}, + sshIGNPAR: {tType: sshIflag, native: IGNPAR}, + sshPARMRK: {tType: sshIflag, native: PARMRK}, + sshINPCK: {tType: sshIflag, native: INPCK}, + sshISTRIP: {tType: sshIflag, native: ISTRIP}, + sshINLCR: {tType: sshIflag, native: INLCR}, + sshIGNCR: {tType: sshIflag, native: IGNCR}, + sshICRNL: {tType: sshIflag, native: ICRNL}, + sshIUCLC: {tType: sshIflag, native: IUCLC}, + sshIXON: {tType: sshIflag, native: IXON}, + sshIXANY: {tType: sshIflag, native: IXANY}, + sshIXOFF: {tType: sshIflag, native: IXOFF}, + sshIMAXBEL: {tType: sshIflag, native: IMAXBEL}, + sshISIG: {tType: sshLflag, native: ISIG}, + sshICANON: {tType: sshLflag, native: ICANON}, + sshXCASE: {tType: sshLflag, native: XCASE}, + sshECHO: {tType: sshLflag, native: ECHO}, + sshECHOE: {tType: sshLflag, native: ECHOE}, + sshECHOK: {tType: sshLflag, native: ECHOK}, + sshECHONL: {tType: sshLflag, native: ECHONL}, + sshNOFLSH: {tType: sshLflag, native: NOFLSH}, + sshTOSTOP: {tType: sshLflag, native: TOSTOP}, + sshIEXTEN: {tType: sshLflag, native: IEXTEN}, + sshECHOCTL: {tType: sshLflag, native: ECHOCTL}, + sshECHOKE: {tType: sshLflag, native: ECHOKE}, + sshPENDIN: {tType: sshNOP}, + sshOPOST: {tType: sshOflag, native: OPOST}, + sshOLCUC: {tType: sshOflag, native: OLCUC}, + sshONLCR: {tType: sshOflag, native: ONLCR}, + sshOCRNL: {tType: sshOflag, native: OCRNL}, + sshONOCR: {tType: sshOflag, native: ONOCR}, + sshONLRET: {tType: sshOflag, native: ONLRET}, + sshCS7: {tType: sshCflag, native: CS7}, + sshCS8: {tType: sshCflag, native: CS8}, + sshPARENB: {tType: sshCflag, native: PARENB}, + sshPARODD: {tType: sshCflag, native: PARODD}, + sshTTYOPISPEED: {tType: sshTspeed}, + sshTTYOPOSPEED: {tType: sshTspeed}, +} + +// ToSSH converts the Termios attributes to SSH attributes usable as ssh.TerminalModes. +func (t *Termios) ToSSH() map[uint8]uint32 { + sshModes := make(map[uint8]uint32, len(convertSSH)) + var flags uint32 + for sshID, tios := range convertSSH { + switch tios.tType { + case sshIflag: + flags = t.Iflag + case sshOflag: + flags = t.Oflag + case sshLflag: + flags = t.Lflag + case sshCflag: + flags = t.Cflag + case sshCchar: + sshModes[sshID] = uint32(t.Cc[tios.native]) + continue + case sshTspeed: + sshModes[sshTTYOPISPEED], sshModes[sshTTYOPOSPEED] = t.Ispeed, t.Ospeed + continue + default: + continue + } + var onOff uint32 + if tios.native&flags > 0 { + onOff = 1 + } + sshModes[sshID] = onOff + } + return sshModes +} + +// FromSSH converts SSH attributes to Termios attributes. +func (t *Termios) FromSSH(termModes map[uint8]uint32) { + var flags *uint32 + for sshID, val := range termModes { + switch convertSSH[sshID].tType { + case sshIflag: + flags = &t.Iflag + case sshOflag: + flags = &t.Oflag + case sshLflag: + flags = &t.Lflag + case sshCflag: + flags = &t.Cflag + case sshCchar: + t.Cc[convertSSH[sshID].native] = byte(val) + continue + case sshTspeed: + if sshID == sshTTYOPISPEED { + t.Ispeed = val + } else { + t.Ospeed = val + } + continue + default: + continue + } + if val > 0 { + *flags |= convertSSH[sshID].native + } else { + *flags &^= convertSSH[sshID].native + } + } +} diff --git a/vendor/github.com/google/goterm/term/termios.go b/vendor/github.com/google/goterm/term/termios.go new file mode 100644 index 0000000000..e1aee994f0 --- /dev/null +++ b/vendor/github.com/google/goterm/term/termios.go @@ -0,0 +1,392 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + + +/* +Package term implements a subset of the C termios library to interface with Terminals. + +This package allows the caller to get and set most Terminal capabilites +and sizes as well as create PTYs to enable writing things like script, +screen, tmux, and expect. + +The Termios type is used for setting/getting Terminal capabilities while +the PTY type is used for handling virtual terminals. + +Currently this part of this lib is Linux specific. + +Also implements a simple version of readline in pure Go and some Stringers +for terminal colors and attributes. +*/ +package term + +import ( + "errors" + "os" + "strconv" + "strings" + "syscall" + "unsafe" +) + +// IOCTL terminal stuff. +const ( + TCGETS = 0x5401 // TCGETS get terminal attributes + TCSETS = 0x5402 // TCSETS set terminal attributes + TIOCGWINSZ = 0x5413 // TIOCGWINSZ used to get the terminal window size + TIOCSWINSZ = 0x5414 // TIOCSWINSZ used to set the terminal window size + TIOCGPTN = 0x80045430 // TIOCGPTN IOCTL used to get the PTY number + TIOCSPTLCK = 0x40045431 // TIOCSPTLCK IOCT used to lock/unlock PTY + CBAUD = 0010017 // CBAUD Serial speed settings + CBAUDEX = 0010000 // CBAUDX Serial speed settings +) + +// INPUT handling terminal flags +// see 'man stty' for further info about most of the constants +const ( + IGNBRK = 0000001 // IGNBRK ignore break characters + BRKINT = 0000002 // BRKINT Break genereates an interrupt signal + IGNPAR = 0000004 // IGNPAR Ignore characters with parity errors + PARMRK = 0000010 // PARMRK Mark parity errors byte{ff,0} + INPCK = 0000020 // INPCK enable parity checking + ISTRIP = 0000040 // ISTRIP Clear 8th bit of input characters + INLCR = 0000100 // INLCR Translate LF => CR + IGNCR = 0000200 // IGNCR Ignore Carriage Return + ICRNL = 0000400 // ICRNL Translate CR => NL + IUCLC = 0001000 // IUCLC Translate uppercase to lowercase + IXON = 0002000 // IXON Enable flow control + IXANY = 0004000 // IXANY let any char restart input + IXOFF = 0010000 // IXOFF start sending start/stop chars + IMAXBEL = 0020000 // IMAXBEL Sound the bell and skip flushing input buffer + IUTF8 = 0040000 // IUTF8 assume input being utf-8 +) + +// OUTPUT treatment terminal flags +const ( + OPOST = 0000001 // OPOST post process output + OLCUC = 0000002 // OLCUC translate lower case to upper case + ONLCR = 0000004 // ONLCR Map NL -> CR-NL + OCRNL = 0000010 // OCRNL Map CR -> NL + ONOCR = 0000020 // ONOCR No CR at col 0 + ONLRET = 0000040 // ONLRET NL also do CR + OFILL = 0000100 // OFILL Fillchar for delay + OFDEL = 0000200 // OFDEL use delete instead of null +) + +// TERM control modes. +const ( + CSIZE = 0000060 // CSIZE used as mask when setting character size + CS5 = 0000000 // CS5 char size 5bits + CS6 = 0000020 // CS6 char size 6bits + CS7 = 0000040 // CS7 char size 7bits + CS8 = 0000060 // CS8 char size 8bits + CSTOPB = 0000100 // CSTOPB two stop bits + CREAD = 0000200 // CREAD enable input + PARENB = 0000400 // PARENB generate and expect parity bit + PARODD = 0001000 // PARODD set odd parity + HUPCL = 0002000 // HUPCL send HUP when last process closes term + CLOCAL = 0004000 // CLOCAL no modem control signals +) + +// TERM modes +const ( + ISIG = 0000001 // ISIG enable Interrupt,quit and suspend chars + ICANON = 0000002 // ICANON enable erase,kill ,werase and rprnt chars + XCASE = 0000004 // XCASE preceedes all uppercase chars with '\' + ECHO = 0000010 // ECHO echo input characters + ECHOE = 0000020 // ECHOE erase => BS - SPACE - BS + ECHOK = 0000040 // ECHOK add newline after kill char + ECHONL = 0000100 // ECHONL echo NL even without other characters + NOFLSH = 0000200 // NOFLSH no flush after interrupt and kill characters + TOSTOP = 0000400 // TOSTOP stop BG jobs trying to write to term + ECHOCTL = 0001000 // ECHOCTL will echo control characters as ^c + ECHOPRT = 0002000 // ECHOPRT will print erased characters between \ / + ECHOKE = 0004000 // ECHOKE kill all line considering ECHOPRT and ECHOE flags + IEXTEN = 0100000 // IEXTEN enable non POSIX special characters +) + +// Control characters +const ( + VINTR = 0 // VINTR char will send an interrupt signal + VQUIT = 1 // VQUIT char will send a quit signal + VERASE = 2 // VEREASE char will erase last typed char + VKILL = 3 // VKILL char will erase current line + VEOF = 4 // VEOF char will send EOF + VTIME = 5 // VTIME set read timeout in tenths of seconds + VMIN = 6 // VMIN set min characters for a complete read + VSWTC = 7 // VSWTC char will switch to a different shell layer + VSTART = 8 // VSTART char will restart output after stopping it + VSTOP = 9 // VSTOP char will stop output + VSUSP = 10 // VSUSP char will send a stop signal + VEOL = 11 // VEOL char will end the line + VREPRINT = 12 // VREPRINT will redraw the current line + VDISCARD = 13 // VDISCARD + VWERASE = 14 // VWERASE char will erase last word typed + VLNEXT = 15 // VLNEXT char will enter the next char quoted + VEOL2 = 16 // VEOL2 char alternate to end line + tNCCS = 32 // tNCCS Termios CC size +) + +// Termios merge of the C Terminal and Kernel termios structs. +type Termios struct { + Iflag uint32 // Iflag Handles the different Input modes + Oflag uint32 // Oflag For the different Output modes + Cflag uint32 // Cflag Control modes + Lflag uint32 // Lflag Local modes + Line byte // Line + Cc [tNCCS]byte // Cc Control characters. How to handle special Characters eg. Backspace being ^H or ^? and so on + Ispeed uint32 // Ispeed Hardly ever used speed of terminal + Ospeed uint32 // Ospeed " + Wz Winsize // Wz Terminal size information. +} + +// Winsize handle the terminal window size. +type Winsize struct { + WsRow uint16 // WsRow Terminal number of rows + WsCol uint16 // WsCol Terminal number of columns + WsXpixel uint16 // WsXpixel Terminal width in pixels + WsYpixel uint16 // WsYpixel Terminal height in pixels +} + +// PTY the PTY Master/Slave are always bundled together so makes sense to bundle here too. +// +// Slave - implements the virtual terminal functionality and the place you connect client applications +// Master - Things written to the Master are forwarded to the Slave terminal and the other way around. +// This gives reading from Master would give you nice line-by-line with no strange characters in +// Cooked() Mode and every char in Raw() mode. +// +// Since Slave is a virtual terminal it depends on the terminal settings ( in this lib the Termios ) what +// and when data is forwarded through the terminal. +// +// See 'man pty' for further info +type PTY struct { + Master *os.File // Master The Master part of the PTY + Slave *os.File // Slave The Slave part of the PTY +} + +// Raw Sets terminal t to raw mode. +// This gives that the terminal will do the absolut minimal of processing, pretty much send everything through. +// This is normally what Shells and such want since they have their own readline and movement code. +func (t *Termios) Raw() { + t.Iflag &^= IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON + // t.Iflag &^= BRKINT | ISTRIP | ICRNL | IXON // Stevens RAW + t.Oflag &^= OPOST + t.Lflag &^= ECHO | ECHONL | ICANON | ISIG | IEXTEN + t.Cflag &^= CSIZE | PARENB + t.Cflag |= CS8 + t.Cc[VMIN] = 1 + t.Cc[VTIME] = 0 +} + +// Cook Set the Terminal to Cooked mode. +// In this mode the Terminal process the information before sending it on to the application. +func (t *Termios) Cook() { + t.Iflag |= BRKINT | IGNPAR | ISTRIP | ICRNL | IXON + t.Oflag |= OPOST + t.Lflag |= ISIG | ICANON +} + +// Sane reset Term to sane values. +// Should be pretty much what the shell command "reset" does to the terminal. +func (t *Termios) Sane() { + t.Iflag &^= IGNBRK | INLCR | IGNCR | IUTF8 | IXOFF | IUCLC | IXANY + t.Iflag |= BRKINT | ICRNL | IMAXBEL + t.Oflag |= OPOST | ONLCR + t.Oflag &^= OLCUC | OCRNL | ONOCR | ONLRET + t.Cflag |= CREAD +} + +// Set Sets terminal t attributes on file. +func (t *Termios) Set(file *os.File) error { + fd := file.Fd() + _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(TCSETS), uintptr(unsafe.Pointer(t))) + if errno != 0 { + return errno + } + return nil +} + +// Attr Gets (terminal related) attributes from file. +func Attr(file *os.File) (Termios, error) { + var t Termios + fd := file.Fd() + _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(TCGETS), uintptr(unsafe.Pointer(&t))) + if errno != 0 { + return t, errno + } + t.Ispeed &= CBAUD | CBAUDEX + t.Ospeed &= CBAUD | CBAUDEX + return t, nil +} + +// Isatty returns true if file is a tty. +func Isatty(file *os.File) bool { + _, err := Attr(file) + return err == nil +} + +// GetPass reads password from a TTY with no echo. +func GetPass(prompt string, f *os.File, pbuf []byte) ([]byte, error) { + t, err := Attr(f) + if err != nil { + return nil, err + } + defer t.Set(f) + noecho := t + noecho.Lflag = noecho.Lflag &^ ECHO + if err := noecho.Set(f); err != nil { + return nil, err + } + b := make([]byte, 1, 1) + i := 0 + if _, err := f.Write([]byte(prompt)); err != nil { + return nil, err + } + for ; i < len(pbuf); i++ { + if _, err := f.Read(b); err != nil { + b[0] = 0 + clearbuf(pbuf[:i+1]) + } + if b[0] == '\n' || b[0] == '\r' { + return pbuf[:i], nil + } + pbuf[i] = b[0] + b[0] = 0 + } + clearbuf(pbuf[:i+1]) + return nil, errors.New("ran out of bufferspace") +} + +// clearbuf clears out the buffer incase we couldn't read the full password. +func clearbuf(b []byte) { + for i := range b { + b[i] = 0 + } +} + +// GetChar reads a single byte. +func GetChar(f *os.File) (b byte, err error) { + bs := make([]byte, 1, 1) + if _, err = f.Read(bs); err != nil { + return 0, err + } + return bs[0], err +} + +// PTSName return the name of the pty. +func (p *PTY) PTSName() (string, error) { + n, err := p.PTSNumber() + if err != nil { + return "", err + } + return "/dev/pts/" + strconv.Itoa(int(n)), nil +} + +// PTSNumber return the pty number. +func (p *PTY) PTSNumber() (uint, error) { + var ptyno uint + _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(p.Master.Fd()), uintptr(TIOCGPTN), uintptr(unsafe.Pointer(&ptyno))) + if errno != 0 { + return 0, errno + } + return ptyno, nil +} + +// Winsz Fetches the current terminal windowsize. +// example handling changing window sizes with PTYs: +// +// import "os" +// import "os/signal" +// +// var sig = make(chan os.Signal,2) // Channel to listen for UNIX SIGNALS on +// signal.Notify(sig, syscall.SIGWINCH) // That'd be the window changing +// +// for { +// <-sig +// term.Winsz(os.Stdin) // We got signaled our terminal changed size so we read in the new value +// term.Setwinsz(pty.Slave) // Copy it to our virtual Terminal +// } +func (t *Termios) Winsz(file *os.File) error { + _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(file.Fd()), uintptr(TIOCGWINSZ), uintptr(unsafe.Pointer(&t.Wz))) + if errno != 0 { + return errno + } + return nil +} + +// Setwinsz Sets the terminal window size. +func (t *Termios) Setwinsz(file *os.File) error { + _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(file.Fd()), uintptr(TIOCSWINSZ), uintptr(unsafe.Pointer(&t.Wz))) + if errno != 0 { + return errno + } + return nil +} + +// OpenPTY Creates a new Master/Slave PTY pair. +func OpenPTY() (*PTY, error) { + // Opening ptmx gives you the FD of a brand new PTY + master, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) + if err != nil { + return nil, err + } + + // unlock pty slave + var unlock int // 0 => Unlock + if _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(master.Fd()), uintptr(TIOCSPTLCK), uintptr(unsafe.Pointer(&unlock))); errno != 0 { + master.Close() + return nil, errno + } + + // get path of pts slave + pty := &PTY{Master: master} + slaveStr, err := pty.PTSName() + if err != nil { + master.Close() + return nil, err + } + + // open pty slave + pty.Slave, err = os.OpenFile(slaveStr, os.O_RDWR|syscall.O_NOCTTY, 0) + if err != nil { + master.Close() + return nil, err + } + + return pty, nil +} + +// Close closes the PTYs that OpenPTY created. +func (p *PTY) Close() error { + slaveErr := errors.New("Slave FD nil") + if p.Slave != nil { + slaveErr = p.Slave.Close() + } + masterErr := errors.New("Master FD nil") + if p.Master != nil { + masterErr = p.Master.Close() + } + if slaveErr != nil || masterErr != nil { + var errs []string + if slaveErr != nil { + errs = append(errs, "Slave: "+slaveErr.Error()) + } + if masterErr != nil { + errs = append(errs, "Master: "+masterErr.Error()) + } + return errors.New(strings.Join(errs, " ")) + } + return nil +} + +// ReadByte implements the io.ByteReader interface to read single char from the PTY. +func (p *PTY) ReadByte() (byte, error) { + bs := make([]byte, 1, 1) + _, err := p.Master.Read(bs) + return bs[0], err +} + +// GetChar fine old getchar() for a PTY. +func (p *PTY) GetChar() (byte, error) { + return p.ReadByte() +} diff --git a/vendor/github.com/lusis/go-artifactory/artifactory.v51/license.go b/vendor/github.com/lusis/go-artifactory/artifactory.v51/license.go deleted file mode 100644 index 25253e8851..0000000000 --- a/vendor/github.com/lusis/go-artifactory/artifactory.v51/license.go +++ /dev/null @@ -1,24 +0,0 @@ -package artifactory - -import ( - "encoding/json" -) - -// LicenseInformation represents the json response from artifactory for license information -type LicenseInformation struct { - LicenseType string `json:"type"` - ValidThrough string `json:"validThrough"` - LicensedTo string `json:"licensedTo"` -} - -// GetLicenseInformation returns license information from Artifactory -func (c *Client) GetLicenseInformation() (LicenseInformation, error) { - o := make(map[string]string) - var l LicenseInformation - d, e := c.Get("/api/system/license", o) - if e != nil { - return l, e - } - err := json.Unmarshal(d, &l) - return l, err -} diff --git a/vendor/github.com/lusis/go-artifactory/artifactory.v54/license.go b/vendor/github.com/lusis/go-artifactory/artifactory.v54/license.go deleted file mode 100644 index 5dbe28b007..0000000000 --- a/vendor/github.com/lusis/go-artifactory/artifactory.v54/license.go +++ /dev/null @@ -1,79 +0,0 @@ -package artifactory - -import "encoding/json" - -// LicenseInfo represents the json response from Artifactory for license information -type LicenseInfo struct { - LicenseType string `json:"type"` - ValidThrough string `json:"validThrough"` - LicensedTo string `json:"licensedTo"` -} - -// HALicense represents an element in the json response from Artifactory -type HALicense struct { - LicenseType string `json:"type"` - ValidThrough string `json:"validThrough"` - LicensedTo string `json:"licensedTo"` - LicenseHash string `json:"licenseHash"` - NodeID string `json:"nodeId"` - NodeURL string `json:"nodeUrl"` - Expired bool `json:"expired"` -} - -// HALicenseInfo represents the json response from Artifactory for the HA license information -type HALicenseInfo struct { - Licenses []HALicense `json:"licenses"` -} - -// InstallLicense represents the json payload we send to Artifactory -type InstallLicense struct { - LicenseKey string `json:"licenseKey"` -} - -// GetLicenseInfo returns information about the currently installed license -func (c *Client) GetLicenseInfo() (LicenseInfo, error) { - var res LicenseInfo - d, err := c.Get("/api/system/license", make(map[string]string)) - if err != nil { - return res, err - } - - err = json.Unmarshal(d, &res) - - return res, err -} - -// InstallLicense installs a new license key or changes the current one -func (c *Client) InstallLicense(license InstallLicense, q map[string]string) error { - j, err := json.Marshal(license) - if err != nil { - return err - } - - _, err = c.Post("/api/system/license", j, q) - return err -} - -// GetHALicenseInfo returns information about the currently installed licenses in an HA cluster -func (c *Client) GetHALicenseInfo() (HALicenseInfo, error) { - var res HALicenseInfo - d, err := c.Get("/api/system/licenses", make(map[string]string)) - if err != nil { - return res, err - } - - err = json.Unmarshal(d, &res) - - return res, err -} - -// InstallHALicenses installs a new license key(s) on an HA cluster -func (c *Client) InstallHALicenses(licenses []InstallLicense, q map[string]string) error { - j, err := json.Marshal(licenses) - if err != nil { - return err - } - - _, err = c.Post("/api/system/licenses", j, q) - return err -} diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v491/license.go b/vendor/github.com/lusis/go-artifactory/src/artifactory.v491/license.go deleted file mode 100644 index 7b9cdb588d..0000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v491/license.go +++ /dev/null @@ -1,23 +0,0 @@ -package artifactory - -import ( - "encoding/json" -) - -type LicenseInformation struct { - LicenseType string `json:"type"` - ValidThrough string `json:"validThrough"` - LicensedTo string `json:"licensedTo"` -} - -func (c *ArtifactoryClient) GetLicenseInformation() (LicenseInformation, error) { - o := make(map[string]string, 0) - var l LicenseInformation - d, e := c.Get("/api/system/license", o) - if e != nil { - return l, e - } else { - err := json.Unmarshal(d, &l) - return l, err - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go deleted file mode 100644 index bc22e9732b..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go +++ /dev/null @@ -1,683 +0,0 @@ -package cmd - -func initAgpl() { - Licenses["agpl"] = License{ - Name: "GNU Affero General Public License", - PossibleMatches: []string{"agpl", "affero gpl", "gnu agpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see .`, - Text: ` GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go deleted file mode 100644 index 38393d5417..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initApache2() { - Licenses["apache"] = License{ - Name: "Apache 2.0", - PossibleMatches: []string{"apache", "apache20", "apache 2.0", "apache2.0", "apache-2.0"}, - Header: ` -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.`, - Text: ` - 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/spf13/cobra/cobra/cmd/license_bsd_clause_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go deleted file mode 100644 index 4a847e04a0..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initBsdClause2() { - Licenses["freebsd"] = License{ - Name: "Simplified BSD License", - PossibleMatches: []string{"freebsd", "simpbsd", "simple bsd", "2-clause bsd", - "2 clause bsd", "simplified bsd license"}, - Header: `All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go deleted file mode 100644 index c7476b31f5..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initBsdClause3() { - Licenses["bsd"] = License{ - Name: "NewBSD", - PossibleMatches: []string{"bsd", "newbsd", "3 clause bsd", "3-clause bsd"}, - Header: `All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go deleted file mode 100644 index 03e05b3a7e..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initGpl2() { - Licenses["gpl2"] = License{ - Name: "GNU General Public License 2.0", - PossibleMatches: []string{"gpl2", "gnu gpl2", "gplv2"}, - Header: ` -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .`, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than 'show w' and 'show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - 'Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go deleted file mode 100644 index ce07679c77..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go +++ /dev/null @@ -1,711 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initGpl3() { - Licenses["gpl3"] = License{ - Name: "GNU General Public License 3.0", - PossibleMatches: []string{"gpl3", "gplv3", "gpl", "gnu gpl3", "gnu gpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see .`, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go deleted file mode 100644 index 0f8b96cad0..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go +++ /dev/null @@ -1,186 +0,0 @@ -package cmd - -func initLgpl() { - Licenses["lgpl"] = License{ - Name: "GNU Lesser General Public License", - PossibleMatches: []string{"lgpl", "lesser gpl", "gnu lgpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .`, - Text: ` GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library.`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go deleted file mode 100644 index bd2d0c4fa8..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initMit() { - Licenses["mit"] = License{ - Name: "MIT License", - PossibleMatches: []string{"mit"}, - Header: ` -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.`, - Text: `The MIT License (MIT) - -{{ .copyright }} - -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/spf13/cobra/cobra/cmd/licenses.go b/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go deleted file mode 100644 index a070134ddc..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -import ( - "strings" - "time" - - "github.com/spf13/viper" -) - -// Licenses contains all possible licenses a user can choose from. -var Licenses = make(map[string]License) - -// License represents a software license agreement, containing the Name of -// the license, its possible matches (on the command line as given to cobra), -// the header to be used with each file on the file's creating, and the text -// of the license -type License struct { - Name string // The type of license in use - PossibleMatches []string // Similar names to guess - Text string // License text data - Header string // License header for source files -} - -func init() { - // Allows a user to not use a license. - Licenses["none"] = License{"None", []string{"none", "false"}, "", ""} - - initApache2() - initMit() - initBsdClause3() - initBsdClause2() - initGpl2() - initGpl3() - initLgpl() - initAgpl() -} - -// getLicense returns license specified by user in flag or in config. -// If user didn't specify the license, it returns Apache License 2.0. -// -// TODO: Inspect project for existing license -func getLicense() License { - // If explicitly flagged, use that. - if userLicense != "" { - return findLicense(userLicense) - } - - // If user wants to have custom license, use that. - if viper.IsSet("license.header") || viper.IsSet("license.text") { - return License{Header: viper.GetString("license.header"), - Text: viper.GetString("license.text")} - } - - // If user wants to have built-in license, use that. - if viper.IsSet("license") { - return findLicense(viper.GetString("license")) - } - - // If user didn't set any license, use Apache 2.0 by default. - return Licenses["apache"] -} - -func copyrightLine() string { - author := viper.GetString("author") - - year := viper.GetString("year") // For tests. - if year == "" { - year = time.Now().Format("2006") - } - - return "Copyright © " + year + " " + author -} - -// findLicense looks for License object of built-in licenses. -// If it didn't find license, then the app will be terminated and -// error will be printed. -func findLicense(name string) License { - found := matchLicense(name) - if found == "" { - er("unknown license: " + name) - } - return Licenses[found] -} - -// matchLicense compares the given a license name -// to PossibleMatches of all built-in licenses. -// It returns blank string, if name is blank string or it didn't find -// then appropriate match to name. -func matchLicense(name string) string { - if name == "" { - return "" - } - - for key, lic := range Licenses { - for _, match := range lic.PossibleMatches { - if strings.EqualFold(name, match) { - return key - } - } - } - - return "" -} diff --git a/vendor/github.com/ulikunitz/xz/cmd/gxz/licenses.go b/vendor/github.com/ulikunitz/xz/cmd/gxz/licenses.go deleted file mode 100644 index fbd3114e36..0000000000 --- a/vendor/github.com/ulikunitz/xz/cmd/gxz/licenses.go +++ /dev/null @@ -1,57 +0,0 @@ -package main - -const goLicense = `Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -` -const xzLicense = `Copyright (c) 2014-2017 Ulrich Kunitz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* My name, Ulrich Kunitz, may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -` diff --git a/vendor/github.com/ulikunitz/xz/cmd/xb/copyright.go b/vendor/github.com/ulikunitz/xz/cmd/xb/copyright.go deleted file mode 100644 index 3dfc2ee844..0000000000 --- a/vendor/github.com/ulikunitz/xz/cmd/xb/copyright.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "io" - "log" - "os" - "path/filepath" - "strings" -) - -const crUsageString = `xb copyright [options] .... - -The xb copyright command adds a copyright remark to all go files below path. - - -h prints this message and exits -` - -func crUsage(w io.Writer) { - fmt.Fprint(w, crUsageString) -} - -const copyrightText = ` -Copyright 2014-2017 Ulrich Kunitz. All rights reserved. -Use of this source code is governed by a BSD-style -license that can be found in the LICENSE file. -` - -func goComment(text string) string { - buf := new(bytes.Buffer) - scanner := bufio.NewScanner(strings.NewReader(text)) - var err error - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if len(s) == 0 { - continue - } - if _, err = fmt.Fprintln(buf, "//", s); err != nil { - panic(err) - } - } - if err = scanner.Err(); err != nil { - panic(err) - } - if _, err = fmt.Fprintln(buf); err != nil { - panic(err) - } - return buf.String() -} - -var goCopyright = goComment(copyrightText) - -func addCopyright(path string) (err error) { - log.Printf("adding copyright to %s", path) - src, err := os.Open(path) - if err != nil { - return err - } - defer func() { - cerr := src.Close() - if cerr != nil && err == nil { - err = cerr - } - }() - newPath := path + ".new" - dst, err := os.Create(newPath) - if err != nil { - return err - } - defer func() { - cerr := dst.Close() - if cerr != nil && err == nil { - err = cerr - } - }() - out := bufio.NewWriter(dst) - fmt.Fprint(out, goCopyright) - scanner := bufio.NewScanner(src) - line := 0 - del := false - for scanner.Scan() { - line++ - txt := scanner.Text() - if line == 1 && strings.Contains(txt, "Copyright") { - del = true - continue - } - if del { - s := strings.TrimSpace(txt) - if len(s) == 0 { - del = false - } - continue - } - fmt.Fprintln(out, txt) - } - if err = scanner.Err(); err != nil { - return err - } - if err = out.Flush(); err != nil { - return - } - err = os.Rename(newPath, path) - return -} - -func walkCopyrights(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if info.IsDir() { - return nil - } - if !strings.HasSuffix(info.Name(), ".go") { - return nil - } - return addCopyright(path) -} - -func copyright() { - cmdName := os.Args[0] - log.SetPrefix(fmt.Sprintf("%s: ", cmdName)) - log.SetFlags(0) - - flag.CommandLine = flag.NewFlagSet(cmdName, flag.ExitOnError) - flag.Usage = func() { crUsage(os.Stderr); os.Exit(1) } - - help := flag.Bool("h", false, "") - - flag.Parse() - - if *help { - crUsage(os.Stdout) - os.Exit(0) - } - - for _, path := range flag.Args() { - fi, err := os.Stat(path) - if err != nil { - log.Print(err) - continue - } - if !fi.IsDir() { - log.Printf("%s is not a directory", path) - continue - } - if err = filepath.Walk(path, walkCopyrights); err != nil { - log.Fatalf("%s error %s", path, err) - } - } -}