diff --git a/.gitignore b/.gitignore index 01e36dddef4..4f05f19ac96 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,9 @@ cmd/ingester/ingester cmd/ingester/ingester-* cmd/query/query cmd/query/query-* +cmd/docs/*.md +cmd/docs/*.rst +cmd/docs/*.1 +cmd/docs/*.yaml crossdock/crossdock-* run-crossdock.log diff --git a/Gopkg.lock b/Gopkg.lock index aafe9d09fbd..2926746e193 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,96 +3,133 @@ [[projects]] branch = "master" + digest = "1:6716c9fe6333591128e72848f246fc01dc72240e1e64185d8b4e124e7280b35d" name = "github.com/AndreasBriese/bbloom" packages = ["."] + pruneopts = "UT" revision = "e2d15f34fcf99d5dbb871c820ec73f710fca9815" [[projects]] + digest = "1:9f3b30d9f8e0d7040f729b82dcbc8f0dead820a133b3147ce355fc451f32d761" name = "github.com/BurntSushi/toml" packages = ["."] + pruneopts = "UT" revision = "3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005" version = "v0.3.1" [[projects]] + digest = "1:6d8a3b164679872fa5a4c44559235f7fb109c7b5cd0f456a2159d579b76cc9ba" name = "github.com/DataDog/zstd" packages = ["."] + pruneopts = "UT" revision = "809b919c325d7887bff7bd876162af73db53e878" version = "v1.4.0" [[projects]] + digest = "1:a2682518d905d662d984ef9959984ef87cecb777d379bfa9d9fe40e78069b3e4" name = "github.com/PuerkitoBio/purell" packages = ["."] + pruneopts = "UT" revision = "44968752391892e1b0d0b821ee79e9a85fa13049" version = "v1.1.1" [[projects]] branch = "master" + digest = "1:c739832d67eb1e9cc478a19cc1a1ccd78df0397bf8a32978b759152e205f644b" name = "github.com/PuerkitoBio/urlesc" packages = ["."] + pruneopts = "UT" revision = "de5bf2ad457846296e2031421a34e2568e304e35" [[projects]] + digest = "1:7e31a67d6e81ae7bac48b27c9260ad164eff0abdb4300d0f2aa8d4856cc45479" name = "github.com/Shopify/sarama" packages = [ ".", - "mocks" + "mocks", ] + pruneopts = "UT" revision = "ea9ab1c316850bee881a07bb2555ee8a685cd4b6" version = "v1.22.1" [[projects]] + digest = "1:8515c0ca4381246cf332cee05fc84070bbbb07bd679b639161506ba532f47128" name = "github.com/VividCortex/gohistogram" packages = ["."] + pruneopts = "UT" revision = "51564d9861991fb0ad0f531c99ef602d0f9866e6" version = "v1.0.0" [[projects]] + digest = "1:f563c51359f64bc448d47183c7a3959f4e76c3bfc7dd040e2dfa84ec124c38fe" name = "github.com/apache/thrift" packages = ["lib/go/thrift"] + pruneopts = "UT" revision = "53dd39833a08ce33582e5ff31fa18bb4735d6731" version = "0.9.3" [[projects]] + digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709" name = "github.com/asaskevich/govalidator" packages = ["."] + pruneopts = "UT" revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" version = "v9" [[projects]] + digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "UT" revision = "4b2b341e8d7715fae06375aa633dbb6e91b3fb46" version = "v1.0.0" [[projects]] + digest = "1:4fdffd1724c105db8c394019cfc2444fd23466be04812850506437361ee5de55" name = "github.com/bsm/sarama-cluster" packages = ["."] + pruneopts = "UT" revision = "cf455bc755fe41ac9bb2861e7a961833d9c2ecc3" version = "v2.1.13" [[projects]] branch = "master" + digest = "1:4c4c33075b704791d6a7f09dfb55c66769e8a1dc6adf87026292d274fe8ad113" name = "github.com/codahale/hdrhistogram" packages = ["."] + pruneopts = "UT" revision = "3a0bb77429bd3a61596f5e8a3172445844342120" +[[projects]] + digest = "1:7cb4fdca4c251b3ef8027c90ea35f70c7b661a593b9eeae34753c65499098bb1" + name = "github.com/cpuguy83/go-md2man" + packages = ["md2man"] + pruneopts = "UT" + revision = "7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19" + version = "v1.0.10" + [[projects]] branch = "master" + digest = "1:a382acd6150713655ded76ab5fbcbc7924a7808dab4312dda5d1f23dd8ce5277" name = "github.com/crossdock/crossdock-go" packages = [ ".", "assert", - "require" + "require", ] + pruneopts = "UT" revision = "049aabb0122b03bc9bd30cab8f3f91fb60166361" [[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "UT" revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" [[projects]] + digest = "1:21ac9938fb1098b3a7b0dd909fb30878d33231177fac11a2821114eb9c1088ff" name = "github.com/dgraph-io/badger" packages = [ ".", @@ -100,101 +137,129 @@ "protos", "skl", "table", - "y" + "y", ] + pruneopts = "UT" revision = "391b6d3b93e6014fe8c2971fcc0c1266e47dbbd9" version = "v1.5.3" [[projects]] branch = "master" + digest = "1:6e8109ce247a59ab1eeb5330166c12735f6590de99c9647b6162d11518d32c9a" name = "github.com/dgryski/go-farm" packages = ["."] + pruneopts = "UT" revision = "6a90982ecee230ff6cba02d5bd386acc030be9d3" [[projects]] + digest = "1:1f0c7ab489b407a7f8f9ad16c25a504d28ab461517a971d341388a56156c1bd7" name = "github.com/eapache/go-resiliency" packages = ["breaker"] + pruneopts = "UT" revision = "ea41b0fad31007accc7f806884dcdf3da98b79ce" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:79f16588b5576b1b3cd90e48d2374cc9a1a8776862d28d8fd0f23b0e15534967" name = "github.com/eapache/go-xerial-snappy" packages = ["."] + pruneopts = "UT" revision = "776d5712da21bc4762676d614db1d8a64f4238b0" [[projects]] + digest = "1:444b82bfe35c83bbcaf84e310fb81a1f9ece03edfed586483c869e2c046aef69" name = "github.com/eapache/queue" packages = ["."] + pruneopts = "UT" revision = "44cc805cf13205b55f69e14bcb69867d1ae92f98" version = "v1.1.0" [[projects]] + digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" name = "github.com/fsnotify/fsnotify" packages = ["."] + pruneopts = "UT" revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" version = "v1.4.7" [[projects]] + digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda" name = "github.com/ghodss/yaml" packages = ["."] + pruneopts = "UT" revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:7fb51688eadf38272411852d7a2b3538c7caff53309abee6c0964a83c00fe69e" name = "github.com/globalsign/mgo" packages = [ "bson", - "internal/json" + "internal/json", ] + pruneopts = "UT" revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" [[projects]] + digest = "1:c598a8cefc266a1a0dae50314298326532768ab07b9e6a1b0cd4b26c5a9cf299" name = "github.com/go-kit/kit" packages = [ "metrics", "metrics/expvar", "metrics/generic", - "metrics/internal/lv" + "metrics/internal/lv", ] + pruneopts = "UT" revision = "a9ca6725cbbea455e61c6bc8a1ed28e81eb3493b" version = "v0.5.0" [[projects]] + digest = "1:8c4be86399428a81749056c2d67feba95c1784b742ccf03ac7527d0b426bf22a" name = "github.com/go-openapi/analysis" packages = [ ".", - "internal" + "internal", ] + pruneopts = "UT" revision = "e2f3fdbb7ed0e56e070ccbfb6fc75b288a33c014" version = "v0.19.0" [[projects]] + digest = "1:d4a14966fe8f1ec9306792aaa4d135392b04ab5eb5830d485199dbf0ddb1132b" name = "github.com/go-openapi/errors" packages = ["."] + pruneopts = "UT" revision = "7a7ff1b7b8020f22574411a32f28b4d168d69237" version = "v0.19.0" [[projects]] + digest = "1:953a2628e4c5c72856b53f5470ed5e071c55eccf943d798d42908102af2a610f" name = "github.com/go-openapi/jsonpointer" packages = ["."] + pruneopts = "UT" revision = "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" version = "v0.19.0" [[projects]] + digest = "1:81210e0af657a0fb3638932ec68e645236bceefa4c839823db0c4d918f080895" name = "github.com/go-openapi/jsonreference" packages = ["."] + pruneopts = "UT" revision = "8483a886a90412cd6858df4ea3483dce9c8e35a3" version = "v0.19.0" [[projects]] + digest = "1:208878abf5fc4e435f9c382a06678f46be91270d0efa1f475134543f6ed7784a" name = "github.com/go-openapi/loads" packages = ["."] + pruneopts = "UT" revision = "74628589c3b94e3526a842d24f46589980f5ab22" version = "v0.19.0" [[projects]] + digest = "1:f601315efca293dedce38affe9397608f41a459dd1b4c4188ce33f044d8ebc18" name = "github.com/go-openapi/runtime" packages = [ ".", @@ -203,51 +268,65 @@ "middleware/denco", "middleware/header", "middleware/untyped", - "security" + "security", ] + pruneopts = "UT" revision = "109737172424d8a656fd1199e28c9f5cc89b0cca" version = "v0.19.0" [[projects]] + digest = "1:34130204ce3bd3d32bd111e28d9155de1e78132dbf29b2c4cedeca510e954f3e" name = "github.com/go-openapi/spec" packages = ["."] + pruneopts = "UT" revision = "53d776530bf78a11b03a7b52dd8a083086b045e5" version = "v0.19.0" [[projects]] + digest = "1:46d47ab9ecb073a7feeb21af4f90d3657d793eac41f94d35b64bf3014f812856" name = "github.com/go-openapi/strfmt" packages = ["."] + pruneopts = "UT" revision = "29177d4b5db488583bb97ebc05d3842ebeda91a8" version = "v0.19.0" [[projects]] + digest = "1:937e7dbdd1a44b6a295897142108b23001e76a2829968004ecba638ef9b3a88a" name = "github.com/go-openapi/swag" packages = ["."] + pruneopts = "UT" revision = "b3e2804c8535ee0d1b89320afd98474d5b8e9e3b" version = "v0.19.0" [[projects]] + digest = "1:965748ac4e6117c32cdcfa06a94384faceec54f7aa0a51128ec76834fbe68bc2" name = "github.com/go-openapi/validate" packages = ["."] + pruneopts = "UT" revision = "5b1623be7460f5a3967a82c00d518048fb190f5e" version = "v0.19.0" [[projects]] + digest = "1:2dd4729330a990761f321b89db505906de5cfe912014e51e99669fd99ace99b4" name = "github.com/gocql/gocql" packages = [ ".", "internal/lru", "internal/murmur", - "internal/streams" + "internal/streams", ] + pruneopts = "UT" revision = "181004e14a3fb735efcc826a4256369d0c96747b" [[projects]] + digest = "1:b066682d13a181fe2d34f55e0d05cb53211884725d55bc19468edcc61b8e9290" name = "github.com/gogo/googleapis" packages = ["google/api"] + pruneopts = "T" revision = "b23578765ee54ff6bceff57f397d833bf4ca6869" [[projects]] + digest = "1:c6e109ed32d266dea072dd6d00e3ee26fb960f86ed0ba7f6a07e5d2bfdeab868" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -278,17 +357,21 @@ "sortkeys", "types", "vanity", - "vanity/command" + "vanity/command", ] + pruneopts = "T" revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c" [[projects]] branch = "master" + digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" name = "github.com/golang/glog" packages = ["."] + pruneopts = "UT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] + digest = "1:e3bed20f553811662a2b5e6c0d40f1c837b2f1decace8afb1bb1778acb97fd04" name = "github.com/golang/protobuf" packages = [ "descriptor", @@ -304,40 +387,50 @@ "ptypes/any", "ptypes/duration", "ptypes/struct", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "UT" revision = "b5d812f8a3706043e23a9cd5babf2e5423744d30" version = "v1.3.1" [[projects]] + digest = "1:e4f5819333ac698d294fe04dbf640f84719658d5c7ce195b10060cc37292ce79" name = "github.com/golang/snappy" packages = ["."] + pruneopts = "UT" revision = "2a8bb927dd31d8daada140a5d09578521ce5c36a" version = "v0.0.1" [[projects]] + digest = "1:664d37ea261f0fc73dd17f4a1f5f46d01fbb0b0d75f6375af064824424109b7d" name = "github.com/gorilla/handlers" packages = ["."] + pruneopts = "UT" revision = "7e0847f9db758cdebd26c149d0ae9d5d0b9c98ce" version = "v1.4.0" [[projects]] + digest = "1:d5f97fc268267ec1b61c3453058c738246fc3e746f14b1ae25161513b7367b0c" name = "github.com/gorilla/mux" packages = ["."] + pruneopts = "UT" revision = "c5c6c98bc25355028a63748a498942a6398ccd22" version = "v1.7.1" [[projects]] + digest = "1:d84c274ffdfd7ce6b4efd64ee776648459009d1f542440b1faa32cb7ed9aba84" name = "github.com/grpc-ecosystem/go-grpc-middleware" packages = [ "retry", "util/backoffutils", - "util/metautils" + "util/metautils", ] + pruneopts = "UT" revision = "c250d6563d4d4c20252cd865923440e829844f4e" version = "v1.0.0" [[projects]] + digest = "1:d26054aef028b782f9b65c29f17b8b6a5c75e302b6656f370b9c0788b1e35a00" name = "github.com/grpc-ecosystem/grpc-gateway" packages = [ "codegenerator", @@ -350,33 +443,41 @@ "protoc-gen-swagger", "protoc-gen-swagger/genswagger", "protoc-gen-swagger/options", - "utilities" + "utilities", ] + pruneopts = "T" revision = "20f268a412e5b342ebfb1a0eef7c3b7bd6c260ea" version = "v1.8.5" [[projects]] branch = "master" + digest = "1:364b908b9b27b97ab838f2f6f1b1f46281fa29b978a037d72a9b1d4f6d940190" name = "github.com/hailocab/go-hostpool" packages = ["."] + pruneopts = "UT" revision = "e80d13ce29ede4452c43dea11e79b9bc8a15b478" [[projects]] + digest = "1:f6ecb0dc7d965d75815729fd300cc0cd17004fb2d6172a7f37192494936942e5" name = "github.com/hashicorp/go-hclog" packages = ["."] + pruneopts = "UT" revision = "6907afbebd2eef854f0be9194eb79b0ba75d7b29" version = "v0.8.0" [[projects]] + digest = "1:5e1aece859ec4195f3d16dd3b64a0f111e186b9e95d75141465595063e3a5254" name = "github.com/hashicorp/go-plugin" packages = [ ".", - "internal/plugin" + "internal/plugin", ] + pruneopts = "UT" revision = "52e1c4730856c1438ced7597c9b5c585a7bd06a2" version = "v1.0.0" [[projects]] + digest = "1:c0d19ab64b32ce9fe5cf4ddceba78d5bc9807f0016db6b1183599da3dcc24d10" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -388,81 +489,103 @@ "hcl/token", "json/parser", "json/scanner", - "json/token" + "json/token", ] + pruneopts = "UT" revision = "8cb6e5b959231cc1119e43259c4a608f9c51a241" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:a4826c308e84f5f161b90b54a814f0be7d112b80164b9b884698a6903ea47ab3" name = "github.com/hashicorp/yamux" packages = ["."] + pruneopts = "UT" revision = "2f1d1f20f75d5404f53b9edf6b53ed5505508675" [[projects]] + digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" packages = ["."] + pruneopts = "UT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] + digest = "1:15ec2166e33ef6c60b344a04d050eec79193517e7f5082b6233b2d09ef0d10b8" name = "github.com/kisielk/gotool" packages = [ ".", - "internal/load" + "internal/load", ] + pruneopts = "UT" revision = "80517062f582ea3340cd4baf70e86d539ae7d84d" version = "v1.0.0" [[projects]] + digest = "1:ca955a9cd5b50b0f43d2cc3aeb35c951473eeca41b34eb67507f1dbcc0542394" name = "github.com/kr/pretty" packages = ["."] + pruneopts = "UT" revision = "73f6ac0b30a98e433b289500d779f50c1a6f0712" version = "v0.1.0" [[projects]] + digest = "1:15b5cc79aad436d47019f814fde81a10221c740dc8ddf769221a65097fb6c2e9" name = "github.com/kr/text" packages = ["."] + pruneopts = "UT" revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f" version = "v0.1.0" [[projects]] + digest = "1:c568d7727aa262c32bdf8a3f7db83614f7af0ed661474b24588de635c20024c7" name = "github.com/magiconair/properties" packages = ["."] + pruneopts = "UT" revision = "c2353362d570a7bfa228149c62842019201cfb71" version = "v1.8.0" [[projects]] branch = "master" + digest = "1:8a82e4b519fb94b83923e0a6fae6aced276c887781b94b6a00c90b3dad240ba1" name = "github.com/mailru/easyjson" packages = [ ".", "buffer", "jlexer", - "jwriter" + "jwriter", ] + pruneopts = "UT" revision = "1ea4449da9834f4d333f1cc461c374aea217d249" [[projects]] + digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "UT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] + digest = "1:42eb1f52b84a06820cedc9baec2e710bfbda3ee6dac6cdb97f8b9a5066134ec6" name = "github.com/mitchellh/go-testing-interface" packages = ["."] + pruneopts = "UT" revision = "6d0b8010fcc857872e42fc6c931227569016843c" version = "v1.0.0" [[projects]] + digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "UT" revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe" version = "v1.1.2" [[projects]] branch = "master" + digest = "1:ae08d850ba158ea3ba4a7bb90f8372608172d8920644e5a6693b940a1f4e5d01" name = "github.com/mmcloughlin/avo" packages = [ "attr", @@ -477,11 +600,13 @@ "printer", "reg", "src", - "x86" + "x86", ] + pruneopts = "UT" revision = "2e7d06bc7ada2979f17ccf8ebf486dba23b84fc7" [[projects]] + digest = "1:66b0a65aba488ca6c72f77132d5b8d7e2c5baf07d577dee64502b69a2c90c791" name = "github.com/nbutton23/zxcvbn-go" packages = [ ".", @@ -492,192 +617,255 @@ "match", "matching", "scoring", - "utils/math" + "utils/math", ] + pruneopts = "UT" revision = "eafdab6b0663b4b528c35975c8b0e78be6e25261" version = "v0.1" [[projects]] + digest = "1:9ec6cf1df5ad1d55cf41a43b6b1e7e118a91bade4f68ff4303379343e40c0e25" name = "github.com/oklog/run" packages = ["."] + pruneopts = "UT" revision = "4dadeb3030eda0273a12382bb2348ffc7c9d1a39" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:bccaead3121ab7964fd80fab704f612e5893fb5a2c581d520ec847ed8cfac27e" name = "github.com/opentracing-contrib/go-stdlib" packages = ["nethttp"] + pruneopts = "UT" revision = "3020fec0e66bdb65fd42cb346cb65d58deb92e0d" [[projects]] + digest = "1:11e62d6050198055e6cd87ed57e5d8c669e84f839c16e16f192374d913d1a70d" name = "github.com/opentracing/opentracing-go" packages = [ ".", "ext", - "log" + "log", ] + pruneopts = "UT" revision = "659c90643e714681897ec2521c60567dd21da733" version = "v1.1.0" [[projects]] + digest = "1:93131d8002d7025da13582877c32d1fc302486775a1b06f62241741006428c5e" name = "github.com/pelletier/go-toml" packages = ["."] + pruneopts = "UT" revision = "728039f679cbcd4f6a54e080d2219a4c4928c546" version = "v1.4.0" [[projects]] + digest = "1:259f9b7645983a7a823318d78aa96dec68af8891f706493ac1ec04d819cb977c" name = "github.com/pierrec/lz4" packages = [ ".", - "internal/xxh32" + "internal/xxh32", ] + pruneopts = "UT" revision = "d705d4371bfccdf47f10e45584e896026c83616f" version = "v2.2.3" [[projects]] + digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "UT" revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" version = "v0.8.1" [[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "UT" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] + digest = "1:d14a5f4bfecf017cb780bdde1b6483e5deb87e12c332544d2c430eda58734bcb" name = "github.com/prometheus/client_golang" packages = [ "prometheus", - "prometheus/promhttp" + "prometheus/promhttp", ] + pruneopts = "UT" revision = "c5b7fccd204277076155f10851dad72b76a49317" version = "v0.8.0" [[projects]] branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "UT" revision = "fd36f4220a901265f90734c3183c5f0c91daa0b8" [[projects]] + digest = "1:35cf6bdf68db765988baa9c4f10cc5d7dda1126a54bd62e252dbcd0b1fc8da90" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "UT" revision = "a82f4c12f983cc2649298185f296632953e50d3e" version = "v0.3.0" [[projects]] branch = "master" + digest = "1:08f5524b0ca33fab03c05bd0015337c1d5658c3cf580d4772d789cbe42344db3" name = "github.com/prometheus/procfs" packages = [ ".", - "internal/fs" + "internal/fs", ] + pruneopts = "UT" revision = "740c0778500738e56e1877d52904c431a3fdc573" [[projects]] branch = "master" + digest = "1:d38f81081a389f1466ec98192cf9115a82158854d6f01e1c23e2e7554b97db71" name = "github.com/rcrowley/go-metrics" packages = ["."] + pruneopts = "UT" revision = "3113b8401b8a98917cde58f8bbd42a1b1c03b1fd" [[projects]] + digest = "1:b0c25f00bad20d783d259af2af8666969e2fc343fa0dc9efe52936bbd67fb758" name = "github.com/rs/cors" packages = ["."] + pruneopts = "UT" revision = "9a47f48565a795472d43519dd49aac781f3034fb" version = "v1.6.0" +[[projects]] + digest = "1:9945e4ef330ecb1ca328916effe63b46453c3f39c420c0db97dbdbe832b77662" + name = "github.com/russross/blackfriday" + packages = ["."] + pruneopts = "UT" + revision = "4048872b16cc0fc2c5fd9eacf0ed2c2fedaa0c8c" + version = "v1.5" + [[projects]] branch = "master" + digest = "1:6baa565fe16f8657cf93469b2b8a6c61a277827734400d27e44d589547297279" name = "github.com/ryanuber/go-glob" packages = ["."] + pruneopts = "UT" revision = "51a8f68e6c24dc43f1e371749c89a267de4ebc53" [[projects]] + digest = "1:4e81982884e82550769431cc66c6af26055642e1be8faae2698bca40bee88f6b" name = "github.com/securego/gosec" packages = [ ".", "cmd/gosec", "output", - "rules" + "rules", ] + pruneopts = "UT" revision = "62b5195dd9d28bddfa7c4921bbd6ff84ebbb0ecb" version = "1.3.0" [[projects]] + digest = "1:30e06e6d62a1d694e3cdbff29d8a9a96022e05a487d0c6eaf0ef898965ef28fb" name = "github.com/soheilhy/cmux" packages = ["."] + pruneopts = "UT" revision = "e09e9389d85d8492d313d73d1469c029e710623f" version = "v0.1.4" [[projects]] + digest = "1:bb495ec276ab82d3dd08504bbc0594a65de8c3b22c6f2aaa92d05b73fbf3a82e" name = "github.com/spf13/afero" packages = [ ".", - "mem" + "mem", ] + pruneopts = "UT" revision = "588a75ec4f32903aa5e39a2619ba6a4631e28424" version = "v1.2.2" [[projects]] + digest = "1:08d65904057412fc0270fc4812a1c90c594186819243160dc779a402d4b6d0bc" name = "github.com/spf13/cast" packages = ["."] + pruneopts = "UT" revision = "8c9545af88b134710ab1cd196795e7f2388358d7" version = "v1.3.0" [[projects]] + digest = "1:e01b05ba901239c783dfe56450bcde607fc858908529868259c9a8765dc176d0" name = "github.com/spf13/cobra" - packages = ["."] + packages = [ + ".", + "doc", + ] + pruneopts = "UT" revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385" version = "v0.0.3" [[projects]] + digest = "1:1b753ec16506f5864d26a28b43703c58831255059644351bbcb019b843950900" name = "github.com/spf13/jwalterweatherman" packages = ["."] + pruneopts = "UT" revision = "94f6ae3ed3bceceafa716478c5fbf8d29ca601a1" version = "v1.1.0" [[projects]] + digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "UT" revision = "298182f68c66c05229eb03ac171abe6e309ee79a" version = "v1.0.3" [[projects]] + digest = "1:1b773526998f3dbde3a51a4a5881680c4d237d3600f570d900f97ac93c7ba0a8" name = "github.com/spf13/viper" packages = ["."] + pruneopts = "UT" revision = "9e56dacc08fbbf8c9ee2dbc717553c758ce42bc9" version = "v1.3.2" [[projects]] + digest = "1:ac83cf90d08b63ad5f7e020ef480d319ae890c208f8524622a2f3136e2686b02" name = "github.com/stretchr/objx" packages = ["."] + pruneopts = "UT" revision = "477a77ecc69700c7cdeb1fa9e129548e1c1c393c" version = "v0.1.1" [[projects]] + digest = "1:5ea0fb53a4ca0e78b864d221671e6d0600334bcefdf6223f8948ed71ecc6e891" name = "github.com/stretchr/testify" packages = [ "assert", "http", "mock", - "require" + "require", ] + pruneopts = "UT" revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053" version = "v1.3.0" [[projects]] + digest = "1:3c1a69cdae3501bf75e76d0d86dc6f2b0a7421bc205c0cb7b96b19eed464a34d" name = "github.com/uber-go/atomic" packages = ["."] + pruneopts = "UT" revision = "1ea20fb1cbb1cc08cbd0d913a96dead89aa18289" version = "v1.3.2" [[projects]] + digest = "1:359519fad3780843e57c5117ddf751284a9e0e3c050753ad362476cf1e10ef49" name = "github.com/uber/jaeger-client-go" packages = [ ".", @@ -698,11 +886,13 @@ "thrift-gen/zipkincore", "transport", "transport/zipkin", - "utils" + "utils", ] + pruneopts = "UT" revision = "6733ee486c780528f2c8088305e16fdb685134c7" [[projects]] + digest = "1:1aca23d09c5fd39cd9d630ad84aa6fb7d04aa0278dcf078257e45586b545d4b8" name = "github.com/uber/jaeger-lib" packages = [ "metrics", @@ -711,12 +901,14 @@ "metrics/go-kit", "metrics/go-kit/expvar", "metrics/metricstest", - "metrics/prometheus" + "metrics/prometheus", ] + pruneopts = "UT" revision = "0e30338a695636fe5bcf7301e8030ce8dd2a8530" version = "v2.0.0" [[projects]] + digest = "1:992341833a2041170ef76a24fbabc2b44667056816add68ff6fdb6e835ab3d38" name = "github.com/uber/tchannel-go" packages = [ ".", @@ -731,35 +923,43 @@ "tnet", "tos", "trand", - "typed" + "typed", ] + pruneopts = "UT" revision = "4e23485fd5de65e8676619a55e711eea7437041e" version = "v1.13.0" [[projects]] + digest = "1:a5158647b553c61877aa9ae74f4015000294e47981e6b8b07525edcbb0747c81" name = "go.uber.org/atomic" packages = ["."] + pruneopts = "UT" revision = "df976f2515e274675050de7b3f42545de80594fd" version = "v1.4.0" [[projects]] + digest = "1:a51a1c97b728b00cc514dfe5f78aad3354491792e69b881ea88176dd3fa30ef6" name = "go.uber.org/automaxprocs" packages = [ ".", "internal/cgroups", "internal/runtime", - "maxprocs" + "maxprocs", ] + pruneopts = "UT" revision = "946a8391268aea0a60a86403988ff3ab4b604a83" version = "v1.2.0" [[projects]] + digest = "1:60bf2a5e347af463c42ed31a493d817f8a72f102543060ed992754e689805d1a" name = "go.uber.org/multierr" packages = ["."] + pruneopts = "UT" revision = "3c4937480c32f4c13a875a1829af76c98ca3d40a" version = "v1.1.0" [[projects]] + digest = "1:72907c06e49a4a0e2d7682c540f15292fd330a30468a5fc0e5debbb2827ab89e" name = "go.uber.org/zap" packages = [ ".", @@ -770,13 +970,15 @@ "internal/ztest", "zapcore", "zaptest", - "zaptest/observer" + "zaptest/observer", ] + pruneopts = "UT" revision = "27376062155ad36be76b0f12cf1572a221d3a48c" version = "v1.10.0" [[projects]] branch = "master" + digest = "1:6bf120070ed448fd0a139da7b9514006b3390bd815a0013c50cc672c24a74fa1" name = "golang.org/x/net" packages = [ "bpf", @@ -793,17 +995,21 @@ "ipv4", "ipv6", "proxy", - "trace" + "trace", ] + pruneopts = "UT" revision = "f4e77d36d62c17c2336347bb2670ddbd02d092b7" [[projects]] branch = "master" + digest = "1:1ddfda089b8a15d92242412aabc1107b8c7a87c609c09c5b441c81dbcca0ab79" name = "golang.org/x/sys" packages = ["unix"] + pruneopts = "UT" revision = "ca7f33d4116e3a1f9425755d6a44e7ed9b4c97df" [[projects]] + digest = "1:66a2f252a58b4fbbad0e4e180e1d85a83c222b6bce09c3dcdef3dc87c72eda7c" name = "golang.org/x/text" packages = [ "collate", @@ -822,13 +1028,15 @@ "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width" + "width", ] + pruneopts = "UT" revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475" version = "v0.3.2" [[projects]] branch = "master" + digest = "1:8fb07ee1b949c26c76a1b49c427a68e62eac186f5333efa49ac530bf1947ac93" name = "golang.org/x/tools" packages = [ "go/ast/astutil", @@ -842,20 +1050,24 @@ "go/types/typeutil", "internal/fastwalk", "internal/gopathwalk", - "internal/semver" + "internal/semver", ] + pruneopts = "UT" revision = "2d16b83fe98cd1bed9e2ce9fdc86bd438d14aab7" [[projects]] branch = "master" + digest = "1:0192456453dce48f4d2c53185ca6b34f50da9bc4fe9951f37c0c22118aa12d99" name = "google.golang.org/genproto" packages = [ "googleapis/api/annotations", - "googleapis/rpc/status" + "googleapis/rpc/status", ] + pruneopts = "UT" revision = "54afdca5d873f7b529e2ce3def1a99df16feda90" [[projects]] + digest = "1:8016400c5387900284bbdba32d36e5844f40cb32907b6d736bd4fb91e7cadae6" name = "google.golang.org/grpc" packages = [ ".", @@ -894,34 +1106,42 @@ "status", "tap", "test/bufconn", - "test/grpc_testing" + "test/grpc_testing", ] + pruneopts = "UT" revision = "25c4f928eaa6d96443009bd842389fb4fa48664e" version = "v1.20.1" [[projects]] + digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" packages = ["."] + pruneopts = "UT" revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" version = "v0.9.1" [[projects]] + digest = "1:9a1d716749c77399bfa71792d77eef3278586423947f3431dbac6d6049c24787" name = "gopkg.in/olivere/elastic.v5" packages = [ ".", "config", - "uritemplates" + "uritemplates", ] + pruneopts = "UT" revision = "f72acaba629a7ec879103d17b7426a31bc38e199" version = "v5.0.80" [[projects]] + digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "UT" revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" version = "v2.2.2" [[projects]] + digest = "1:e7f29d557575410f09b303a6270a20f17b2dcb69d3bbc4d71d89f5d8e927416d" name = "honnef.co/go/tools" packages = [ "arg", @@ -944,14 +1164,104 @@ "staticcheck/vrp", "stylecheck", "unused", - "version" + "version", ] + pruneopts = "UT" revision = "95959eaf5e3c41c66151dcfd91779616b84077a8" version = "2019.1.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "fde68143d765848fc18e34ad05696cfbd047097f35388f1763d38ee01098eee8" + input-imports = [ + "github.com/Shopify/sarama", + "github.com/Shopify/sarama/mocks", + "github.com/apache/thrift/lib/go/thrift", + "github.com/bsm/sarama-cluster", + "github.com/crossdock/crossdock-go", + "github.com/dgraph-io/badger", + "github.com/go-openapi/errors", + "github.com/go-openapi/loads", + "github.com/go-openapi/runtime", + "github.com/go-openapi/runtime/middleware", + "github.com/go-openapi/runtime/security", + "github.com/go-openapi/spec", + "github.com/go-openapi/strfmt", + "github.com/go-openapi/swag", + "github.com/go-openapi/validate", + "github.com/gocql/gocql", + "github.com/gogo/googleapis/google/api", + "github.com/gogo/protobuf/gogoproto", + "github.com/gogo/protobuf/jsonpb", + "github.com/gogo/protobuf/proto", + "github.com/gogo/protobuf/protoc-gen-gogo", + "github.com/gogo/protobuf/types", + "github.com/golang/protobuf/proto", + "github.com/golang/protobuf/protoc-gen-go", + "github.com/gorilla/handlers", + "github.com/gorilla/mux", + "github.com/grpc-ecosystem/go-grpc-middleware/retry", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options", + "github.com/hashicorp/go-hclog", + "github.com/hashicorp/go-plugin", + "github.com/kr/pretty", + "github.com/opentracing-contrib/go-stdlib/nethttp", + "github.com/opentracing/opentracing-go", + "github.com/opentracing/opentracing-go/ext", + "github.com/opentracing/opentracing-go/log", + "github.com/pkg/errors", + "github.com/prometheus/client_golang/prometheus", + "github.com/prometheus/client_golang/prometheus/promhttp", + "github.com/rs/cors", + "github.com/russross/blackfriday", + "github.com/securego/gosec/cmd/gosec", + "github.com/soheilhy/cmux", + "github.com/spf13/cobra", + "github.com/spf13/cobra/doc", + "github.com/spf13/pflag", + "github.com/spf13/viper", + "github.com/stretchr/testify/assert", + "github.com/stretchr/testify/http", + "github.com/stretchr/testify/mock", + "github.com/stretchr/testify/require", + "github.com/uber/jaeger-client-go", + "github.com/uber/jaeger-client-go/config", + "github.com/uber/jaeger-client-go/log/zap", + "github.com/uber/jaeger-client-go/rpcmetrics", + "github.com/uber/jaeger-client-go/transport", + "github.com/uber/jaeger-client-go/transport/zipkin", + "github.com/uber/jaeger-lib/metrics", + "github.com/uber/jaeger-lib/metrics/expvar", + "github.com/uber/jaeger-lib/metrics/metricstest", + "github.com/uber/jaeger-lib/metrics/prometheus", + "github.com/uber/tchannel-go", + "github.com/uber/tchannel-go/raw", + "github.com/uber/tchannel-go/testutils", + "github.com/uber/tchannel-go/thrift", + "go.uber.org/atomic", + "go.uber.org/automaxprocs", + "go.uber.org/zap", + "go.uber.org/zap/zapcore", + "go.uber.org/zap/zaptest", + "go.uber.org/zap/zaptest/observer", + "golang.org/x/net/context", + "golang.org/x/sys/unix", + "google.golang.org/grpc", + "google.golang.org/grpc/balancer/roundrobin", + "google.golang.org/grpc/credentials", + "google.golang.org/grpc/grpclog", + "google.golang.org/grpc/metadata", + "google.golang.org/grpc/peer", + "google.golang.org/grpc/resolver", + "google.golang.org/grpc/resolver/manual", + "google.golang.org/grpc/status", + "google.golang.org/grpc/test/bufconn", + "google.golang.org/grpc/test/grpc_testing", + "gopkg.in/olivere/elastic.v5", + "gopkg.in/yaml.v2", + "honnef.co/go/tools/cmd/staticcheck", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index f9d56d26542..8641413990b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -30,7 +30,8 @@ required = [ "github.com/golang/protobuf/protoc-gen-go", "github.com/gogo/protobuf/protoc-gen-gogo", "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", - "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", + "github.com/russross/blackfriday" ] [[constraint]] @@ -49,6 +50,11 @@ required = [ name = "github.com/bsm/sarama-cluster" version = "=2.1.13" +[[constraint]] + name = "github.com/russross/blackfriday" + version = "=1.5" + + [[constraint]] branch = "master" name = "github.com/crossdock/crossdock-go" diff --git a/cmd/agent/main.go b/cmd/agent/main.go index 0c817dbb407..faea5ff5ce2 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -30,6 +30,7 @@ import ( "github.com/jaegertracing/jaeger/cmd/agent/app/reporter" "github.com/jaegertracing/jaeger/cmd/agent/app/reporter/grpc" "github.com/jaegertracing/jaeger/cmd/agent/app/reporter/tchannel" + "github.com/jaegertracing/jaeger/cmd/docs" "github.com/jaegertracing/jaeger/cmd/flags" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/version" @@ -84,6 +85,7 @@ func main() { } command.AddCommand(version.Command()) + command.AddCommand(docs.Command(v)) config.AddFlags( v, diff --git a/cmd/all-in-one/main.go b/cmd/all-in-one/main.go index a319abc7210..0ad07e9f7a7 100644 --- a/cmd/all-in-one/main.go +++ b/cmd/all-in-one/main.go @@ -24,13 +24,13 @@ import ( "strconv" "github.com/gorilla/mux" - opentracing "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go" "github.com/spf13/cobra" "github.com/spf13/viper" jaegerClientConfig "github.com/uber/jaeger-client-go/config" jaegerClientZapLog "github.com/uber/jaeger-client-go/log/zap" "github.com/uber/jaeger-lib/metrics" - tchannel "github.com/uber/tchannel-go" + "github.com/uber/tchannel-go" "github.com/uber/tchannel-go/thrift" _ "go.uber.org/automaxprocs" "go.uber.org/zap" @@ -47,6 +47,7 @@ import ( "github.com/jaegertracing/jaeger/cmd/collector/app/sampling" "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/strategystore" "github.com/jaegertracing/jaeger/cmd/collector/app/zipkin" + "github.com/jaegertracing/jaeger/cmd/docs" "github.com/jaegertracing/jaeger/cmd/env" "github.com/jaegertracing/jaeger/cmd/flags" queryApp "github.com/jaegertracing/jaeger/cmd/query/app" @@ -150,6 +151,7 @@ func main() { command.AddCommand(version.Command()) command.AddCommand(env.Command()) + command.AddCommand(docs.Command(v)) config.AddFlags( v, diff --git a/cmd/collector/main.go b/cmd/collector/main.go index 007bc61944f..4a07d518d66 100644 --- a/cmd/collector/main.go +++ b/cmd/collector/main.go @@ -42,6 +42,7 @@ import ( "github.com/jaegertracing/jaeger/cmd/collector/app/sampling" "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/strategystore" "github.com/jaegertracing/jaeger/cmd/collector/app/zipkin" + "github.com/jaegertracing/jaeger/cmd/docs" "github.com/jaegertracing/jaeger/cmd/env" "github.com/jaegertracing/jaeger/cmd/flags" "github.com/jaegertracing/jaeger/pkg/config" @@ -165,6 +166,7 @@ func main() { command.AddCommand(version.Command()) command.AddCommand(env.Command()) + command.AddCommand(docs.Command(v)) config.AddFlags( v, diff --git a/cmd/docs/command.go b/cmd/docs/command.go new file mode 100644 index 00000000000..14723e86909 --- /dev/null +++ b/cmd/docs/command.go @@ -0,0 +1,86 @@ +// Copyright (c) 2019 The Jaeger Authors. +// +// 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. + +package docs + +import ( + "flag" + "fmt" + "log" + + "github.com/spf13/cobra" + "github.com/spf13/cobra/doc" + "github.com/spf13/viper" +) + +const ( + formatFlag = "format" + dirFlag = "dir" +) + +var ( + formats = []string{"md", "man", "rst", "yaml"} +) + +// Command for generating flags/commands documentation. +// It generates the documentation for all commands starting at parent. +func Command(v *viper.Viper) *cobra.Command { + c := &cobra.Command{ + Use: "docs", + Short: "Generates documentation", + Long: `Generates command and flags documentation`, + RunE: func(cmd *cobra.Command, args []string) error { + for cmd.Parent() != nil { + cmd = cmd.Parent() + } + dir := v.GetString(dirFlag) + log.Printf("Generating documentation in %v", dir) + switch v.GetString(formatFlag) { + case "md": + return doc.GenMarkdownTree(cmd, dir) + case "man": + return genMan(cmd, dir) + case "rst": + return doc.GenReSTTree(cmd, dir) + case "yaml": + return doc.GenYamlTree(cmd, dir) + default: + return fmt.Errorf("undefined value of %v, possible values are: %v", formatFlag, formats) + } + }, + } + c.Flags().AddGoFlagSet(flags(&flag.FlagSet{})) + v.BindPFlags(c.Flags()) + return c +} + +func flags(flagSet *flag.FlagSet) *flag.FlagSet { + flagSet.String( + formatFlag, + formats[0], + fmt.Sprintf("Supported formats: %v.", formats)) + flagSet.String( + dirFlag, + "./", + "Directory where generate the documentation.") + return flagSet +} + +func genMan(cmd *cobra.Command, dir string) error { + header := &doc.GenManHeader{ + Title: cmd.Use, + Section: "1", + } + return doc.GenManTree(cmd, header, dir) +} diff --git a/cmd/docs/command_test.go b/cmd/docs/command_test.go new file mode 100644 index 00000000000..95d7457958b --- /dev/null +++ b/cmd/docs/command_test.go @@ -0,0 +1,68 @@ +// Copyright (c) 2019 The Jaeger Authors. +// +// 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. + +package docs + +import ( + "io/ioutil" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestOutputFormats(t *testing.T) { + tests := []struct{ + file string + flag string + err string + }{ + {file: "docs.md"}, + {file: "docs.1", flag: "--format=man"}, + {file: "docs.rst", flag: "--format=rst"}, + {file: "docs.yaml", flag: "--format=yaml"}, + {flag: "--format=foo", err: "undefined value of format, possible values are: [md man rst yaml]"}, + } + for _, test := range tests { + v := viper.New() + cmd := Command(v) + cmd.ParseFlags([]string{test.flag}) + err := cmd.Execute() + if err == nil { + f, err := ioutil.ReadFile(test.file) + require.NoError(t, err) + assert.True(t, strings.Contains(string(f), "documentation")) + } else { + assert.Equal(t, test.err, err.Error()) + } + } +} + +func TestDocsForParent(t *testing.T) { + parent := &cobra.Command{ + Use: "root_command", + Short: "some description", + } + v := viper.New() + docs := Command(v) + parent.AddCommand(docs) + err := docs.RunE(docs, []string{}) + require.NoError(t, err) + f, err := ioutil.ReadFile("root_command.md") + require.NoError(t, err) + assert.True(t, strings.Contains(string(f), "some description")) +} diff --git a/cmd/ingester/main.go b/cmd/ingester/main.go index dfbb67ca067..ffbc08e4f98 100644 --- a/cmd/ingester/main.go +++ b/cmd/ingester/main.go @@ -26,6 +26,7 @@ import ( _ "go.uber.org/automaxprocs" "go.uber.org/zap" + "github.com/jaegertracing/jaeger/cmd/docs" "github.com/jaegertracing/jaeger/cmd/env" "github.com/jaegertracing/jaeger/cmd/flags" "github.com/jaegertracing/jaeger/cmd/ingester/app" @@ -91,6 +92,7 @@ func main() { command.AddCommand(version.Command()) command.AddCommand(env.Command()) + command.AddCommand(docs.Command(v)) config.AddFlags( v, diff --git a/cmd/query/main.go b/cmd/query/main.go index 26fd2e82aca..a601d9c7bc2 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -28,6 +28,7 @@ import ( _ "go.uber.org/automaxprocs" "go.uber.org/zap" + "github.com/jaegertracing/jaeger/cmd/docs" "github.com/jaegertracing/jaeger/cmd/env" "github.com/jaegertracing/jaeger/cmd/flags" "github.com/jaegertracing/jaeger/cmd/query/app" @@ -113,6 +114,7 @@ func main() { command.AddCommand(version.Command()) command.AddCommand(env.Command()) + command.AddCommand(docs.Command(v)) config.AddFlags( v,