diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..b759c73 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,37 @@ +linters: + enable-all: true + disable: + - goimports + - depguard # не используется + - gochecknoinits + - gochecknoglobals + - wsl + - gocognit + - godox # находит тудушки, не нужно + - golint # подумать, может вернуть + - stylecheck # подумать, может вернуть + +linters-settings: + maligned: + suggest-new: true + lll: + line-length: 140 + tab-width: 1 + funlen: + lines: 80 + statements: 40 + prealloc: + # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. + # True by default. + simple: true + range-loops: true # Report preallocation suggestions on range loops, true by default + for-loops: true # Report preallocation suggestions on for loops, false by default + gocritic: + # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. + # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". + enabled-tags: + - diagnostic + - performance + settings: + hugeParam: + sizeThreshold: 90 diff --git a/.version b/.version index fe16b34..e70b452 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.5.4 +2.6.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index b5f7256..29ddf24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 2.6.0 +* migrate to go mod ## 2.5.4 * fix auth cache ## 2.5.3 diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index c3037ec..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,696 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:c68aba66f5db6052fd838d9a7d60d8859f8c11b8c1d9ac9758f69c7a51efc07a" - name = "github.com/asaskevich/govalidator" - packages = ["."] - pruneopts = "UT" - revision = "475eaeb164960a651e97470412a7d3b0c5036105" - version = "v10" - -[[projects]] - digest = "1:652880afc6b57ce0a67173f552cb35ccda816493a1da6ca20e5074a66bcd083f" - name = "github.com/buaazp/fasthttprouter" - packages = ["."] - pruneopts = "UT" - revision = "ade4e2031af3aed7fffd241084aad80a58faf421" - version = "v0.1.1" - -[[projects]] - digest = "1:bc7e9c56408594a678dd165db7c579c2498a3c9eab9b308099820ddbfe85b720" - name = "github.com/cenkalti/backoff" - packages = ["."] - pruneopts = "UT" - revision = "a9a4cec6c9a26336ca42700ccc319ca842be56c0" - version = "v4.0.0" - -[[projects]] - digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "UT" - revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" - version = "v1.1.1" - -[[projects]] - digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" - name = "github.com/dgrijalva/jwt-go" - packages = ["."] - pruneopts = "UT" - revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" - version = "v3.2.0" - -[[projects]] - branch = "master" - digest = "1:14f76940ab7adca0fe74b977f88312990f3577fd51517afb9d6cd7850aca48c6" - name = "github.com/fasthttp/websocket" - packages = ["."] - pruneopts = "UT" - revision = "4824a47506583ed9c4c44b6e266137898af82503" - -[[projects]] - digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" - name = "github.com/fsnotify/fsnotify" - packages = ["."] - pruneopts = "UT" - revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" - version = "v1.4.7" - -[[projects]] - digest = "1:f9448bfab8ebe44e3d91e4e4475cf92d60789a614652f361df4e41972c9d5caf" - name = "github.com/go-pg/pg" - packages = [ - ".", - "internal", - "internal/iszero", - "internal/parser", - "internal/pool", - "internal/struct_filter", - "internal/tag", - "orm", - "types", - ] - pruneopts = "UT" - revision = "1d957cb20f319c4a1e2db7d345824c12aefe5943" - version = "v8.0.6" - -[[projects]] - digest = "1:b46f50677ef33284ebde2b285a42b707ff9e1de1f37328d91869859c929ebbd2" - name = "github.com/go-redis/redis" - packages = [ - ".", - "internal", - "internal/consistenthash", - "internal/hashtag", - "internal/pool", - "internal/proto", - "internal/util", - ] - pruneopts = "UT" - revision = "7f69d5e32072d151eb6936cbe2306413e8117488" - version = "v6.15.6" - -[[projects]] - digest = "1:07f4fafe81587b642166199f41c3edcca12929fcfcc0261b00be5dea2f968f44" - name = "github.com/golang/protobuf" - packages = [ - "proto", - "ptypes", - "ptypes/any", - "ptypes/duration", - "ptypes/struct", - "ptypes/timestamp", - ] - pruneopts = "UT" - revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7" - version = "v1.3.2" - -[[projects]] - digest = "1:c0d19ab64b32ce9fe5cf4ddceba78d5bc9807f0016db6b1183599da3dcc24d10" - name = "github.com/hashicorp/hcl" - packages = [ - ".", - "hcl/ast", - "hcl/parser", - "hcl/printer", - "hcl/scanner", - "hcl/strconv", - "hcl/token", - "json/parser", - "json/scanner", - "json/token", - ] - pruneopts = "UT" - revision = "8cb6e5b959231cc1119e43259c4a608f9c51a241" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:2cf4ff28b309c93a52b3329c7a22d5375b137249d4ed63c9d40707a1b253f7df" - name = "github.com/integration-system/bellows" - packages = ["."] - pruneopts = "UT" - revision = "244325e8836c364c86f308e3aef7e979cb007114" - -[[projects]] - branch = "master" - digest = "1:c4f3970d1f30f5e9bc1751b62b7ea6127256e59fd63a3d36e166fe1121250c57" - name = "github.com/integration-system/go-cmp" - packages = [ - "cmp", - "cmp/internal/diff", - "cmp/internal/function", - "cmp/internal/value", - ] - pruneopts = "UT" - revision = "ac5582987a2f25e8743e0ebb7259312adda05c23" - -[[projects]] - digest = "1:abd0cd78d6d27a98080f2b2a7fd39bb2f3d3eef6aa20c720093129f04fb41d78" - name = "github.com/integration-system/gowsdl" - packages = ["soap"] - pruneopts = "UT" - revision = "f40910e51f21c991494ec27da83b8aa9ff3242f3" - version = "v1.0.0" - -[[projects]] - digest = "1:0e89aed3581cac97a24fcbde2cc3dcc7bf7168401c56284c81213fa2cc273ed5" - name = "github.com/integration-system/isp-etp-go" - packages = [ - "ack", - "bpool", - "client", - "gen", - "parser", - ] - pruneopts = "UT" - revision = "aab01a1b29ac06ebeb0216b9b43708491b8d5aee" - version = "v2.0.2" - -[[projects]] - branch = "master" - digest = "1:9b7cbba3fe2efd27a291295e19a3731cd7bb1e0dcb6f41883e95b74f4ba0e09e" - name = "github.com/integration-system/isp-io" - packages = ["."] - pruneopts = "UT" - revision = "3daf588d878f287976f55a53917d535f787b7d64" - -[[projects]] - digest = "1:4b08bfb7e05c857ab9f985805f5c1e4c3049198f6909ddb5c632a3617322e4b7" - name = "github.com/integration-system/isp-journal" - packages = [ - ".", - "entry", - "log", - "rx", - "transfer", - ] - pruneopts = "UT" - revision = "13eb459c9964997befc886deba4d2dfb2c261b23" - version = "v1.3.0" - -[[projects]] - digest = "1:03cb16497b7b2b0328e62a3755d5662a74f70bea23c09b56a64d7dc8619e8c0c" - name = "github.com/integration-system/isp-lib" - packages = [ - "backend", - "bootstrap", - "config", - "config/schema", - "database", - "http", - "logger", - "metric", - "proto/stubs", - "redis", - "streaming", - "structure", - "utils", - ] - pruneopts = "UT" - revision = "4ea9449f1b3f2565b9038b0d4cdda3b02089aa8c" - version = "v2.1.0" - -[[projects]] - branch = "master" - digest = "1:1789fb6e57949a6e4cacb74023cd30efb04b09dc6111d6ef3718241ebb23ebe9" - name = "github.com/integration-system/isp-log" - packages = [ - ".", - "stdcodes", - ] - pruneopts = "UT" - revision = "a22bf2e0b56a9ef47db4a98756e39f700a99b688" - -[[projects]] - digest = "1:e9229e8f68f2f13e638de9159274f536a7a609a61beba0416af603282bfa3464" - name = "github.com/integration-system/jsonschema" - packages = ["."] - pruneopts = "UT" - revision = "e1ccd0b9edbdf65911efd04d92220df84a9ce388" - version = "v1.0.0" - -[[projects]] - digest = "1:01ed62f8f4f574d8aff1d88caee113700a2b44c42351943fa73cc1808f736a50" - name = "github.com/jinzhu/inflection" - packages = ["."] - pruneopts = "UT" - revision = "f5c5f50e6090ae76a29240b61ae2a90dd810112e" - version = "v1.0.0" - -[[projects]] - digest = "1:1e5d8fd04f72d46575b44341578192f5a473c23301262c8ea9867bd2f4130687" - name = "github.com/json-iterator/go" - packages = [ - ".", - "extra", - ] - pruneopts = "UT" - revision = "acfec88f7a0d5140ace3dcdbee10184e3684a9e1" - version = "v1.1.9" - -[[projects]] - digest = "1:60a4c716301192a7be42f363c41b2b1fab64ae80d9db4453c702b13b05ccddeb" - name = "github.com/klauspost/compress" - packages = [ - "flate", - "gzip", - "zlib", - ] - pruneopts = "UT" - revision = "f61bac3a179b270c811148ce2a1f819dfc82825f" - version = "v1.9.7" - -[[projects]] - digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de" - name = "github.com/konsorten/go-windows-terminal-sequences" - packages = ["."] - pruneopts = "UT" - revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e" - version = "v1.0.2" - -[[projects]] - digest = "1:9ff22c26414baf7deaf74f2a788fe7b97666048bcbe346c52cfe823442abbdfb" - name = "github.com/lib/pq" - packages = [ - ".", - "oid", - "scram", - ] - pruneopts = "UT" - revision = "99274577be97ac9b1d95a2d61d566dc9b7cc6a54" - version = "v1.3.0" - -[[projects]] - digest = "1:5a0ef768465592efca0412f7e838cdc0826712f8447e70e6ccc52eb441e9ab13" - name = "github.com/magiconair/properties" - packages = ["."] - pruneopts = "UT" - revision = "de8848e004dd33dc07a2947b3d76f618a7fc7ef1" - version = "v1.8.1" - -[[projects]] - digest = "1:4a29eeb25603debe8f2098a9902c4d3851034cf70d33be428826e86e8c30a1b0" - name = "github.com/mattn/go-colorable" - packages = ["."] - pruneopts = "UT" - revision = "98ec13f34aabf44cc914c65a1cfb7b9bc815aef1" - version = "v0.1.4" - -[[projects]] - digest = "1:29895093e370d9da5fd1c9ab12a5855ccb568f28766e0c3ff159c4b0f09aa127" - name = "github.com/mattn/go-isatty" - packages = ["."] - pruneopts = "UT" - revision = "31745d66dd679ac0ac4f8d3ecff168fce6170c6a" - version = "v0.0.11" - -[[projects]] - branch = "master" - digest = "1:2b32af4d2a529083275afc192d1067d8126b578c7a9613b26600e4df9c735155" - name = "github.com/mgutz/ansi" - packages = ["."] - pruneopts = "UT" - revision = "9520e82c474b0a04dd04f8a40959027271bab992" - -[[projects]] - digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318" - name = "github.com/mitchellh/mapstructure" - packages = ["."] - pruneopts = "UT" - revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe" - version = "v1.1.2" - -[[projects]] - digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563" - name = "github.com/modern-go/concurrent" - packages = ["."] - pruneopts = "UT" - revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" - version = "1.0.3" - -[[projects]] - digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855" - name = "github.com/modern-go/reflect2" - packages = ["."] - pruneopts = "UT" - revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" - version = "1.0.1" - -[[projects]] - branch = "master" - digest = "1:84bd7f8a2e0bcd53ddc33c3b47c34c1fe340c8632cbe928f7f8ae10ec6ecdd62" - name = "github.com/mohae/deepcopy" - packages = ["."] - pruneopts = "UT" - revision = "c48cc78d482608239f6c4c92a4abd87eb8761c90" - -[[projects]] - digest = "1:6eea828983c70075ca297bb915ffbcfd3e34c5a50affd94428a65df955c0ff9c" - name = "github.com/pelletier/go-toml" - packages = ["."] - pruneopts = "UT" - revision = "903d9455db9ff1d7ac1ab199062eca7266dd11a3" - version = "v1.6.0" - -[[projects]] - digest = "1:9e1d37b58d17113ec3cb5608ac0382313c5b59470b94ed97d0976e69c7022314" - name = "github.com/pkg/errors" - packages = ["."] - pruneopts = "UT" - revision = "614d223910a179a466c1767a985424175c39b465" - version = "v0.9.1" - -[[projects]] - digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "UT" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - digest = "1:7d99649602f68b73ade640ca6975ccc38735f329e159c6a507b63f00213678c0" - name = "github.com/pressly/goose" - packages = ["."] - pruneopts = "UT" - revision = "e4b98955473e91a12fc7d8816c28d06376d1d92c" - version = "v2.6.0" - -[[projects]] - branch = "master" - digest = "1:5bbebe8ac19ecb6c87790a89faa20566e38ed0d6494a1d14c4f5b05d9ce2436c" - name = "github.com/rcrowley/go-metrics" - packages = ["."] - pruneopts = "UT" - revision = "cac0b30c2563378d434b5af411844adff8e32960" - -[[projects]] - branch = "master" - digest = "1:46aede8169d6df9d740c0fd6f3f8bf4f15e1c465a45cd1d7a1943c5d3c580934" - name = "github.com/savsgio/gotils" - packages = ["."] - pruneopts = "UT" - revision = "8f138daf3830703e420eba613f733190da9393ff" - -[[projects]] - digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976" - name = "github.com/sirupsen/logrus" - packages = ["."] - pruneopts = "UT" - revision = "839c75faf7f98a33d445d181f3018b5c3409a45e" - version = "v1.4.2" - -[[projects]] - digest = "1:bb495ec276ab82d3dd08504bbc0594a65de8c3b22c6f2aaa92d05b73fbf3a82e" - name = "github.com/spf13/afero" - packages = [ - ".", - "mem", - ] - pruneopts = "UT" - revision = "588a75ec4f32903aa5e39a2619ba6a4631e28424" - version = "v1.2.2" - -[[projects]] - digest = "1:ff4cd55a3666b6ea3a876c9e133bfb54d6c812e725409a773f2c94a0b3a92f4f" - name = "github.com/spf13/cast" - packages = ["."] - pruneopts = "UT" - revision = "1ffadf551085444af981432dd0f6d1160c11ec64" - version = "v1.3.1" - -[[projects]] - digest = "1:1b753ec16506f5864d26a28b43703c58831255059644351bbcb019b843950900" - name = "github.com/spf13/jwalterweatherman" - packages = ["."] - pruneopts = "UT" - revision = "94f6ae3ed3bceceafa716478c5fbf8d29ca601a1" - version = "v1.1.0" - -[[projects]] - digest = "1:524b71991fc7d9246cc7dc2d9e0886ccb97648091c63e30eef619e6862c955dd" - name = "github.com/spf13/pflag" - packages = ["."] - pruneopts = "UT" - revision = "2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab" - version = "v1.0.5" - -[[projects]] - digest = "1:83d0e0f3f46dc86daf27e4d7c834c8c492db787c53c09d94183de7478db92142" - name = "github.com/spf13/viper" - packages = ["."] - pruneopts = "UT" - revision = "4525543ce4fe90f7970f5e2cdc300b8ffc8c0582" - version = "v1.6.2" - -[[projects]] - digest = "1:8548c309c65a85933a625be5e7d52b6ac927ca30c56869fae58123b8a77a75e1" - name = "github.com/stretchr/testify" - packages = ["assert"] - pruneopts = "UT" - revision = "221dbe5ed46703ee255b1da0dec05086f5035f62" - version = "v1.4.0" - -[[projects]] - digest = "1:f4b32291cad5efac2bfdba89ccde6aa04618b62ce06c1a571da2dc4f3f2677fb" - name = "github.com/subosito/gotenv" - packages = ["."] - pruneopts = "UT" - revision = "2ef7124db659d49edac6aa459693a15ae36c671a" - version = "v1.2.0" - -[[projects]] - branch = "master" - digest = "1:d32b64a7a82dd36b674fb73ff767e949eb7155b6b574ff276f49d4edc8af105f" - name = "github.com/thecodeteam/goodbye" - packages = ["."] - pruneopts = "UT" - revision = "a83968bda2d37294a3541b7d2207fb6f5a3559a3" - -[[projects]] - digest = "1:c468422f334a6b46a19448ad59aaffdfc0a36b08fdcc1c749a0b29b6453d7e59" - name = "github.com/valyala/bytebufferpool" - packages = ["."] - pruneopts = "UT" - revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:7c0bdc8b37e445219e90c5909cfaef9dfb8caf5fb75cfe598a6221427ff85744" - name = "github.com/valyala/fasthttp" - packages = [ - ".", - "fasthttputil", - "stackless", - ] - pruneopts = "UT" - revision = "03813ae4bce8b5984118f62d5f017da3e87c9189" - -[[projects]] - digest = "1:39a425f98fb19427061a693fe6bf0683c9bddec4b25b17067e34fdb465e39cb9" - name = "github.com/x-cray/logrus-prefixed-formatter" - packages = ["."] - pruneopts = "UT" - revision = "bb2702d423886830dee131692131d35648c382e2" - version = "v0.5.2" - -[[projects]] - branch = "master" - digest = "1:c0aaca73817c074594c68efae05e33b71abbcc7d10af8ac7bf964bccbe308a8f" - name = "golang.org/x/crypto" - packages = [ - "pbkdf2", - "ssh/terminal", - ] - pruneopts = "UT" - revision = "6d4e4cb37c7d6416dfea8472e751c7b6615267a6" - -[[projects]] - branch = "master" - digest = "1:4311090d37cc317b15a3a3d2ce9a3d187d0b667ded11339a9564b3ec38cb21e4" - name = "golang.org/x/net" - packages = [ - "context", - "http/httpguts", - "http2", - "http2/hpack", - "idna", - "internal/timeseries", - "trace", - ] - pruneopts = "UT" - revision = "6afb5195e5aab057fda82e27171243402346b0ad" - -[[projects]] - branch = "master" - digest = "1:f7b9c8ac6e14581494d8f20a044878b1d23aac99e49bc4f1ac831a973fb9ccfd" - name = "golang.org/x/sys" - packages = [ - "unix", - "windows", - ] - pruneopts = "UT" - revision = "b77594299b429d05028403d72b68172959c7dad5" - -[[projects]] - digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405" - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/language", - "internal/language/compact", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable", - ] - pruneopts = "UT" - revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475" - version = "v0.3.2" - -[[projects]] - branch = "master" - digest = "1:a910255c3b706b4d8f2b185ed6b40c8f31b805111be240def2bdf2c62b87591b" - name = "google.golang.org/genproto" - packages = [ - "googleapis/rpc/errdetails", - "googleapis/rpc/status", - ] - pruneopts = "UT" - revision = "ca5a22157cba8746e7aa978de1b1ac4085150840" - -[[projects]] - digest = "1:3fe55026bb11519b45c0fc9d848fd779028b868dc62f5563c518cf850c7421d5" - name = "google.golang.org/grpc" - packages = [ - ".", - "attributes", - "backoff", - "balancer", - "balancer/base", - "balancer/roundrobin", - "binarylog/grpc_binarylog_v1", - "codes", - "connectivity", - "credentials", - "credentials/internal", - "encoding", - "encoding/proto", - "grpclog", - "internal", - "internal/backoff", - "internal/balancerload", - "internal/binarylog", - "internal/buffer", - "internal/channelz", - "internal/envconfig", - "internal/grpcrand", - "internal/grpcsync", - "internal/resolver/dns", - "internal/resolver/passthrough", - "internal/syscall", - "internal/transport", - "keepalive", - "metadata", - "naming", - "peer", - "resolver", - "serviceconfig", - "stats", - "status", - "tap", - ] - pruneopts = "UT" - revision = "f5b0812e6fe574d90da76b205e9eb51f6ddb1919" - version = "v1.26.0" - -[[projects]] - digest = "1:c4b5592c342f273e18de68e16957f536f6648f2e90c9d7ece653ac90c22079a9" - name = "gopkg.in/ini.v1" - packages = ["."] - pruneopts = "UT" - revision = "94291fffe2b14f4632ec0e67c1bfecfc1287a168" - version = "v1.51.1" - -[[projects]] - digest = "1:b75b3deb2bce8bc079e16bb2aecfe01eb80098f5650f9e93e5643ca8b7b73737" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "UT" - revision = "1f64d6156d11335c3f22d9330b0ad14fc1e789ce" - version = "v2.2.7" - -[[projects]] - digest = "1:999d566ad1ae4303c456af5a155f7b42401cca4fd33552567ed9dd997b107a08" - name = "mellium.im/sasl" - packages = ["."] - pruneopts = "UT" - revision = "e58e780e1378aa4df5dc705364ff5ae9a4dd1e04" - source = "https://github.com/mellium/sasl.git" - version = "v0.2.1" - -[[projects]] - digest = "1:25ea8c84118bb09a6ea1fe5d8a2e72d7ead40af714b74d1e849af821f3502414" - name = "nhooyr.io/websocket" - packages = [ - ".", - "internal/bpool", - "internal/wsjs", - ] - pruneopts = "UT" - revision = "edda9c633d5c78c7d38fcc952b4105dd4ccfb619" - version = "v1.7.4" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/dgrijalva/jwt-go", - "github.com/fasthttp/websocket", - "github.com/go-pg/pg", - "github.com/go-pg/pg/orm", - "github.com/go-redis/redis", - "github.com/golang/protobuf/proto", - "github.com/golang/protobuf/ptypes/struct", - "github.com/integration-system/go-cmp/cmp", - "github.com/integration-system/isp-journal/rx", - "github.com/integration-system/isp-lib/backend", - "github.com/integration-system/isp-lib/bootstrap", - "github.com/integration-system/isp-lib/config", - "github.com/integration-system/isp-lib/config/schema", - "github.com/integration-system/isp-lib/database", - "github.com/integration-system/isp-lib/http", - "github.com/integration-system/isp-lib/metric", - "github.com/integration-system/isp-lib/proto/stubs", - "github.com/integration-system/isp-lib/redis", - "github.com/integration-system/isp-lib/streaming", - "github.com/integration-system/isp-lib/structure", - "github.com/integration-system/isp-lib/utils", - "github.com/integration-system/isp-log", - "github.com/integration-system/isp-log/stdcodes", - "github.com/json-iterator/go", - "github.com/pkg/errors", - "github.com/rcrowley/go-metrics", - "github.com/spf13/cast", - "github.com/stretchr/testify/assert", - "github.com/valyala/fasthttp", - "golang.org/x/net/context", - "google.golang.org/grpc", - "google.golang.org/grpc/codes", - "google.golang.org/grpc/metadata", - "google.golang.org/grpc/status", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 8d7459a..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,41 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" -# -# [prune] -# non-go = false -# go-tests = true -# unused-packages = true - -[[override]] - name = "mellium.im/sasl" - source = "https://github.com/mellium/sasl.git" - -[[override]] - name = "github.com/valyala/fasthttp" - branch = "master" - -[[override]] - name = "github.com/fasthttp/websocket" - branch = "master" - -[prune] - go-tests = true - unused-packages = true diff --git a/accounting/accounting.go b/accounting/accounting.go index ab2f215..c469612 100644 --- a/accounting/accounting.go +++ b/accounting/accounting.go @@ -1,8 +1,8 @@ package accounting import ( - "github.com/integration-system/isp-lib/config" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/config" + "github.com/integration-system/isp-lib/v2/structure" log "github.com/integration-system/isp-log" "isp-gate-service/accounting/state" "isp-gate-service/conf" @@ -94,9 +94,7 @@ func (w *accountingWorker) takeSnapshot() []entity.Snapshot { response := make([]entity.Snapshot, 0, len(lastStorage)) for appId, account := range lastStorage { - limitState, version := account.Snapshot() - response = append(response, entity.Snapshot{ AppId: appId, LimitState: limitState, diff --git a/accounting/accounting_test.go b/accounting/accounting_test.go index 543c78c..39da593 100644 --- a/accounting/accounting_test.go +++ b/accounting/accounting_test.go @@ -1,3 +1,4 @@ +//nolint package accounting import ( diff --git a/accounting/snapshot.go b/accounting/snapshot.go index 4ba4e89..433986f 100644 --- a/accounting/snapshot.go +++ b/accounting/snapshot.go @@ -36,7 +36,7 @@ func (t *snapshotTask) Stop() { snapshotList := worker.takeSnapshot() if len(snapshotList) != 0 { defer func() { - t.wg.Add(1) + t.wg.Add(1) //nolint t.unload(snapshotList) t.wg.Wait() }() @@ -57,7 +57,7 @@ func (t *snapshotTask) run(timeout time.Duration) { case <-t.timeout: list := worker.takeSnapshot() if len(list) > 0 { - t.wg.Add(1) + t.wg.Add(1) //nolint go t.unload(list) } t.timeout = time.After(timeout) @@ -78,8 +78,7 @@ func newSnapshotTask(timeout time.Duration) *snapshotTask { timeout: make(chan time.Time), close: make(chan bool), } - - task.wg.Add(1) + task.wg.Add(1) //nolint go task.run(timeout) return task } diff --git a/accounting/state/limiter.go b/accounting/state/limiter.go index 1544c27..3428287 100644 --- a/accounting/state/limiter.go +++ b/accounting/state/limiter.go @@ -32,7 +32,7 @@ func (lim *limiter) Import(oldState Snapshot) { lenOldDatetime := len(oldLim.datetime) lenNewDatetime := len(lim.datetime) - switch true { + switch { case lenOldDatetime == lenNewDatetime: lim.datetime = oldLim.datetime lim.pointer = oldLim.pointer @@ -72,7 +72,7 @@ func (lim *limiter) check() (bool, int, time.Time) { return true, 0, time.Now() } - pointer := lim.pointer + 1 + pointer := lim.pointer + 1 //nolint if pointer >= len(lim.datetime) { pointer = 0 } diff --git a/accounting/state/limiter_test.go b/accounting/state/limiter_test.go index 77c8ec2..634e0a6 100644 --- a/accounting/state/limiter_test.go +++ b/accounting/state/limiter_test.go @@ -1,3 +1,4 @@ +//nolint package state import ( diff --git a/accounting/storing.go b/accounting/storing.go index 1beb3eb..8c07bb0 100644 --- a/accounting/storing.go +++ b/accounting/storing.go @@ -17,13 +17,14 @@ type storingTask struct { buffer []entity.Request counter int - process bool chanTimeout <-chan time.Time chanCounter chan []entity.Request chanClose chan bool mx sync.Mutex wg sync.WaitGroup + + process bool } func InitStoringTask(setting conf.StoringSetting) { @@ -63,7 +64,7 @@ func (t *storingTask) Stop() { if t.counter != 0 { buffer := t.clearBuffer() defer func() { - t.wg.Add(1) + t.wg.Add(1) //nolint t.unload(buffer) t.wg.Wait() }() @@ -82,14 +83,14 @@ func (t *storingTask) run(timeout time.Duration) { case <-t.chanClose: return case cache := <-t.chanCounter: - t.wg.Add(1) + t.wg.Add(1) //nolint go t.unload(cache) t.chanTimeout = time.After(timeout) case <-t.chanTimeout: t.mx.Lock() if t.counter != 0 { buffer := t.clearBuffer() - t.wg.Add(1) + t.wg.Add(1) //nolint go t.unload(buffer) } t.mx.Unlock() @@ -123,7 +124,7 @@ func newStoringTask(timeout time.Duration, bufSize int) *storingTask { chanCounter: make(chan []entity.Request), chanClose: make(chan bool), } - task.wg.Add(1) + task.wg.Add(1) //nolint go task.run(timeout) return task diff --git a/accounting/storing_test.go b/accounting/storing_test.go index 978626c..32dbe74 100644 --- a/accounting/storing_test.go +++ b/accounting/storing_test.go @@ -1,3 +1,4 @@ +//nolint package accounting import ( diff --git a/authenticate/authenticate.go b/authenticate/authenticate.go index 5e40bc5..17383a3 100644 --- a/authenticate/authenticate.go +++ b/authenticate/authenticate.go @@ -1,8 +1,8 @@ package authenticate import ( - "github.com/integration-system/isp-lib/config" - "github.com/integration-system/isp-lib/utils" + "github.com/integration-system/isp-lib/v2/config" + "github.com/integration-system/isp-lib/v2/utils" log "github.com/integration-system/isp-log" "github.com/integration-system/isp-log/stdcodes" "github.com/pkg/errors" @@ -18,7 +18,9 @@ import ( const ( // TODO move to isp-lib - AdminTokenHeader = "x-auth-admin" + AdminTokenHeader = "x-auth-admin" //nolint + + awaitLengthVerifiableHeaders = 4 ) var notExpectedHeaders = []string{ @@ -32,9 +34,18 @@ var notExpectedHeaders = []string{ var auth = authenticate{} -type authenticate struct { - verify veritification.Verify -} +type ( + authenticate struct { + verify veritification.Verify + } + + verifiable struct { + appId int32 + ctx *fasthttp.RequestCtx + path string + headers map[string]string + } +) func ReceiveConfiguration(conf conf.Cache) { if conf.EnableCache { @@ -53,94 +64,142 @@ func Do(ctx *fasthttp.RequestCtx, path string) (int32, error) { ctx.Request.Header.Del(notExpectedHeader) } - appToken := getParam(utils.ApplicationTokenHeader, &ctx.Request) - - var ( - err error - appId int32 = -1 - ) - - if len(appToken) == 0 { - return 0, createError("unauthorized", codes.Unauthenticated, "application token required") - } else if config.GetRemote().(*conf.RemoteConfig).TokensSetting.ApplicationVerify { - if appId, err = verifyToken.Application(string(appToken)); err != nil || appId == 0 { - return 0, createError("unauthorized", codes.Unauthenticated, "received invalid application token") - } - } - - verifiableKeys, err := auth.verify.ApplicationToken(string(appToken)) + verifiable := newVerifiable(ctx, path) + err := verifiable.verifyAppToken() if err != nil { - log.Error(log_code.ErrorAuthenticate, err) - return 0, createError("internal Server error", codes.Internal) - } - if len(verifiableKeys) != 4 { - return 0, createError("unauthorized", codes.Unauthenticated, "received unexpected identities") + return 0, err } - applicationId, err := strconv.Atoi(verifiableKeys[utils.ApplicationIdHeader]) + err = verifiable.verifyUserToken() if err != nil { - log.Error(log_code.ErrorAuthenticate, errors.WithMessagef(err, "parse appId from redis")) - return 0, createError("internal Server error", codes.Internal) - } - if appId != -1 && int32(applicationId) != appId { - return 0, createError("unauthorized", codes.Unauthenticated, "received unexpected application identity") + return 0, err } - userToken := string(getParam(utils.UserTokenHeader, &ctx.Request)) - if userToken != "" { - userId, err := verifyToken.User(userToken) - if err != nil { - return 0, createError("unauthorized", codes.Unauthenticated, "received invalid user token") - } - verifiableKeys[utils.UserIdHeader] = userId - } + verifiable.setHeaders() - verifiableKeys[utils.UserTokenHeader] = userToken - verifiableKeys[utils.DeviceTokenHeader] = string(getParam(utils.DeviceTokenHeader, &ctx.Request)) - verifiableKeys, err = auth.verify.Identity(verifiableKeys, path) + err = verifiable.checkInnerMethods() if err != nil { - switch err { - case veritification.ErrorInvalidUserId: - return 0, createError("unauthorized", codes.Unauthenticated, err.Error()) - case veritification.ErrorPermittedToCallUser, veritification.ErrorPermittedToCallApplication: - return 0, createError("forbidden", codes.PermissionDenied, err.Error()) - default: - return 0, createError("internal server error", codes.Internal) - } + return 0, err } - for key, value := range verifiableKeys { - if value != "" { - ctx.Request.Header.Set(key, value) - } - } - - if _, ok := routing.InnerMethods[path]; ok { - adminToken := string(getParam(AdminTokenHeader, &ctx.Request)) - if adminToken == "" { - return 0, createError("unauthorized", codes.Unauthenticated, "admin token required") - } - if verifyToken.Admin(adminToken) != nil { - return 0, createError("unauthorized", codes.Unauthenticated, "received invalid admin token") - } - } - if verifiableKeys[utils.UserIdHeader] == "" { - if _, ok := routing.AuthUserMethods[path]; ok { - return 0, createError("unauthorized", codes.Unauthenticated, "user token required") - } + err = verifiable.checkUserMethods() + if err != nil { + return 0, err } //TODO backward capability for isp-config-service 1.x.x uuid := config.Get().(*conf.Configuration).InstanceUuid ctx.Request.Header.Set(utils.InstanceIdHeader, uuid) - return appId, nil + return verifiable.appId, nil } -func getParam(key string, req *fasthttp.Request) []byte { - val := req.Header.Peek(key) +func newVerifiable(ctx *fasthttp.RequestCtx, path string) *verifiable { + return &verifiable{ + ctx: ctx, + path: path, + appId: -1, + headers: make(map[string]string), + } +} + +func (v *verifiable) verifyAppToken() error { + appToken := v.getParam(utils.ApplicationTokenHeader) + var err error + + if len(appToken) == 0 { + return createError("unauthorized", codes.Unauthenticated, "application token required") + } else if config.GetRemote().(*conf.RemoteConfig).TokensSetting.ApplicationVerify { + if v.appId, err = verifyToken.Application(string(appToken)); err != nil || v.appId == 0 { + return createError("unauthorized", codes.Unauthenticated, "received invalid application token") + } + } + + verifiableHeaders, err := auth.verify.ApplicationToken(string(appToken)) + if err != nil { + log.Error(log_code.ErrorAuthenticate, err) + return createError("internal Server error", codes.Internal) + } + if len(verifiableHeaders) != awaitLengthVerifiableHeaders { + return createError("unauthorized", codes.Unauthenticated, "received unexpected identities") + } + + applicationId, err := strconv.Atoi(verifiableHeaders[utils.ApplicationIdHeader]) + if err != nil { + log.Error(log_code.ErrorAuthenticate, errors.WithMessagef(err, "parse appId from redis")) + return createError("internal Server error", codes.Internal) + } + if v.appId != -1 && int32(applicationId) != v.appId { + return createError("unauthorized", codes.Unauthenticated, "received unexpected application identity") + } + + v.headers = verifiableHeaders + return nil +} + +func (v *verifiable) verifyUserToken() error { + userToken := string(v.getParam(utils.UserTokenHeader)) + if userToken != "" { + userId, err := verifyToken.User(userToken) + if err != nil { + return createError("unauthorized", codes.Unauthenticated, "received invalid user token") + } + v.headers[utils.UserIdHeader] = userId + } + v.headers[utils.UserTokenHeader] = userToken + + v.headers[utils.DeviceTokenHeader] = string(v.getParam(utils.DeviceTokenHeader)) + + var err error + v.headers, err = auth.verify.Identity(v.headers, v.path) + if err != nil { + switch err { + case veritification.ErrorInvalidUserId: + return createError("unauthorized", codes.Unauthenticated, err.Error()) + case veritification.ErrorPermittedToCallUser, veritification.ErrorPermittedToCallApplication: + return createError("forbidden", codes.PermissionDenied, err.Error()) + default: + return createError("internal server error", codes.Internal) + } + } + return nil +} + +func (v *verifiable) setHeaders() { + for key, value := range v.headers { + if value != "" { + v.ctx.Request.Header.Set(key, value) + } + } +} + +func (v *verifiable) checkInnerMethods() error { + _, ok := routing.InnerMethods[v.path] + if ok { + adminToken := string(v.getParam(AdminTokenHeader)) + if adminToken == "" { + return createError("unauthorized", codes.Unauthenticated, "admin token required") + } + if verifyToken.Admin(adminToken) != nil { + return createError("unauthorized", codes.Unauthenticated, "received invalid admin token") + } + } + return nil +} + +func (v *verifiable) checkUserMethods() error { + if v.headers[utils.UserIdHeader] == "" { + if _, ok := routing.AuthUserMethods[v.path]; ok { + return createError("unauthorized", codes.Unauthenticated, "user token required") + } + } + return nil +} + +func (v *verifiable) getParam(key string) []byte { + val := v.ctx.Request.Header.Peek(key) if len(val) != 0 { return val } - return req.URI().QueryArgs().Peek(key) + return v.ctx.Request.URI().QueryArgs().Peek(key) } diff --git a/authenticate/token.go b/authenticate/token.go index 196f3f6..7481b2a 100644 --- a/authenticate/token.go +++ b/authenticate/token.go @@ -2,7 +2,7 @@ package authenticate import ( "github.com/dgrijalva/jwt-go" - "github.com/integration-system/isp-lib/config" + "github.com/integration-system/isp-lib/v2/config" "github.com/pkg/errors" "github.com/spf13/cast" "isp-gate-service/conf" diff --git a/conf/default_remote_config.json b/conf/default_remote_config.json index 9f0d1cd..98cb5b8 100644 --- a/conf/default_remote_config.json +++ b/conf/default_remote_config.json @@ -1,15 +1,15 @@ { "database": { - "database": "database", - "password": "password", - "username": "name", - "port": "5432", + "address": "{{ msp_pgsql_address }}", + "port": "{{ msp_pgsql_port }}", "schema": "gate_service", - "address": "127.0.0.1", + "database": "{{ msp_pgsql_name }}", + "username": "{{ msp_pgsql_user }}", + "password": "{{ msp_pgsql_password }}", "createSchema": true }, "grpcSetting": { - "proxyGrpcErrorDetails": false, + "proxyGrpcErrorDetails": true, "enableOriginalProtoErrors": false }, "httpSetting": { @@ -17,56 +17,46 @@ }, "accountingSetting": { "enable": false, - "snapshotTimeout": "1h", + "snapshotTimeout": "15m", "setting": [ - { - "applicationId": 0, - "enableStoring": false, - "limits": [ - { - "timeout": "1s", - "maxCount": 500, - "pattern": "/example/module/group/method" - } - ] - } ], "storing": { "size": 10000, - "timeout": "30m" + "timeout": "10m" } }, "journalSetting": { "journal": { - "compress": true, "filename": "/var/log/isp-gate-service/runtime.log", "maxSizeMb": 512, "bufferSize": 4096, "rotateTimeoutMs": 86400000, "enableRemoteTransfer": true, - "enable": false + "enable": false, + "compress": true } }, "redis": { + "password": "{{ msp_redis_password }}", + "defaultDB": 0, "address": { - "ip": "127.0.0.1", - "port": "6379" + "ip": "{{ msp_redis_address }}", + "port": "{{ msp_redis_port }}" } }, "metrics": { + "gc": true, "memory": true, "address": { + "path": "/metrics", "port": "9553", - "ip": "0.0.0.0", - "path": "/metrics" - }, - "gc": true + "ip": "0.0.0.0" + } }, "tokensSetting": { - "adminSecret": "secret", - "applicationSecret": "secret", + "applicationSecret": "{{ msp_app_secret }}", "applicationVerify": false, - "userSecret": "secret" + "adminSecret": "{{ msp_admin_secret }}" }, "authCacheSetting": { "enableCache": false, diff --git a/conf/local_config.go b/conf/local_config.go index e8d4046..9027481 100644 --- a/conf/local_config.go +++ b/conf/local_config.go @@ -1,7 +1,7 @@ package conf import ( - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" ) type ( diff --git a/conf/remote_config.go b/conf/remote_config.go index 8f1bcfa..164f000 100644 --- a/conf/remote_config.go +++ b/conf/remote_config.go @@ -1,8 +1,9 @@ +//nolint package conf import ( "github.com/integration-system/isp-journal/rx" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" "time" ) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..09fcb18 --- /dev/null +++ b/go.mod @@ -0,0 +1,23 @@ +module isp-gate-service + +go 1.13 + +require ( + github.com/dgrijalva/jwt-go v3.2.0+incompatible + github.com/fasthttp/websocket v1.4.2 + github.com/go-pg/pg/v9 v9.1.3 + github.com/go-redis/redis v6.15.7+incompatible + github.com/golang/protobuf v1.3.4 + github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f + github.com/integration-system/isp-journal v1.4.0 + github.com/integration-system/isp-lib/v2 v2.2.0 + github.com/integration-system/isp-log v1.1.0 + github.com/json-iterator/go v1.1.9 + github.com/pkg/errors v0.9.1 + github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 + github.com/spf13/cast v1.3.1 + github.com/stretchr/testify v1.4.0 + github.com/valyala/fasthttp v1.9.0 + golang.org/x/net v0.0.0-20200301022130-244492dfa37a + google.golang.org/grpc v1.27.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8ebb3b6 --- /dev/null +++ b/go.sum @@ -0,0 +1,369 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= +github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f h1:y2hSFdXeA1y5z5f0vfNO0Dg5qVY036qzlz3Pds0B92o= +github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/buaazp/fasthttprouter v0.1.1 h1:4oAnN0C3xZjylvZJdP35cxfclyn4TYkW6Y+DSvS+h8Q= +github.com/buaazp/fasthttprouter v0.1.1/go.mod h1:h/Ap5oRVLeItGKTVBb+heQPks+HdIUtGmI4H5WCYijM= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/codemodus/kace v0.5.1 h1:4OCsBlE2c/rSJo375ggfnucv9eRzge/U5LrrOZd47HA= +github.com/codemodus/kace v0.5.1/go.mod h1:coddaHoX1ku1YFSe4Ip0mL9kQjJvKkzb9CfIdG1YR04= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fasthttp/websocket v1.4.2 h1:AU/zSiIIAuJjBMf5o+vO0syGOnEfvZRu40xIhW/3RuM= +github.com/fasthttp/websocket v1.4.2/go.mod h1:smsv/h4PBEBaU0XDTY5UwJTpZv69fQ0FfcLJr21mA6Y= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-pg/pg v8.0.6+incompatible h1:Hi7yUJ2zwmHFq1Mar5XqhCe3NJ7j9r+BaiNmd+vqf+A= +github.com/go-pg/pg/v9 v9.0.0-beta.14/go.mod h1:T2Sr6bpTCOr2lUqOUMiXLMJqZHSUBKk1LdgSqjwhZfA= +github.com/go-pg/pg/v9 v9.0.3/go.mod h1:Tm/Q3Vt6gdQOH6TTN1H/xLlIXc+Qrka7TZ6uREtu/eA= +github.com/go-pg/pg/v9 v9.1.2/go.mod h1:AOJqkP8C4YfJgLOA5zSoV0DGHGo+M3G2nXXLeXkiyNs= +github.com/go-pg/pg/v9 v9.1.3 h1:gmE7k5ib45+NcRJBGUDPD/keJGCMqhH7TPqbd9xbdz4= +github.com/go-pg/pg/v9 v9.1.3/go.mod h1:QM13HBLkdml4zcKOfUfGLymM6hb72aKTJLrmaH8rsFg= +github.com/go-pg/urlstruct v0.1.0/go.mod h1:2Nag+BIny6G/KYCkdt++ZnqU/VinzimGapKfs4kwlN0= +github.com/go-pg/urlstruct v0.2.6/go.mod h1:dxENwVISWSOX+k87hDt0ueEJadD+gZWv3tHzwfmZPu8= +github.com/go-pg/urlstruct v0.2.8/go.mod h1:/XKyiUOUUS3onjF+LJxbfmSywYAdl6qMfVbX33Q8rgg= +github.com/go-pg/urlstruct v0.3.0 h1:ORiTb205uT7v7lvq4VUOQ4ddJ5TjFRlVRWqWsMBgek4= +github.com/go-pg/urlstruct v0.3.0/go.mod h1:/XKyiUOUUS3onjF+LJxbfmSywYAdl6qMfVbX33Q8rgg= +github.com/go-pg/zerochecker v0.1.1 h1:av77Qe7Gs+1oYGGh51k0sbZ0bUaxJEdeP0r8YE64Dco= +github.com/go-pg/zerochecker v0.1.1/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= +github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= +github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= +github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/integration-system/bellows v0.0.0-20190821124023-244325e8836c h1:yyIH4qCFf5LD5PKhXoX4BZh3wRjd59xBV4eAQTBwS6k= +github.com/integration-system/bellows v0.0.0-20190821124023-244325e8836c/go.mod h1:6cf4ZNvtzZ/KMiuc+d5Y7rSHjzlYBWEqbVyDfUDhqIE= +github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f h1:52UOJguw5yqe1y2JjmyVxGcZf3kv2BQeUodR363MkiQ= +github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f/go.mod h1:w+dmaWojuIwNujSYg6qt1wKHhSdorLOivCEl/XuLzbM= +github.com/integration-system/gowsdl v1.0.0 h1:rDv5HrzNUs6aWTj9roSDS9ZdIf58FzF0YVP2nusvbto= +github.com/integration-system/gowsdl v1.0.0/go.mod h1:ZwTCE+Av5aQLnPj2/3PIop6mzCs1FY7jXrcWDvSjrBA= +github.com/integration-system/isp-etp-go v2.0.2+incompatible h1:+aQiqH/aMy9pUsifIxfWU/DD8cwbMo24AAIV7Ab6aP4= +github.com/integration-system/isp-etp-go v2.0.2+incompatible/go.mod h1:NdgczkoFCer9SZOx674EVXCcKRIhFe8LYnwNwoIMDhI= +github.com/integration-system/isp-io v0.0.0-20190723122940-3daf588d878f h1:nJGOobuawo5d3QgoLl1i2SJVDIHkxMl0bhH1+iqZmnk= +github.com/integration-system/isp-io v0.0.0-20190723122940-3daf588d878f/go.mod h1:1cjy4g5F8WXrOB3l/bL3mw+TCWDppOL1pz08wOAMi9Y= +github.com/integration-system/isp-journal v1.3.0 h1:5g1tVPflCjUP4V4SP65L8HFr0uldtMPOpywYW66RNfI= +github.com/integration-system/isp-journal v1.3.0/go.mod h1:ZTZi/6t+5m6aM7BT7xvXB6ciBLUGZNIVNPYbH0EbSUw= +github.com/integration-system/isp-journal v1.4.0 h1:V+1go2vrlX5n3t422YoYmCx0sxHPm0ZxsWN3rD8pjnI= +github.com/integration-system/isp-journal v1.4.0/go.mod h1:tiPAbgUbJxeYbegw7P4HJPWbgko4OLkKmg+k3xbqcrg= +github.com/integration-system/isp-lib v2.1.0+incompatible h1:ANnDn3PEi9jnFapBr9d8ohXBzAMGDCDgn6cANWk9Soo= +github.com/integration-system/isp-lib v2.1.0+incompatible/go.mod h1:P+wQ4/ydkFku6ccKuDsoqAQBStngDhFWtX3LP1BafvE= +github.com/integration-system/isp-lib/v2 v2.2.0 h1:qabF1/Q66Z0ldOIlsztD/P4WEuskYICFJHjMoJhUi08= +github.com/integration-system/isp-lib/v2 v2.2.0/go.mod h1:s3UWKnmCns7uaxAX1i04Le32+FFuoDgp8QLhOZAmNZE= +github.com/integration-system/isp-log v1.0.0/go.mod h1:omfVcb7djvmc0MYWpRq32D9jxRYhyBL518IcdBL9jKY= +github.com/integration-system/isp-log v1.1.0 h1:tg4Aa9+k+cqZASrbH6jcVAL0m5+ZEPXo6MNdtAvFnY8= +github.com/integration-system/isp-log v1.1.0/go.mod h1:VVMr3cHW+RuFurPUSeVz71KUnOGQxogxO5atV9N8ISs= +github.com/integration-system/jsonschema v1.0.0 h1:Lci4sHGhOX27qCgZo5rvJ37Bjcfm+qCwU0yvw6ImEX4= +github.com/integration-system/jsonschema v1.0.0/go.mod h1:EoqDH7RmC8Epg5EgjboIxDo7Udv3WX2exGqtIVB4hI0= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.8.2 h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2KCcs= +github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.4/go.mod h1:Jw1Z28soD/QasIA2uWjXyM9El1jly3YwyFOuR8tH1rg= +github.com/nats-io/nats-streaming-server v0.17.0/go.mod h1:ewPBEsmp62Znl3dcRsYtlcfwudxHEdYMtYqUQSt4fE0= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nats-io/stan.go v0.6.0/go.mod h1:eIcD5bi3pqbHT/xIIvXMwvzXYElgouBvaVRftaE+eac= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pressly/goose v2.6.0+incompatible h1:3f8zIQ8rfgP9tyI0Hmcs2YNAqUCL1c+diLe3iU8Qd/k= +github.com/pressly/goose v2.6.0+incompatible/go.mod h1:m+QHWCqxR3k8D9l7qfzuC/djtlfzxr34mozWDYEu1z8= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ= +github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f h1:PgA+Olipyj258EIEYnpFFONrrCcAIWNUNoFhUfMqAGY= +github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY= +github.com/segmentio/encoding v0.1.8/go.mod h1:RWhr02uzMB9gQC1x+MfYxedtmBibb9cZ6Vv9VxRSSbw= +github.com/segmentio/encoding v0.1.10 h1:0b8dva47cSuNQR5ZcU3d0pfi9EnPpSK6q7y5ZGEW36Q= +github.com/segmentio/encoding v0.1.10/go.mod h1:RWhr02uzMB9gQC1x+MfYxedtmBibb9cZ6Vv9VxRSSbw= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/thecodeteam/goodbye v0.0.0-20170927022442-a83968bda2d3 h1:COy7ekr2jBEd34npP2LvMTqk9UtiLkuvkjiJFHihlTo= +github.com/thecodeteam/goodbye v0.0.0-20170927022442-a83968bda2d3/go.mod h1:ehwM4AFY4byYSorQbigh79cKUOUNL3pAOz5eCAQNlGI= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.9.0 h1:hNpmUdy/+ZXYpGy0OBfm7K0UQTzb73W0T0U4iJIVrMw= +github.com/valyala/fasthttp v1.9.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vmihailenco/bufpool v0.1.5 h1:mEO/biwhAgiY97yPMmAdH4PvaIu63C6uGBdfSdoMo/I= +github.com/vmihailenco/bufpool v0.1.5/go.mod h1:fL9i/PRTuS7AELqAHwSU1Zf1c70xhkhGe/cD5ud9pJk= +github.com/vmihailenco/msgpack/v4 v4.3.1/go.mod h1:DuaveEe48abshDmz5UBKyZ+yDugvaeFk5ayfrewUOaw= +github.com/vmihailenco/msgpack/v4 v4.3.5/go.mod h1:DuaveEe48abshDmz5UBKyZ+yDugvaeFk5ayfrewUOaw= +github.com/vmihailenco/msgpack/v4 v4.3.7 h1:Aj4eMY2qXTRfWRwHKJ2n/CWKVy15pCYN327QMJ/OUVs= +github.com/vmihailenco/msgpack/v4 v4.3.7/go.mod h1:Ii+PksJlvFT5ZRcB/4YLAInMIp6a0WOCm0L3BU0aNG4= +github.com/vmihailenco/tagparser v0.1.0/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg= +github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222033325-078779b8f2d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20200211111953-2dc5924e3898 h1:bKX1IGaSj2XD9yfWNts9HKRdQRH0lOZ0S7Nb8meQSlY= +google.golang.org/genproto v0.0.0-20200211111953-2dc5924e3898/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= +mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= +nhooyr.io/websocket v1.7.4 h1:w/LGB2sZT0RV8lZYR7nfyaYz4PUbYZ5oF7NBon2M0NY= +nhooyr.io/websocket v1.7.4/go.mod h1:PxYxCwFdFYQ0yRvtQz3s/dC+VEm7CSuC/4b9t8MQQxw= diff --git a/handler/handler.go b/handler/handler.go index d38f599..a6b6fe9 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -2,7 +2,7 @@ package handler import ( "fmt" - "github.com/integration-system/isp-lib/config" + "github.com/integration-system/isp-lib/v2/config" log "github.com/integration-system/isp-log" "github.com/pkg/errors" "github.com/valyala/fasthttp" @@ -11,7 +11,7 @@ import ( "isp-gate-service/authenticate" "isp-gate-service/conf" "isp-gate-service/domain" - "isp-gate-service/journal" + "isp-gate-service/invoker" "isp-gate-service/log_code" "isp-gate-service/proxy" "isp-gate-service/routing" @@ -22,6 +22,8 @@ import ( "time" ) +const execution = 1e6 + var helper handlerHelper type handlerHelper struct{} @@ -32,7 +34,7 @@ func CompleteRequest(ctx *fasthttp.RequestCtx) { resp := helper.AuthenticateAccountingProxy(ctx) - executionTime := time.Since(currentTime) / 1e6 + executionTime := time.Since(currentTime) / execution statusCode := ctx.Response.StatusCode() service.Metrics.UpdateStatusCounter(helper.SetMetricStatus(statusCode)) @@ -44,11 +46,11 @@ func CompleteRequest(ctx *fasthttp.RequestCtx) { if config.GetRemote().(*conf.RemoteConfig).JournalSetting.Journal.Enable { if matcher.JournalMethods.Match(uri) { if err != nil { - if err := journal.Client.Error(uri, requestBody, responseBody, err); err != nil { + if err := invoker.Journal.Error(uri, requestBody, responseBody, err); err != nil { log.Warnf(log_code.WarnJournalCouldNotWriteToFile, "could not write to file journal: %v", err) } } else { - if err := journal.Client.Info(uri, requestBody, responseBody); err != nil { + if err := invoker.Journal.Info(uri, requestBody, responseBody); err != nil { log.Warnf(log_code.WarnJournalCouldNotWriteToFile, "could not write to file journal: %v", err) } } @@ -80,8 +82,7 @@ func (handlerHelper) AuthenticateAccountingProxy(ctx *fasthttp.RequestCtx) domai message := "unknown error" status := codes.Unknown details := make([]interface{}, 0) - switch e := err.(type) { - case authenticate.ErrorDescription: + if e, ok := err.(authenticate.ErrorDescription); ok { message = e.Message() status = e.ConvertToGrpcStatus() details = e.Details() diff --git a/invoker/journal.go b/invoker/journal.go new file mode 100644 index 0000000..92691ed --- /dev/null +++ b/invoker/journal.go @@ -0,0 +1,33 @@ +package invoker + +import ( + "github.com/integration-system/isp-journal/rx" + "github.com/integration-system/isp-lib/v2/backend" + "github.com/integration-system/isp-lib/v2/structure" + log "github.com/integration-system/isp-log" + "google.golang.org/grpc" + "isp-gate-service/log_code" +) + +type journalService struct { + *rx.RxJournal +} + +var ( + journalClient = backend.NewRxGrpcClient( + backend.WithDialOptions(grpc.WithInsecure(), grpc.WithBlock()), + backend.WithDialingErrorHandler(func(err error) { + log.Warnf(log_code.ErrorClientJournal, "journal client dialing err: %v", err) + }), + ) + Journal = &journalService{RxJournal: rx.NewDefaultRxJournal(journalClient)} +) + +func (*journalService) ReceiveServiceAddressList(list []structure.AddressConfiguration) bool { + if ok := journalClient.ReceiveAddressList(list); !ok { + return false + } else { + go Journal.CollectAndTransferExistedLogs() + return true + } +} diff --git a/journal/client.go b/journal/client.go deleted file mode 100644 index 1582f4a..0000000 --- a/journal/client.go +++ /dev/null @@ -1,33 +0,0 @@ -package journal - -import ( - "github.com/integration-system/isp-journal/rx" - "github.com/integration-system/isp-lib/backend" - "github.com/integration-system/isp-lib/structure" - log "github.com/integration-system/isp-log" - "google.golang.org/grpc" - "isp-gate-service/log_code" -) - -var ( - journalServiceClient = backend.NewRxGrpcClient( - backend.WithDialOptions(grpc.WithInsecure(), grpc.WithBlock()), - backend.WithDialingErrorHandler(func(err error) { - log.Warnf(log_code.ErrorClientJournal, "journal client dialing err: %v", err) - }), - ) - Client = rx.NewDefaultRxJournal(journalServiceClient) -) - -func RequiredModule() (string, func([]structure.AddressConfiguration) bool, bool) { - return "journal", receiveJournalServiceAddressList, false -} - -func receiveJournalServiceAddressList(list []structure.AddressConfiguration) bool { - if ok := journalServiceClient.ReceiveAddressList(list); !ok { - return false - } else { - go Client.CollectAndTransferExistedLogs() - return true - } -} diff --git a/main.go b/main.go index cb79979..99ce12e 100644 --- a/main.go +++ b/main.go @@ -2,19 +2,17 @@ package main import ( "context" - "os" - - "github.com/integration-system/isp-lib/bootstrap" - "github.com/integration-system/isp-lib/config" - "github.com/integration-system/isp-lib/config/schema" - "github.com/integration-system/isp-lib/metric" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/bootstrap" + "github.com/integration-system/isp-lib/v2/config" + "github.com/integration-system/isp-lib/v2/config/schema" + "github.com/integration-system/isp-lib/v2/metric" + "github.com/integration-system/isp-lib/v2/structure" log "github.com/integration-system/isp-log" "github.com/integration-system/isp-log/stdcodes" "isp-gate-service/accounting" "isp-gate-service/authenticate" "isp-gate-service/conf" - "isp-gate-service/journal" + "isp-gate-service/invoker" "isp-gate-service/model" "isp-gate-service/proxy" "isp-gate-service/redis" @@ -22,6 +20,7 @@ import ( "isp-gate-service/server" "isp-gate-service/service" "isp-gate-service/service/matcher" + "os" ) var ( @@ -38,7 +37,7 @@ func main() { DeclareMe(makeDeclaration). SocketConfiguration(socketConfiguration). RequireRoutes(handleRouteUpdate). - RequireModule(journal.RequiredModule()) + RequireModule("journal", invoker.Journal.ReceiveServiceAddressList, true) requiredModules := getRequiredModulesByLocations(cfg.Locations) for module, consumer := range requiredModules { @@ -59,7 +58,7 @@ func onRemoteConfigReceive(remoteConfig, oldRemoteConfig *conf.RemoteConfig) { localCfg := config.Get().(*conf.Configuration) model.DbClient.ReceiveConfiguration(remoteConfig.Database) - journal.Client.ReceiveConfiguration(remoteConfig.JournalSetting.Journal, localCfg.ModuleName) + invoker.Journal.ReceiveConfiguration(remoteConfig.JournalSetting.Journal, localCfg.ModuleName) matcher.JournalMethods = matcher.NewAtLeastOneMatcher(remoteConfig.JournalSetting.MethodsPatterns) redis.Client.ReceiveConfiguration(remoteConfig.Redis) @@ -104,7 +103,7 @@ func makeDeclaration(localConfig interface{}) bootstrap.ModuleInfo { ModuleName: cfg.ModuleName, ModuleVersion: version, GrpcOuterAddress: cfg.HttpOuterAddress, - Handlers: []interface{}{}, + Endpoints: []structure.EndpointDescriptor{}, } } diff --git a/model/client.go b/model/client.go index 2616156..f6c2771 100644 --- a/model/client.go +++ b/model/client.go @@ -1,7 +1,7 @@ package model import ( - "github.com/integration-system/isp-lib/database" + "github.com/integration-system/isp-lib/v2/database" log "github.com/integration-system/isp-log" "isp-gate-service/log_code" ) diff --git a/model/requests.go b/model/requests.go index c102b26..3039914 100644 --- a/model/requests.go +++ b/model/requests.go @@ -1,8 +1,8 @@ package model import ( - "github.com/go-pg/pg/orm" - "github.com/integration-system/isp-lib/database" + "github.com/go-pg/pg/v9/orm" + "github.com/integration-system/isp-lib/v2/database" "isp-gate-service/entity" ) diff --git a/model/snapshot.go b/model/snapshot.go index dcd583e..e8568f5 100644 --- a/model/snapshot.go +++ b/model/snapshot.go @@ -1,11 +1,11 @@ package model import ( - "github.com/go-pg/pg" - "github.com/integration-system/isp-lib/database" + "github.com/go-pg/pg/v9" + "github.com/integration-system/isp-lib/v2/database" "isp-gate-service/entity" - "github.com/go-pg/pg/orm" + "github.com/go-pg/pg/v9/orm" ) type ( diff --git a/proxy/description.go b/proxy/description.go index 6a1aef0..e607e7b 100644 --- a/proxy/description.go +++ b/proxy/description.go @@ -1,7 +1,7 @@ package proxy import ( - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" "github.com/pkg/errors" "github.com/valyala/fasthttp" "isp-gate-service/domain" diff --git a/proxy/grpc/client.go b/proxy/grpc/client.go index 1c2b31c..7cfc2cb 100644 --- a/proxy/grpc/client.go +++ b/proxy/grpc/client.go @@ -1,8 +1,8 @@ package grpc import ( - "github.com/integration-system/isp-lib/backend" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/backend" + "github.com/integration-system/isp-lib/v2/structure" log "github.com/integration-system/isp-log" "github.com/pkg/errors" "github.com/valyala/fasthttp" diff --git a/proxy/grpc/handlers/common.go b/proxy/grpc/handlers/common.go index d31f5bc..5c0831c 100644 --- a/proxy/grpc/handlers/common.go +++ b/proxy/grpc/handlers/common.go @@ -8,12 +8,12 @@ import ( "github.com/golang/protobuf/proto" structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/integration-system/isp-lib/backend" - "github.com/integration-system/isp-lib/config" - http2 "github.com/integration-system/isp-lib/http" - isp "github.com/integration-system/isp-lib/proto/stubs" - "github.com/integration-system/isp-lib/structure" - "github.com/integration-system/isp-lib/utils" + "github.com/integration-system/isp-lib/v2/backend" + "github.com/integration-system/isp-lib/v2/config" + http2 "github.com/integration-system/isp-lib/v2/http" + isp "github.com/integration-system/isp-lib/v2/proto/stubs" + "github.com/integration-system/isp-lib/v2/structure" + "github.com/integration-system/isp-lib/v2/utils" log "github.com/integration-system/isp-log" jsoniter "github.com/json-iterator/go" "github.com/valyala/fasthttp" @@ -37,55 +37,52 @@ const ( errorMsgInvalidArg = "Not able to read request body" ) -var ( - json = jsoniter.ConfigFastest - emptyBody = make([]byte, 0) -) +var json = jsoniter.ConfigFastest func convertError(err error) ([]byte, int) { s, ok := status.FromError(err) if ok { cfg := config.GetRemote().(*conf.RemoteConfig).GrpcSetting if cfg.EnableOriginalProtoErrors { - if body, err := proto.Marshal(s.Proto()); err != nil { + body, err := proto.Marshal(s.Proto()) + if err != nil { return []byte(utils.ServiceError), http.StatusServiceUnavailable - } else { - return body, http2.CodeToHttpStatus(s.Code()) - } - } else { - details := s.Details() - newDetails := make([]interface{}, len(details)) - for i, detail := range details { - switch typeOfDetail := detail.(type) { - case *structpb.Struct: - newDetails[i] = utils.ConvertGrpcStructToInterface( - &structpb.Value{Kind: &structpb.Value_StructValue{StructValue: typeOfDetail}}, - ) - case *isp.Message: - newDetails[i] = utils.ConvertGrpcStructToInterface( - backend.ResolveBody(typeOfDetail), - ) - default: - newDetails[i] = typeOfDetail - } } + return body, http2.CodeToHttpStatus(s.Code()) + } - var respBody interface{} - if cfg.ProxyGrpcErrorDetails && len(newDetails) > 0 { - respBody = newDetails[0] - } else { - respBody = structure.GrpcError{ErrorMessage: s.Message(), ErrorCode: s.Code().String(), Details: newDetails} - } - if errorData, err := json.Marshal(respBody); err != nil { - log.Warn(log_code.WarnConvertErrorDataMarshalResponse, err) - return []byte(utils.ServiceError), http.StatusServiceUnavailable - } else { - return errorData, http2.CodeToHttpStatus(s.Code()) + details := s.Details() + newDetails := make([]interface{}, len(details)) + for i, detail := range details { + switch typeOfDetail := detail.(type) { + case *structpb.Struct: + newDetails[i] = utils.ConvertGrpcStructToInterface( + &structpb.Value{Kind: &structpb.Value_StructValue{StructValue: typeOfDetail}}, + ) + case *isp.Message: + newDetails[i] = utils.ConvertGrpcStructToInterface( + backend.ResolveBody(typeOfDetail), + ) + default: + newDetails[i] = typeOfDetail } } - } else { - return []byte(utils.ServiceError), http.StatusServiceUnavailable + + var respBody interface{} + if cfg.ProxyGrpcErrorDetails && len(newDetails) > 0 { + respBody = newDetails[0] + } else { + respBody = structure.GrpcError{ErrorMessage: s.Message(), ErrorCode: s.Code().String(), Details: newDetails} + } + + errorData, err := json.Marshal(respBody) + if err != nil { + log.Warn(log_code.WarnConvertErrorDataMarshalResponse, err) + return []byte(utils.ServiceError), http.StatusServiceUnavailable + } + return errorData, http2.CodeToHttpStatus(s.Code()) } + return []byte(utils.ServiceError), http.StatusServiceUnavailable } func getResponse(msg *isp.Message, err error) ([]byte, int, error) { @@ -113,7 +110,6 @@ func logHandlerError(typeData, method string, err error) { func openStream(headers *fasthttp.RequestHeader, method string, timeout time.Duration, client *backend.RxGrpcClient) ( isp.BackendService_RequestStreamClient, context.CancelFunc, error) { - cli, err := client.Conn() if err != nil { return nil, nil, err @@ -129,7 +125,6 @@ func openStream(headers *fasthttp.RequestHeader, method string, timeout time.Dur } func makeMetadata(r *fasthttp.RequestHeader, method string) (metadata.MD, string) { - //method = strings.TrimPrefix(method, "/api/") md := make(metadata.MD, 5) md[utils.ProxyMethodNameHeader] = []string{method} r.VisitAll(func(key, v []byte) { diff --git a/proxy/grpc/handlers/description.go b/proxy/grpc/handlers/description.go index f3ee7a1..d13a957 100644 --- a/proxy/grpc/handlers/description.go +++ b/proxy/grpc/handlers/description.go @@ -1,8 +1,8 @@ package handlers import ( - "github.com/integration-system/isp-lib/backend" - u "github.com/integration-system/isp-lib/utils" + "github.com/integration-system/isp-lib/v2/backend" + u "github.com/integration-system/isp-lib/v2/utils" "github.com/valyala/fasthttp" "isp-gate-service/domain" "isp-gate-service/utils" @@ -26,12 +26,12 @@ func (h handlerHelper) Get(ctx *fasthttp.RequestCtx) handler { if isMultipart { ctx.Response.Header.SetContentType(utils.JsonContentType) return sendMultipartData - } else if isExpectFile { - return getFile - } else { - ctx.Response.Header.SetContentType(utils.JsonContentType) - return handleJson } + if isExpectFile { + return getFile + } + ctx.Response.Header.SetContentType(utils.JsonContentType) + return handleJson } func (h handlerHelper) isMultipart(ctx *fasthttp.RequestCtx) bool { @@ -47,8 +47,5 @@ func (h handlerHelper) isMultipart(ctx *fasthttp.RequestCtx) bool { return false } _, ok := params["boundary"] - if !ok { - return false - } - return true + return ok } diff --git a/proxy/grpc/handlers/handle_get_file.go b/proxy/grpc/handlers/handle_get_file.go index d173c87..760640f 100644 --- a/proxy/grpc/handlers/handle_get_file.go +++ b/proxy/grpc/handlers/handle_get_file.go @@ -2,10 +2,11 @@ package handlers import ( "fmt" - "github.com/integration-system/isp-lib/backend" - "github.com/integration-system/isp-lib/config" - s "github.com/integration-system/isp-lib/streaming" - u "github.com/integration-system/isp-lib/utils" + "github.com/integration-system/isp-lib/v2/backend" + "github.com/integration-system/isp-lib/v2/config" + isp "github.com/integration-system/isp-lib/v2/proto/stubs" + s "github.com/integration-system/isp-lib/v2/streaming" + u "github.com/integration-system/isp-lib/v2/utils" log "github.com/integration-system/isp-log" "github.com/pkg/errors" "github.com/valyala/fasthttp" @@ -23,16 +24,12 @@ var getFile getFileDesc type getFileDesc struct{} func (g getFileDesc) Complete(ctx *fasthttp.RequestCtx, method string, client *backend.RxGrpcClient) domain.ProxyResponse { - cfg := config.GetRemote().(*conf.RemoteConfig).GrpcSetting - timeout := cfg.GetStreamInvokeTimeout() - req, err := g.readJsonBody(ctx) if err != nil { - logHandlerError(log_code.TypeData.GetFile, method, err) - utils.WriteError(ctx, err.Error(), codes.InvalidArgument, nil) - return domain.Create().SetError(err) + return g.formError(ctx, err, method, err.Error(), codes.InvalidArgument) } + timeout := config.GetRemote().(*conf.RemoteConfig).GrpcSetting.GetStreamInvokeTimeout() stream, cancel, err := openStream(&ctx.Request.Header, method, timeout, client) defer func() { if cancel != nil { @@ -40,18 +37,14 @@ func (g getFileDesc) Complete(ctx *fasthttp.RequestCtx, method string, client *b } }() if err != nil { - logHandlerError(log_code.TypeData.GetFile, method, err) - utils.WriteError(ctx, errorMsgInternal, codes.Internal, nil) - return domain.Create().SetError(err) + return g.formError(ctx, err, method, errorMsgInternal, codes.Internal) } if req != nil { value := u.ConvertInterfaceToGrpcStruct(req) err := stream.Send(backend.WrapBody(value)) if err != nil { - logHandlerError(log_code.TypeData.GetFile, method, err) - utils.WriteError(ctx, errorMsgInternal, codes.Internal, nil) - return domain.Create().SetError(err) + return g.formError(ctx, err, method, errorMsgInternal, codes.Internal) } } @@ -64,6 +57,7 @@ func (g getFileDesc) Complete(ctx *fasthttp.RequestCtx, method string, client *b } return domain.Create().SetError(err) } + bf := s.BeginFile{} err = bf.FromMessage(msg) if err != nil { @@ -83,14 +77,20 @@ func (g getFileDesc) Complete(ctx *fasthttp.RequestCtx, method string, client *b header.Set(headerKeyTransferEncoding, "chunked") } + err = g.write(ctx, stream, method) + return domain.Create().SetError(err) +} + +//nolint +func (getFileDesc) write(ctx *fasthttp.RequestCtx, stream isp.BackendService_RequestStreamClient, method string) error { for { msg, err := stream.Recv() if s.IsEndOfFile(msg) || err == io.EOF { - break + return nil } if err != nil { logHandlerError(log_code.TypeData.GetFile, method, err) - break + return err } bytes := msg.GetBytesBody() if bytes == nil { @@ -98,15 +98,14 @@ func (g getFileDesc) Complete(ctx *fasthttp.RequestCtx, method string, client *b log_code.MdTypeData: log_code.TypeData.GetFile, log_code.MdMethod: method, }).Errorf(log_code.WarnProxyGrpcHandler, "Method %s. Expected bytes array", method) - break + return nil } _, err = ctx.Write(bytes) if err != nil { logHandlerError(log_code.TypeData.GetFile, method, err) - break + return err } } - return domain.Create().SetError(err) } func (getFileDesc) readJsonBody(ctx *fasthttp.RequestCtx) (interface{}, error) { @@ -115,18 +114,23 @@ func (getFileDesc) readJsonBody(ctx *fasthttp.RequestCtx) (interface{}, error) { if len(requestBody) == 0 { requestBody = []byte("{}") } - if requestBody[0] == '{' { + switch requestBody[0] { + case '{': body = make(map[string]interface{}) - } else if requestBody[0] == '[' { + case '[': body = make([]interface{}, 0) - } else { + default: return nil, errors.New("Invalid json format. Expected object or array") } - err := json.Unmarshal(requestBody, &body) - if err != nil { return nil, errors.New("Not able to read request body") } return body, err } + +func (getFileDesc) formError(ctx *fasthttp.RequestCtx, err error, method, msg string, code codes.Code) domain.ProxyResponse { + logHandlerError(log_code.TypeData.GetFile, method, err) + utils.WriteError(ctx, msg, code, nil) + return domain.Create().SetError(err) +} diff --git a/proxy/grpc/handlers/handle_json.go b/proxy/grpc/handlers/handle_json.go index 0b26a91..81d142e 100644 --- a/proxy/grpc/handlers/handle_json.go +++ b/proxy/grpc/handlers/handle_json.go @@ -1,9 +1,9 @@ package handlers import ( - "github.com/integration-system/isp-lib/backend" - "github.com/integration-system/isp-lib/config" - isp "github.com/integration-system/isp-lib/proto/stubs" + "github.com/integration-system/isp-lib/v2/backend" + "github.com/integration-system/isp-lib/v2/config" + isp "github.com/integration-system/isp-lib/v2/proto/stubs" "github.com/valyala/fasthttp" "golang.org/x/net/context" "google.golang.org/grpc/codes" diff --git a/proxy/grpc/handlers/handle_send_multipart_data.go b/proxy/grpc/handlers/handle_send_multipart_data.go index a3a9c5f..4b94585 100644 --- a/proxy/grpc/handlers/handle_send_multipart_data.go +++ b/proxy/grpc/handlers/handle_send_multipart_data.go @@ -1,10 +1,10 @@ package handlers import ( - "github.com/integration-system/isp-lib/backend" - "github.com/integration-system/isp-lib/config" - isp "github.com/integration-system/isp-lib/proto/stubs" - s "github.com/integration-system/isp-lib/streaming" + "github.com/integration-system/isp-lib/v2/backend" + "github.com/integration-system/isp-lib/v2/config" + isp "github.com/integration-system/isp-lib/v2/proto/stubs" + s "github.com/integration-system/isp-lib/v2/streaming" "github.com/valyala/fasthttp" "google.golang.org/grpc/codes" "isp-gate-service/conf" @@ -22,7 +22,6 @@ type sendMultipartDataDesc struct{} func (h sendMultipartDataDesc) Complete(c *fasthttp.RequestCtx, method string, client *backend.RxGrpcClient) domain.ProxyResponse { cfg := config.GetRemote().(*conf.RemoteConfig).GrpcSetting timeout := cfg.GetStreamInvokeTimeout() - bufferSize := cfg.GetTransferFileBufferSize() stream, cancel, err := openStream(&c.Request.Header, method, timeout, client) defer func() { @@ -49,8 +48,25 @@ func (h sendMultipartDataDesc) Complete(c *fasthttp.RequestCtx, method string, c return domain.Create().SetError(err) } - formData := make(map[string]interface{}, len(form.Value)) + resp, proxyResp, ok := h.formResponse(c, stream, form, method) + err = stream.CloseSend() + if err != nil { + logHandlerError(log_code.TypeData.SendMultipart, method, err) + } + if ok { + arrayBody := strings.Join(resp, ",") + _, err = c.WriteString("[" + arrayBody + "]") + if err != nil { + logHandlerError(log_code.TypeData.SendMultipart, method, err) + } + } + return proxyResp +} + +func (h sendMultipartDataDesc) formResponse(c *fasthttp.RequestCtx, stream isp.BackendService_RequestStreamClient, + form *multipart.Form, method string) ([]string, domain.ProxyResponse, bool) { + formData := make(map[string]interface{}, len(form.Value)) for k, v := range form.Value { if len(v) > 0 { formData[k] = v[0] @@ -58,13 +74,13 @@ func (h sendMultipartDataDesc) Complete(c *fasthttp.RequestCtx, method string, c } var ( - proxyResp domain.ProxyResponse resp = make([]string, 0) - buffer = make([]byte, bufferSize) + buffer = make([]byte, config.GetRemote().(*conf.RemoteConfig).GrpcSetting.GetTransferFileBufferSize()) + proxyResp domain.ProxyResponse ok = true - eof = false + eof bool + err error ) - for formDataName, files := range form.File { if len(files) == 0 { continue @@ -110,28 +126,14 @@ func (h sendMultipartDataDesc) Complete(c *fasthttp.RequestCtx, method string, c } resp = append(resp, string(response)) } - - err = stream.CloseSend() - if err != nil { - logHandlerError(log_code.TypeData.SendMultipart, method, err) - } - - if ok { - arrayBody := strings.Join(resp, ",") - _, err = c.WriteString("[" + arrayBody + "]") - if err != nil { - logHandlerError(log_code.TypeData.SendMultipart, method, err) - } - } - return proxyResp + return resp, proxyResp, ok } func (sendMultipartDataDesc) transferFile(f multipart.File, stream isp.BackendService_RequestStreamClient, buffer []byte, ctx *fasthttp.RequestCtx, method string) (bool, bool, domain.ProxyResponse) { - var ( ok = true - eof = false + eof bool proxyResp domain.ProxyResponse ) for { diff --git a/proxy/health_check/health_check.go b/proxy/health_check/health_check.go index d6e40fa..d9e80e3 100644 --- a/proxy/health_check/health_check.go +++ b/proxy/health_check/health_check.go @@ -1,7 +1,7 @@ package health_check import ( - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" "github.com/valyala/fasthttp" "isp-gate-service/domain" ) diff --git a/proxy/http/client.go b/proxy/http/client.go index b737dae..ca1da3b 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -2,7 +2,7 @@ package http import ( "errors" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" log "github.com/integration-system/isp-log" "github.com/valyala/fasthttp" "google.golang.org/grpc/codes" diff --git a/proxy/websocket/util.go b/proxy/websocket/util.go index 22cd0eb..8c30826 100644 --- a/proxy/websocket/util.go +++ b/proxy/websocket/util.go @@ -1,7 +1,7 @@ package websocket import ( - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" "sync" ) diff --git a/proxy/websocket/websocket.go b/proxy/websocket/websocket.go index 9922a0d..ff31823 100644 --- a/proxy/websocket/websocket.go +++ b/proxy/websocket/websocket.go @@ -10,7 +10,7 @@ import ( "sync" "github.com/fasthttp/websocket" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" log "github.com/integration-system/isp-log" "github.com/valyala/fasthttp" "google.golang.org/grpc/codes" @@ -25,7 +25,8 @@ const ( ) var pool = &sync.Pool{New: func() interface{} { - return make([]byte, readBufSize) + buf := make([]byte, readBufSize) + return &buf }} // used to filter client request headers @@ -90,9 +91,7 @@ func (p *websocketProxy) ProxyRequest(ctx *fasthttp.RequestCtx, path string) dom outgoingDialer := websocket.Dialer{ ReadBufferSize: readBufSize, WriteBufferSize: writeBufSize, - NetDial: func(network, address string) (net.Conn, error) { - return net.Dial(network, address) - }, + NetDial: net.Dial, } addr := addrs.Get() @@ -114,6 +113,7 @@ func (p *websocketProxy) ProxyRequest(ctx *fasthttp.RequestCtx, path string) dom cookies.SetCookies(&url.URL{Host: reqHost, Scheme: reqScheme}, cookie) outgoingDialer.Jar = cookies + //nolint outgoingConn, _, err := outgoingDialer.Dial(urlAddr, header) if err == nil { go func() { @@ -123,6 +123,7 @@ func (p *websocketProxy) ProxyRequest(ctx *fasthttp.RequestCtx, path string) dom } else { log.Errorf(log_code.ErrorWebsocketProxy, "unable to connect to service %s: %v", urlAddr, err) _ = incomingConn.Close() + _ = outgoingConn.Close() } }) @@ -145,7 +146,7 @@ func (p *websocketProxy) Close() { } func (p *websocketProxy) proxyConn(from, to *websocket.Conn) error { - buf := pool.Get().([]byte) + buf := pool.Get().(*[]byte) defer func() { _ = from.Close() _ = to.Close() @@ -160,7 +161,7 @@ func (p *websocketProxy) proxyConn(from, to *websocket.Conn) error { if err != nil { return err } - if _, err := io.CopyBuffer(writer, reader, buf); err != nil { + if _, err := io.CopyBuffer(writer, reader, *buf); err != nil { return err } if err := writer.Close(); err != nil { diff --git a/redis/client.go b/redis/client.go index d38e3ac..d228cf8 100644 --- a/redis/client.go +++ b/redis/client.go @@ -1,8 +1,8 @@ package redis import ( - rd "github.com/integration-system/isp-lib/redis" - "github.com/integration-system/isp-lib/structure" + rd "github.com/integration-system/isp-lib/v2/redis" + "github.com/integration-system/isp-lib/v2/structure" log "github.com/integration-system/isp-log" "isp-gate-service/log_code" ) diff --git a/routing/routing.go b/routing/routing.go index fd81ead..ee80bd6 100644 --- a/routing/routing.go +++ b/routing/routing.go @@ -1,7 +1,7 @@ package routing import ( - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/structure" ) var ( diff --git a/server/http.go b/server/http.go index 912f3f3..1105336 100644 --- a/server/http.go +++ b/server/http.go @@ -2,7 +2,7 @@ package server import ( "github.com/integration-system/go-cmp/cmp" - "github.com/integration-system/isp-lib/config" + "github.com/integration-system/isp-lib/v2/config" log "github.com/integration-system/isp-log" "github.com/valyala/fasthttp" "isp-gate-service/conf" @@ -12,6 +12,8 @@ import ( "time" ) +const defaultTimeout = 60 * time.Second + var Http = &httpSrv{mx: sync.Mutex{}} type httpSrv struct { @@ -30,7 +32,7 @@ func (s *httpSrv) Init(new, old conf.HttpSetting) { } } -func (s *httpSrv) run(MaxRequestBodySize int64) { +func (s *httpSrv) run(maxRequestBodySize int64) { s.mx.Lock() s.working = true if s.srv != nil { @@ -38,13 +40,12 @@ func (s *httpSrv) run(MaxRequestBodySize int64) { log.Warn(log_code.WarnHttpServerShutdown, err) } } - maxRequestBodySize := MaxRequestBodySize localConfig := config.Get().(*conf.Configuration) restAddress := localConfig.HttpInnerAddress.GetAddress() s.srv = &fasthttp.Server{ Handler: handler.CompleteRequest, - WriteTimeout: time.Second * 60, - ReadTimeout: time.Second * 60, + WriteTimeout: defaultTimeout, + ReadTimeout: defaultTimeout, MaxRequestBodySize: int(maxRequestBodySize), } go func() { diff --git a/service/matcher/matcher.go b/service/matcher/matcher.go index 9f407f7..dcedaf1 100644 --- a/service/matcher/matcher.go +++ b/service/matcher/matcher.go @@ -18,14 +18,14 @@ func NewRuntimeMatcher(patterns []string) Matcher { func NewCacheableMatcher(patterns []string) Matcher { return &cacheableMatcher{ - cache: make(map[string][]string, 0), + cache: make(map[string][]string), rm: runtimeMatcher{patterns: patterns}, } } func NewAtLeastOneMatcher(patterns []string) AtLeastOneMatcher { return &atLeastOneMatcher{ - cache: make(map[string]bool, 0), + cache: make(map[string]bool), rm: runtimeMatcher{patterns: patterns}, } } diff --git a/service/matcher/matcher_test.go b/service/matcher/matcher_test.go index b4651c3..20d636f 100644 --- a/service/matcher/matcher_test.go +++ b/service/matcher/matcher_test.go @@ -1,3 +1,4 @@ +//nolint package matcher import ( diff --git a/service/metrics.go b/service/metrics.go index 68ba94e..7d071e1 100644 --- a/service/metrics.go +++ b/service/metrics.go @@ -1,7 +1,7 @@ package service import ( - "github.com/integration-system/isp-lib/metric" + "github.com/integration-system/isp-lib/v2/metric" "github.com/rcrowley/go-metrics" "sync" "time" @@ -41,7 +41,7 @@ func (m *metricService) UpdateMethodResponseTime(uri string, time time.Duration) func (m *metricService) UpdateStatusCounter(status string) { if m.notEmptyHolder() { - m.getOrRegisterCounter(status).Inc(1) + m.getOrRegisterCounter(status).Inc(1) //nolint } } diff --git a/service/veritification/cacheable_verify.go b/service/veritification/cacheable_verify.go index 2b64e8b..d63a059 100644 --- a/service/veritification/cacheable_verify.go +++ b/service/veritification/cacheable_verify.go @@ -24,7 +24,7 @@ func (cv *cacheablesVerify) ApplicationToken(token string) (map[string]string, e cache, ok := cv.cache[token] cv.lock.RUnlock() if ok { - if time.Now().Sub(cache.created) < cv.timeout { + if time.Since(cache.created) < cv.timeout { return cv.copyCache(cache.identity), nil } } @@ -33,7 +33,7 @@ func (cv *cacheablesVerify) ApplicationToken(token string) (map[string]string, e defer cv.lock.Unlock() cache, ok = cv.cache[token] if ok { - if time.Now().Sub(cache.created) < cv.timeout { + if time.Since(cache.created) < cv.timeout { return cv.copyCache(cache.identity), nil } delete(cv.cache, token) diff --git a/service/veritification/runtime_verify.go b/service/veritification/runtime_verify.go index 9636cc2..9074254 100644 --- a/service/veritification/runtime_verify.go +++ b/service/veritification/runtime_verify.go @@ -2,9 +2,9 @@ package veritification import ( rd "github.com/go-redis/redis" - "github.com/integration-system/isp-lib/config" - "github.com/integration-system/isp-lib/redis" - "github.com/integration-system/isp-lib/utils" + "github.com/integration-system/isp-lib/v2/config" + "github.com/integration-system/isp-lib/v2/redis" + "github.com/integration-system/isp-lib/v2/utils" "github.com/pkg/errors" "isp-gate-service/conf" rdClient "isp-gate-service/redis" diff --git a/utils/utils.go b/utils/utils.go index 856745f..7fb306e 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -2,8 +2,8 @@ package utils import ( "encoding/json" - "github.com/integration-system/isp-lib/http" - "github.com/integration-system/isp-lib/structure" + "github.com/integration-system/isp-lib/v2/http" + "github.com/integration-system/isp-lib/v2/structure" "github.com/valyala/fasthttp" "google.golang.org/grpc/codes" )