From 516c02bebecc9aeafb1614a6f4e4e67615b84b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Borov=C4=8Danin?= Date: Thu, 20 May 2021 20:53:56 +0200 Subject: [PATCH] MF-1378 - Update dependencies (#1379) * Update dependencies Signed-off-by: dusanb94 * Fix compose files and configs Signed-off-by: dusanb94 * Upgrade image versions Signed-off-by: dusanb94 * Update Postgres version Signed-off-by: dusanb94 * Update test dependencies Signed-off-by: dusanb94 * Fix fkey error handling Signed-off-by: dusanb94 --- bootstrap/api/endpoint.go | 36 +- bootstrap/api/endpoint_test.go | 19 +- bootstrap/api/logging.go | 53 +- bootstrap/api/metrics.go | 53 +- bootstrap/postgres/configs.go | 2 +- bootstrap/postgres/setup_test.go | 2 +- bootstrap/redis/consumer/streams.go | 37 +- bootstrap/redis/producer/setup_test.go | 5 +- bootstrap/redis/producer/streams.go | 71 +- bootstrap/redis/producer/streams_test.go | 71 +- bootstrap/service.go | 52 +- bootstrap/service_test.go | 57 +- cmd/bootstrap/main.go | 5 +- cmd/certs/main.go | 2 +- cmd/lora/main.go | 7 +- cmd/mqtt/main.go | 2 +- cmd/opcua/main.go | 8 +- cmd/things/main.go | 2 +- cmd/twins/main.go | 2 +- consumers/messages.go | 3 +- consumers/writers/cassandra/setup_test.go | 2 +- consumers/writers/influxdb/setup_test.go | 2 +- consumers/writers/mongodb/setup_test.go | 2 +- consumers/writers/postgres/setup_test.go | 2 +- docker/addons/bootstrap/docker-compose.yml | 2 +- .../cassandra-writer/docker-compose.yml | 2 +- docker/addons/cassandra-writer/init.sh | 2 +- .../addons/influxdb-writer/docker-compose.yml | 2 +- .../addons/mongodb-writer/docker-compose.yml | 2 +- .../addons/postgres-writer/docker-compose.yml | 2 +- go.mod | 67 +- go.sum | 501 +- lora/adapter.go | 67 +- lora/adapter_test.go | 12 +- lora/api/logging.go | 39 +- lora/api/metrics.go | 37 +- lora/mocks/routes.go | 7 +- lora/redis/routemap.go | 19 +- lora/redis/streams.go | 62 +- lora/routemap.go | 8 +- mqtt/handler.go | 5 +- mqtt/redis/streams.go | 5 +- opcua/adapter.go | 59 +- opcua/api/endpoint.go | 2 +- opcua/api/logging.go | 37 +- opcua/api/metrics.go | 37 +- opcua/eventstore.go | 4 +- opcua/gopcua/subscribe.go | 16 +- opcua/redis/routemap.go | 19 +- opcua/redis/streams.go | 51 +- opcua/routemap.go | 8 +- opcua/subscriber.go | 4 +- pkg/auth/client.go | 16 +- things/redis/channels.go | 18 +- things/redis/setup_test.go | 5 +- things/redis/streams.go | 18 +- things/redis/streams_test.go | 70 +- things/redis/things.go | 18 +- things/redis/things_test.go | 2 +- tools/mqtt-bench/bench.go | 9 +- twins/redis/setup_test.go | 5 +- twins/redis/twins.go | 42 +- twins/redis/twins_test.go | 10 +- vendor/github.com/BurntSushi/toml/.gitignore | 5 - vendor/github.com/BurntSushi/toml/.travis.yml | 15 - vendor/github.com/BurntSushi/toml/COMPATIBLE | 3 - vendor/github.com/BurntSushi/toml/Makefile | 19 - vendor/github.com/BurntSushi/toml/README.md | 218 - vendor/github.com/BurntSushi/toml/decode.go | 509 -- .../github.com/BurntSushi/toml/decode_meta.go | 121 - vendor/github.com/BurntSushi/toml/doc.go | 27 - vendor/github.com/BurntSushi/toml/encode.go | 568 -- .../BurntSushi/toml/encoding_types.go | 19 - .../BurntSushi/toml/encoding_types_1.1.go | 18 - vendor/github.com/BurntSushi/toml/lex.go | 953 -- vendor/github.com/BurntSushi/toml/parse.go | 592 -- vendor/github.com/BurntSushi/toml/session.vim | 1 - .../github.com/BurntSushi/toml/type_check.go | 91 - .../github.com/BurntSushi/toml/type_fields.go | 242 - .../cenkalti/backoff/v3/.travis.yml | 10 - vendor/github.com/cenkalti/backoff/v3/LICENSE | 20 - .../github.com/cenkalti/backoff/v3/README.md | 30 - .../github.com/cenkalti/backoff/v3/backoff.go | 66 - .../github.com/cenkalti/backoff/v3/context.go | 63 - .../cenkalti/backoff/v3/exponential.go | 153 - vendor/github.com/cenkalti/backoff/v3/go.mod | 3 - .../github.com/cenkalti/backoff/v3/retry.go | 82 - .../github.com/cenkalti/backoff/v3/ticker.go | 82 - .../github.com/cenkalti/backoff/v3/tries.go | 35 - .../COPYING => dgryski/go-rendezvous/LICENSE} | 2 +- .../github.com/dgryski/go-rendezvous/rdv.go | 79 + vendor/github.com/docker/docker/AUTHORS | 797 +- vendor/github.com/docker/docker/LICENSE | 2 +- vendor/github.com/docker/docker/NOTICE | 4 +- .../pkg/namesgenerator/names-generator.go | 302 +- .../docker/docker/pkg/random/random.go | 71 - .../eclipse/paho.mqtt.golang/LICENSE | 91 +- .../eclipse/paho.mqtt.golang/README.md | 142 +- .../eclipse/paho.mqtt.golang/client.go | 987 ++- .../eclipse/paho.mqtt.golang/components.go | 1 + .../eclipse/paho.mqtt.golang/filestore.go | 14 +- .../eclipse/paho.mqtt.golang/go.mod | 8 + .../eclipse/paho.mqtt.golang/go.sum | 8 + .../eclipse/paho.mqtt.golang/memstore.go | 2 +- .../eclipse/paho.mqtt.golang/message.go | 4 +- .../eclipse/paho.mqtt.golang/messageids.go | 69 +- .../eclipse/paho.mqtt.golang/net.go | 621 +- .../eclipse/paho.mqtt.golang/netconn.go | 92 + .../eclipse/paho.mqtt.golang/options.go | 93 +- .../paho.mqtt.golang/options_reader.go | 30 +- .../paho.mqtt.golang/packets/connack.go | 17 +- .../paho.mqtt.golang/packets/connect.go | 33 +- .../paho.mqtt.golang/packets/disconnect.go | 16 +- .../paho.mqtt.golang/packets/packets.go | 90 +- .../paho.mqtt.golang/packets/pingreq.go | 16 +- .../paho.mqtt.golang/packets/pingresp.go | 16 +- .../paho.mqtt.golang/packets/puback.go | 17 +- .../paho.mqtt.golang/packets/pubcomp.go | 17 +- .../paho.mqtt.golang/packets/publish.go | 29 +- .../paho.mqtt.golang/packets/pubrec.go | 17 +- .../paho.mqtt.golang/packets/pubrel.go | 17 +- .../paho.mqtt.golang/packets/suback.go | 17 +- .../paho.mqtt.golang/packets/subscribe.go | 19 +- .../paho.mqtt.golang/packets/unsuback.go | 17 +- .../paho.mqtt.golang/packets/unsubscribe.go | 17 +- .../eclipse/paho.mqtt.golang/ping.go | 17 +- .../eclipse/paho.mqtt.golang/router.go | 85 +- .../eclipse/paho.mqtt.golang/token.go | 36 +- .../eclipse/paho.mqtt.golang/topic.go | 28 +- .../eclipse/paho.mqtt.golang/trace.go | 2 +- .../eclipse/paho.mqtt.golang/websocket.go | 119 + vendor/github.com/fatih/color/README.md | 13 +- vendor/github.com/fatih/color/go.mod | 4 +- vendor/github.com/fatih/color/go.sum | 15 +- vendor/github.com/go-redis/redis/.travis.yml | 20 - vendor/github.com/go-redis/redis/CHANGELOG.md | 25 - vendor/github.com/go-redis/redis/README.md | 146 - .../go-redis/redis/cluster_commands.go | 22 - vendor/github.com/go-redis/redis/command.go | 1972 ----- vendor/github.com/go-redis/redis/commands.go | 2583 ------ .../internal/consistenthash/consistenthash.go | 81 - .../go-redis/redis/internal/error.go | 89 - .../go-redis/redis/internal/internal.go | 24 - .../github.com/go-redis/redis/internal/log.go | 15 - .../go-redis/redis/internal/pool/conn.go | 95 - .../redis/internal/pool/pool_sticky.go | 109 - .../go-redis/redis/internal/util.go | 39 - vendor/github.com/go-redis/redis/redis.go | 583 -- vendor/github.com/go-redis/redis/script.go | 62 - vendor/github.com/go-redis/redis/sentinel.go | 415 - vendor/github.com/go-redis/redis/tx.go | 110 - .../go-redis/redis/{ => v8}/.gitignore | 1 + .../go-redis/redis/v8/.golangci.yml | 26 + .../github.com/go-redis/redis/v8/.prettierrc | 4 + .../github.com/go-redis/redis/v8/CHANGELOG.md | 120 + .../go-redis/redis/{ => v8}/LICENSE | 0 .../go-redis/redis/{ => v8}/Makefile | 14 +- vendor/github.com/go-redis/redis/v8/README.md | 169 + .../go-redis/redis/{ => v8}/cluster.go | 1163 +-- .../go-redis/redis/v8/cluster_commands.go | 25 + .../github.com/go-redis/redis/v8/command.go | 2591 ++++++ .../github.com/go-redis/redis/v8/commands.go | 2931 +++++++ .../github.com/go-redis/redis/{ => v8}/doc.go | 0 vendor/github.com/go-redis/redis/v8/error.go | 125 + vendor/github.com/go-redis/redis/v8/go.mod | 13 + vendor/github.com/go-redis/redis/v8/go.sum | 99 + .../go-redis/redis/v8/internal/arg.go | 56 + .../{ => v8}/internal/hashtag/hashtag.go | 3 +- .../go-redis/redis/v8/internal/hscan/hscan.go | 201 + .../redis/v8/internal/hscan/structmap.go | 93 + .../go-redis/redis/v8/internal/instruments.go | 33 + .../go-redis/redis/v8/internal/internal.go | 29 + .../go-redis/redis/v8/internal/log.go | 24 + .../go-redis/redis/{ => v8}/internal/once.go | 0 .../go-redis/redis/v8/internal/pool/conn.go | 137 + .../redis/{ => v8}/internal/pool/pool.go | 236 +- .../redis/v8/internal/pool/pool_single.go | 58 + .../internal/pool/pool_sticky.go} | 126 +- .../redis/{ => v8}/internal/proto/reader.go | 75 +- .../redis/{ => v8}/internal/proto/scan.go | 10 +- .../redis/{ => v8}/internal/proto/writer.go | 58 +- .../go-redis/redis/v8/internal/rand/rand.go | 50 + .../go-redis/redis/v8/internal/safe.go | 11 + .../go-redis/redis/v8/internal/unsafe.go | 20 + .../go-redis/redis/v8/internal/util.go | 70 + .../redis/{ => v8}/internal/util/safe.go | 0 .../redis/{ => v8}/internal/util/strconv.go | 0 .../redis/{ => v8}/internal/util/unsafe.go | 0 .../go-redis/redis/{ => v8}/iterator.go | 18 +- .../go-redis/redis/{ => v8}/options.go | 155 +- .../go-redis/redis/{ => v8}/pipeline.go | 44 +- .../go-redis/redis/{ => v8}/pubsub.go | 339 +- vendor/github.com/go-redis/redis/v8/redis.go | 796 ++ .../go-redis/redis/{ => v8}/result.go | 108 +- .../go-redis/redis/{ => v8}/ring.go | 475 +- vendor/github.com/go-redis/redis/v8/script.go | 65 + .../github.com/go-redis/redis/v8/sentinel.go | 778 ++ vendor/github.com/go-redis/redis/v8/tx.go | 148 + .../go-redis/redis/{ => v8}/universal.go | 95 +- vendor/github.com/gocql/gocql/.travis.yml | 6 +- vendor/github.com/gocql/gocql/AUTHORS | 6 + vendor/github.com/gocql/gocql/README.md | 72 +- vendor/github.com/gocql/gocql/cluster.go | 13 +- vendor/github.com/gocql/gocql/conn.go | 78 +- .../github.com/gocql/gocql/connectionpool.go | 56 +- vendor/github.com/gocql/gocql/control.go | 12 +- vendor/github.com/gocql/gocql/doc.go | 317 +- vendor/github.com/gocql/gocql/events.go | 106 +- vendor/github.com/gocql/gocql/filters.go | 2 +- vendor/github.com/gocql/gocql/frame.go | 59 +- vendor/github.com/gocql/gocql/helpers.go | 27 +- vendor/github.com/gocql/gocql/host_source.go | 53 +- .../gocql/gocql/install_test_deps.sh | 6 - vendor/github.com/gocql/gocql/logger.go | 10 + vendor/github.com/gocql/gocql/marshal.go | 126 +- vendor/github.com/gocql/gocql/metadata.go | 83 +- vendor/github.com/gocql/gocql/policies.go | 109 +- .../github.com/gocql/gocql/prepared_cache.go | 12 - .../github.com/gocql/gocql/query_executor.go | 31 +- vendor/github.com/gocql/gocql/ring.go | 23 - vendor/github.com/gocql/gocql/session.go | 127 +- vendor/github.com/gocql/gocql/token.go | 2 +- vendor/github.com/gocql/gocql/topology.go | 51 +- vendor/github.com/gocql/gocql/uuid.go | 3 +- vendor/github.com/gofrs/uuid/README.md | 1 - vendor/github.com/gofrs/uuid/generator.go | 36 +- vendor/github.com/gofrs/uuid/uuid.go | 18 +- .../gogo/protobuf/proto/text_parser.go | 2 +- .../golang/protobuf/proto/text_decode.go | 2 +- .../hashicorp/go-multierror/.travis.yml | 2 +- .../hashicorp/go-multierror/README.md | 40 +- .../github.com/hashicorp/go-multierror/go.mod | 2 + .../github.com/hashicorp/go-multierror/go.sum | 2 - .../hashicorp/go-multierror/group.go | 38 + .../hashicorp/go-multierror/multierror.go | 67 + .../hashicorp/go-retryablehttp/README.md | 15 + .../hashicorp/go-retryablehttp/client.go | 354 +- .../hashicorp/go-retryablehttp/go.mod | 7 +- .../hashicorp/go-retryablehttp/go.sum | 12 +- .../go-retryablehttp/roundtripper.go | 43 + .../hashicorp/go-rootcerts/README.md | 5 +- .../hashicorp/go-rootcerts/rootcerts.go | 26 +- .../github.com/hashicorp/vault/api/README.md | 6 + .../hashicorp/vault/api/auth_token.go | 20 + .../github.com/hashicorp/vault/api/client.go | 304 +- vendor/github.com/hashicorp/vault/api/go.mod | 19 +- vendor/github.com/hashicorp/vault/api/go.sum | 279 +- .../hashicorp/vault/api/lifetime_watcher.go | 384 + .../github.com/hashicorp/vault/api/logical.go | 18 +- .../hashicorp/vault/api/plugin_helpers.go | 3 + .../github.com/hashicorp/vault/api/renewer.go | 349 - .../github.com/hashicorp/vault/api/request.go | 3 +- .../hashicorp/vault/api/response.go | 4 +- .../hashicorp/vault/api/ssh_agent.go | 7 + .../hashicorp/vault/api/sys_audit.go | 2 +- .../hashicorp/vault/api/sys_config_cors.go | 60 +- .../hashicorp/vault/api/sys_generate_root.go | 16 + .../hashicorp/vault/api/sys_leader.go | 22 +- .../hashicorp/vault/api/sys_leases.go | 8 +- .../hashicorp/vault/api/sys_monitor.go | 64 + .../hashicorp/vault/api/sys_mounts.go | 30 +- .../hashicorp/vault/api/sys_plugins.go | 101 + .../hashicorp/vault/api/sys_raft.go | 189 +- .../hashicorp/vault/api/sys_rotate.go | 14 + .../hashicorp/vault/api/sys_seal.go | 1 + .../vault/sdk/helper/consts/consts.go | 11 +- .../vault/sdk/helper/consts/replication.go | 5 + .../hokaccha/go-prettyjson/prettyjson.go | 7 +- vendor/github.com/jmoiron/sqlx/.gitignore | 1 + vendor/github.com/jmoiron/sqlx/README.md | 56 +- vendor/github.com/jmoiron/sqlx/bind.go | 90 +- vendor/github.com/jmoiron/sqlx/go.mod | 8 +- vendor/github.com/jmoiron/sqlx/go.sum | 12 +- vendor/github.com/jmoiron/sqlx/named.go | 57 +- .../jmoiron/sqlx/reflectx/reflect.go | 11 +- vendor/github.com/jmoiron/sqlx/sqlx.go | 14 +- .../github.com/jmoiron/sqlx/sqlx_context.go | 68 + .../go-windows-terminal-sequences/README.md | 1 + .../sequences.go | 3 +- vendor/github.com/lib/pq/.gitignore | 2 + vendor/github.com/lib/pq/.travis.yml | 3 +- vendor/github.com/lib/pq/README.md | 5 +- vendor/github.com/lib/pq/array.go | 141 +- vendor/github.com/lib/pq/conn.go | 137 +- vendor/github.com/lib/pq/conn_go18.go | 35 +- vendor/github.com/lib/pq/connector.go | 2 +- vendor/github.com/lib/pq/copy.go | 29 +- vendor/github.com/lib/pq/doc.go | 9 +- vendor/github.com/lib/pq/error.go | 11 +- vendor/github.com/lib/pq/ssl.go | 24 +- vendor/github.com/lib/pq/url.go | 4 +- .../github.com/mattn/go-colorable/.travis.yml | 12 +- .../github.com/mattn/go-colorable/README.md | 4 +- .../mattn/go-colorable/colorable_appengine.go | 8 + .../mattn/go-colorable/colorable_others.go | 8 + .../mattn/go-colorable/colorable_windows.go | 56 +- vendor/github.com/mattn/go-colorable/go.mod | 7 +- vendor/github.com/mattn/go-colorable/go.sum | 9 +- .../github.com/mattn/go-colorable/go.test.sh | 12 + vendor/github.com/mattn/go-isatty/.travis.yml | 15 +- vendor/github.com/mattn/go-isatty/README.md | 2 +- vendor/github.com/mattn/go-isatty/go.mod | 2 +- vendor/github.com/mattn/go-isatty/go.sum | 4 +- vendor/github.com/mattn/go-isatty/go.test.sh | 12 + .../mattn/go-isatty/isatty_android.go | 23 - .../github.com/mattn/go-isatty/isatty_bsd.go | 12 +- .../mattn/go-isatty/isatty_tcgets.go | 1 - .../github.com/mattn/go-isatty/renovate.json | 8 + .../mitchellh/mapstructure/.travis.yml | 8 - .../mitchellh/mapstructure/CHANGELOG.md | 52 + .../mitchellh/mapstructure/decode_hooks.go | 71 +- .../github.com/mitchellh/mapstructure/go.mod | 2 + .../mitchellh/mapstructure/mapstructure.go | 479 +- vendor/github.com/moby/term/.gitignore | 8 + vendor/github.com/moby/term/LICENSE | 191 + vendor/github.com/moby/term/README.md | 36 + .../v3/docker/pkg => moby}/term/ascii.go | 2 +- vendor/github.com/moby/term/go.mod | 12 + vendor/github.com/moby/term/go.sum | 23 + vendor/github.com/moby/term/proxy.go | 88 + vendor/github.com/moby/term/tc.go | 19 + .../v3/docker/pkg => moby}/term/term.go | 20 +- .../docker/pkg => moby}/term/term_windows.go | 101 +- .../termios_linux.go => moby/term/termios.go} | 20 +- vendor/github.com/moby/term/termios_bsd.go | 12 + vendor/github.com/moby/term/termios_nonbsd.go | 12 + .../pkg => moby}/term/windows/ansi_reader.go | 21 +- .../pkg => moby}/term/windows/ansi_writer.go | 12 +- .../pkg => moby}/term/windows/console.go | 16 +- vendor/github.com/moby/term/windows/doc.go | 5 + .../v3/docker/pkg => moby}/term/winsize.go | 2 +- vendor/github.com/nats-io/jwt/.travis.yml | 22 - vendor/github.com/nats-io/jwt/Makefile | 19 - vendor/github.com/nats-io/jwt/README.md | 54 - vendor/github.com/nats-io/jwt/ReleaseNotes.md | 5 - .../github.com/nats-io/jwt/account_claims.go | 222 - .../nats-io/jwt/activation_claims.go | 166 - vendor/github.com/nats-io/jwt/claims.go | 302 - .../github.com/nats-io/jwt/cluster_claims.go | 94 - vendor/github.com/nats-io/jwt/creds_utils.go | 203 - vendor/github.com/nats-io/jwt/exports.go | 236 - vendor/github.com/nats-io/jwt/genericlaims.go | 73 - vendor/github.com/nats-io/jwt/go.mod | 3 - vendor/github.com/nats-io/jwt/go.sum | 9 - vendor/github.com/nats-io/jwt/header.go | 71 - vendor/github.com/nats-io/jwt/imports.go | 151 - .../github.com/nats-io/jwt/operator_claims.go | 204 - .../github.com/nats-io/jwt/revocation_list.go | 32 - .../github.com/nats-io/jwt/server_claims.go | 94 - vendor/github.com/nats-io/jwt/types.go | 334 - vendor/github.com/nats-io/jwt/user_claims.go | 99 - vendor/github.com/nats-io/jwt/validation.go | 107 - vendor/github.com/nats-io/nats.go/.travis.yml | 14 +- .../github.com/nats-io/nats.go/MAINTAINERS.md | 6 +- vendor/github.com/nats-io/nats.go/README.md | 102 +- vendor/github.com/nats-io/nats.go/context.go | 84 +- .../nats-io/nats.go/dependencies.md | 13 + vendor/github.com/nats-io/nats.go/enc.go | 8 +- vendor/github.com/nats-io/nats.go/go.mod | 5 +- vendor/github.com/nats-io/nats.go/go.sum | 22 +- vendor/github.com/nats-io/nats.go/go_test.mod | 11 + vendor/github.com/nats-io/nats.go/go_test.sum | 99 + vendor/github.com/nats-io/nats.go/js.go | 2345 +++++ vendor/github.com/nats-io/nats.go/jsm.go | 1077 +++ vendor/github.com/nats-io/nats.go/nats.go | 1329 ++- vendor/github.com/nats-io/nats.go/netchan.go | 2 +- vendor/github.com/nats-io/nats.go/parser.go | 77 +- vendor/github.com/nats-io/nats.go/ws.go | 700 ++ vendor/github.com/nats-io/nkeys/.travis.yml | 10 +- .../github.com/nats-io/nkeys/MAINTAINERS.md | 6 +- vendor/github.com/nats-io/nkeys/README.md | 5 +- .../github.com/nats-io/nkeys/creds_utils.go | 78 + vendor/github.com/nats-io/nkeys/go.mod | 4 +- vendor/github.com/nats-io/nkeys/go.sum | 14 +- vendor/github.com/nats-io/nkeys/main.go | 2 +- .../ory/dockertest/v3/.reference-ignore | 3 + .../ory/dockertest/v3/CONTRIBUTING.md | 180 +- vendor/github.com/ory/dockertest/v3/LICENSE | 1 - vendor/github.com/ory/dockertest/v3/README.md | 66 + .../github.com/ory/dockertest/v3/SECURITY.md | 11 +- .../ory/dockertest/v3/docker/container.go | 2 +- .../v3/docker/pkg/jsonmessage/jsonmessage.go | 2 +- .../dockertest/v3/docker/pkg/term/proxy.go | 74 - .../ory/dockertest/v3/docker/pkg/term/tc.go | 20 - .../v3/docker/pkg/term/termios_bsd.go | 42 - .../v3/docker/pkg/term/windows/windows.go | 33 - .../ory/dockertest/v3/dockertest.go | 16 +- vendor/github.com/ory/dockertest/v3/go.mod | 8 +- vendor/github.com/ory/dockertest/v3/go.sum | 26 +- .../pelletier/go-toml/CONTRIBUTING.md | 4 +- vendor/github.com/pelletier/go-toml/LICENSE | 2 +- vendor/github.com/pelletier/go-toml/README.md | 12 +- .../pelletier/go-toml/azure-pipelines.yml | 80 +- .../pelletier/go-toml/benchmark.json | 164 - .../github.com/pelletier/go-toml/benchmark.sh | 4 + .../pelletier/go-toml/benchmark.toml | 244 - .../pelletier/go-toml/benchmark.yml | 121 - vendor/github.com/pelletier/go-toml/fuzzit.sh | 26 - vendor/github.com/pelletier/go-toml/go.mod | 6 - vendor/github.com/pelletier/go-toml/go.sum | 19 - vendor/github.com/pelletier/go-toml/lexer.go | 380 +- .../github.com/pelletier/go-toml/marshal.go | 79 +- vendor/github.com/pelletier/go-toml/parser.go | 93 +- vendor/github.com/pelletier/go-toml/token.go | 6 +- vendor/github.com/pelletier/go-toml/toml.go | 136 +- .../github.com/pelletier/go-toml/tomlpub.go | 71 + .../pelletier/go-toml/tomltree_create.go | 13 + .../pelletier/go-toml/tomltree_write.go | 42 +- .../pelletier/go-toml/tomltree_writepub.go | 6 + .../plgd-dev/go-coap/v2/.travis.yml | 29 - .../plgd-dev/go-coap/v2/dtls/client.go | 45 +- .../plgd-dev/go-coap/v2/dtls/options.go | 92 +- .../plgd-dev/go-coap/v2/dtls/server.go | 82 +- .../plgd-dev/go-coap/v2/dtls/session.go | 36 +- vendor/github.com/plgd-dev/go-coap/v2/go.mod | 1 + vendor/github.com/plgd-dev/go-coap/v2/go.sum | 1 + .../go-coap/v2/message/codes/codes.go | 2 +- .../plgd-dev/go-coap/v2/message/options.go | 15 + .../go-coap/v2/message/pool/message.go | 11 +- .../plgd-dev/go-coap/v2/mux/client.go | 1 + .../plgd-dev/go-coap/v2/mux/message.go | 5 + .../go-coap/v2/net/blockwise/blockwise.go | 72 +- .../plgd-dev/go-coap/v2/net/conn.go | 64 +- .../plgd-dev/go-coap/v2/net/connUDP.go | 117 +- .../plgd-dev/go-coap/v2/net/dtlslistener.go | 84 +- .../plgd-dev/go-coap/v2/net/isTemporary.go | 19 +- .../go-coap/v2/net/keepalive/error.go | 9 - .../go-coap/v2/net/keepalive/keepalive.go | 152 - .../monitor/inactivity/inactivitymonitor.go | 72 + .../v2/net/monitor/inactivity/keepalive.go | 55 + .../go-coap/v2/net/observation/observation.go | 22 + .../plgd-dev/go-coap/v2/net/options.go | 120 + .../plgd-dev/go-coap/v2/net/tcplistener.go | 15 +- .../plgd-dev/go-coap/v2/net/tlslistener.go | 13 +- .../plgd-dev/go-coap/v2/tcp/client.go | 4 + .../plgd-dev/go-coap/v2/tcp/clientconn.go | 126 +- .../plgd-dev/go-coap/v2/tcp/clientobserve.go | 120 +- .../go-coap/v2/tcp/message/pool/message.go | 8 +- .../plgd-dev/go-coap/v2/tcp/options.go | 91 +- .../plgd-dev/go-coap/v2/tcp/server.go | 85 +- .../plgd-dev/go-coap/v2/tcp/session.go | 145 +- .../plgd-dev/go-coap/v2/udp/client.go | 41 +- .../plgd-dev/go-coap/v2/udp/client/client.go | 4 + .../go-coap/v2/udp/client/clientconn.go | 284 +- .../go-coap/v2/udp/client/clientobserve.go | 101 +- .../v2/udp/client/inactivitymonitor.go | 8 + .../go-coap/v2/udp/client/mutexmap.go | 74 + .../plgd-dev/go-coap/v2/udp/client/mux.go | 2 + .../plgd-dev/go-coap/v2/udp/discover.go | 2 +- .../go-coap/v2/udp/message/pool/message.go | 13 +- .../plgd-dev/go-coap/v2/udp/message/type.go | 2 + .../plgd-dev/go-coap/v2/udp/options.go | 89 +- .../plgd-dev/go-coap/v2/udp/server.go | 144 +- .../plgd-dev/go-coap/v2/udp/session.go | 37 +- .../client_golang/prometheus/counter.go | 20 +- .../client_golang/prometheus/desc.go | 4 +- .../client_golang/prometheus/gauge.go | 20 +- .../client_golang/prometheus/go_collector.go | 14 +- .../client_golang/prometheus/histogram.go | 24 +- .../client_golang/prometheus/metric.go | 6 +- .../prometheus/process_collector.go | 21 + .../prometheus/promhttp/delegator.go | 6 +- .../client_golang/prometheus/promhttp/http.go | 10 +- .../prometheus/promhttp/instrument_server.go | 91 +- .../client_golang/prometheus/registry.go | 4 +- .../client_golang/prometheus/summary.go | 28 +- .../client_golang/prometheus/value.go | 15 +- .../client_golang/prometheus/vec.go | 114 +- .../client_golang/prometheus/wrap.go | 6 +- .../prometheus/common/expfmt/decode.go | 2 +- .../prometheus/common/expfmt/text_parse.go | 11 + .../github.com/prometheus/common/model/fnv.go | 2 +- .../prometheus/common/model/time.go | 112 +- .../prometheus/procfs/CODE_OF_CONDUCT.md | 3 + .../prometheus/procfs/Makefile.common | 4 +- .../github.com/prometheus/procfs/SECURITY.md | 6 + vendor/github.com/prometheus/procfs/arp.go | 4 +- .../github.com/prometheus/procfs/buddyinfo.go | 2 +- .../github.com/prometheus/procfs/cpuinfo.go | 73 +- .../{cpuinfo_arm.go => cpuinfo_armx.go} | 1 + .../prometheus/procfs/cpuinfo_mips64le.go | 18 - .../prometheus/procfs/cpuinfo_mipsle.go | 18 - .../{cpuinfo_mips.go => cpuinfo_mipsx.go} | 1 + .../{cpuinfo_arm64.go => cpuinfo_others.go} | 4 +- .../prometheus/procfs/cpuinfo_ppc64le.go | 18 - .../{cpuinfo_ppc64.go => cpuinfo_ppcx.go} | 1 + .../{cpuinfo_mips64.go => cpuinfo_riscvx.go} | 3 +- .../{cpuinfo_default.go => cpuinfo_x86.go} | 0 vendor/github.com/prometheus/procfs/crypto.go | 4 +- .../prometheus/procfs/fixtures.ttar | 449 +- .../github.com/prometheus/procfs/fscache.go | 2 +- vendor/github.com/prometheus/procfs/go.mod | 8 +- vendor/github.com/prometheus/procfs/go.sum | 14 +- .../prometheus/procfs/internal/fs/fs.go | 4 +- .../prometheus/procfs/kernel_random.go | 2 +- .../github.com/prometheus/procfs/loadavg.go | 4 +- vendor/github.com/prometheus/procfs/mdstat.go | 47 +- .../github.com/prometheus/procfs/meminfo.go | 194 +- .../prometheus/procfs/mountstats.go | 15 +- .../prometheus/procfs/net_conntrackstat.go | 4 +- .../prometheus/procfs/net_ip_socket.go | 220 + .../prometheus/procfs/net_protocols.go | 180 + .../prometheus/procfs/net_sockstat.go | 4 +- .../prometheus/procfs/net_softnet.go | 2 +- .../github.com/prometheus/procfs/net_tcp.go | 64 + .../github.com/prometheus/procfs/net_udp.go | 183 +- .../github.com/prometheus/procfs/net_unix.go | 14 +- vendor/github.com/prometheus/procfs/proc.go | 6 +- .../prometheus/procfs/proc_cgroup.go | 2 +- .../prometheus/procfs/proc_fdinfo.go | 4 +- .../prometheus/procfs/proc_limits.go | 87 +- .../github.com/prometheus/procfs/proc_ns.go | 6 +- .../github.com/prometheus/procfs/proc_psi.go | 2 +- .../github.com/prometheus/procfs/proc_stat.go | 5 +- .../prometheus/procfs/proc_status.go | 6 +- .../github.com/prometheus/procfs/schedstat.go | 15 +- vendor/github.com/prometheus/procfs/slab.go | 151 + vendor/github.com/prometheus/procfs/stat.go | 24 +- vendor/github.com/prometheus/procfs/xfrm.go | 3 +- .../github.com/prometheus/procfs/zoneinfo.go | 4 +- .../rubenv/sql-migrate/.dockerignore | 6 + .../github.com/rubenv/sql-migrate/.gitignore | 1 + .../github.com/rubenv/sql-migrate/.travis.yml | 2 + .../github.com/rubenv/sql-migrate/Dockerfile | 25 + .../github.com/rubenv/sql-migrate/README.md | 8 +- vendor/github.com/rubenv/sql-migrate/go.mod | 26 +- vendor/github.com/rubenv/sql-migrate/go.sum | 387 +- .../github.com/sirupsen/logrus/.golangci.yml | 40 + vendor/github.com/sirupsen/logrus/.travis.yml | 14 +- .../github.com/sirupsen/logrus/CHANGELOG.md | 27 +- vendor/github.com/sirupsen/logrus/README.md | 44 +- .../github.com/sirupsen/logrus/appveyor.yml | 28 +- vendor/github.com/sirupsen/logrus/entry.go | 47 +- vendor/github.com/sirupsen/logrus/exported.go | 2 +- vendor/github.com/sirupsen/logrus/go.mod | 5 +- vendor/github.com/sirupsen/logrus/go.sum | 8 +- .../sirupsen/logrus/json_formatter.go | 4 + vendor/github.com/sirupsen/logrus/logger.go | 11 +- vendor/github.com/sirupsen/logrus/logrus.go | 2 +- .../sirupsen/logrus/terminal_check_bsd.go | 2 +- .../sirupsen/logrus/terminal_check_js.go | 7 + .../sirupsen/logrus/terminal_check_unix.go | 2 +- .../sirupsen/logrus/text_formatter.go | 55 +- vendor/github.com/sirupsen/logrus/writer.go | 6 + vendor/github.com/spf13/cobra/.golangci.yml | 48 + vendor/github.com/spf13/cobra/.travis.yml | 9 +- vendor/github.com/spf13/cobra/CHANGELOG.md | 51 + vendor/github.com/spf13/cobra/CONDUCT.md | 37 + vendor/github.com/spf13/cobra/CONTRIBUTING.md | 50 + vendor/github.com/spf13/cobra/Makefile | 18 +- vendor/github.com/spf13/cobra/README.md | 132 +- .../spf13/cobra/bash_completions.go | 188 +- .../spf13/cobra/bash_completions.md | 306 +- vendor/github.com/spf13/cobra/cobra.go | 15 + vendor/github.com/spf13/cobra/command.go | 162 +- .../spf13/cobra/custom_completions.go | 305 +- .../spf13/cobra/fish_completions.go | 71 +- .../spf13/cobra/fish_completions.md | 7 +- vendor/github.com/spf13/cobra/go.mod | 6 +- vendor/github.com/spf13/cobra/go.sum | 202 +- .../spf13/cobra/powershell_completions.go | 323 +- .../spf13/cobra/powershell_completions.md | 13 +- .../spf13/cobra/projects_using_cobra.md | 38 + .../spf13/cobra/shell_completions.go | 53 +- .../spf13/cobra/shell_completions.md | 483 + .../github.com/spf13/cobra/zsh_completions.go | 524 +- .../github.com/spf13/cobra/zsh_completions.md | 87 +- vendor/github.com/spf13/viper/util.go | 13 +- vendor/github.com/spf13/viper/viper.go | 24 +- .../testify/assert/assertion_compare.go | 172 +- .../testify/assert/assertion_format.go | 97 + .../testify/assert/assertion_forward.go | 194 + .../testify/assert/assertion_order.go | 81 + .../stretchr/testify/assert/assertions.go | 83 +- .../stretchr/testify/require/require.go | 248 + .../testify/require/require_forward.go | 194 + .../uber/jaeger-client-go/.travis.yml | 32 +- .../uber/jaeger-client-go/CHANGELOG.md | 37 + .../uber/jaeger-client-go/CODEOWNERS | 2 + .../uber/jaeger-client-go/Gopkg.lock | 229 +- .../uber/jaeger-client-go/Gopkg.toml | 4 +- .../github.com/uber/jaeger-client-go/Makefile | 6 +- .../uber/jaeger-client-go/README.md | 2 + .../uber/jaeger-client-go/config/config.go | 46 +- .../jaeger-client-go/config/config_env.go | 66 +- .../uber/jaeger-client-go/config/options.go | 8 + .../uber/jaeger-client-go/constants.go | 2 +- .../uber/jaeger-client-go/glide.lock | 53 +- .../uber/jaeger-client-go/glide.yaml | 8 +- .../uber/jaeger-client-go/propagation.go | 14 +- .../uber/jaeger-client-go/sampler_remote.go | 39 +- .../sampler_remote_options.go | 5 +- .../github.com/uber/jaeger-client-go/span.go | 80 +- .../uber/jaeger-client-go/span_context.go | 45 +- .../uber/jaeger-client-go/tracer.go | 29 +- .../uber/jaeger-client-go/transport_udp.go | 41 +- .../utils/reconnecting_udp_conn.go | 189 + .../uber/jaeger-client-go/utils/udp_client.go | 87 +- .../{nats-io/jwt => xdg-go/pbkdf2}/.gitignore | 4 - .../{xdg/scram => xdg-go/pbkdf2}/LICENSE | 0 vendor/github.com/xdg-go/pbkdf2/README.md | 17 + vendor/github.com/xdg-go/pbkdf2/go.mod | 3 + vendor/github.com/xdg-go/pbkdf2/pbkdf2.go | 76 + .../{xdg => xdg-go}/scram/.gitignore | 0 vendor/github.com/xdg-go/scram/CHANGELOG.md | 14 + .../{xdg/stringprep => xdg-go/scram}/LICENSE | 0 .../{xdg => xdg-go}/scram/README.md | 7 +- .../{xdg => xdg-go}/scram/client.go | 2 +- .../{xdg => xdg-go}/scram/client_conv.go | 0 .../{xdg => xdg-go}/scram/common.go | 0 .../github.com/{xdg => xdg-go}/scram/doc.go | 0 vendor/github.com/xdg-go/scram/go.mod | 8 + vendor/github.com/xdg-go/scram/go.sum | 7 + .../github.com/{xdg => xdg-go}/scram/parse.go | 0 .../github.com/{xdg => xdg-go}/scram/scram.go | 2 +- .../{xdg => xdg-go}/scram/server.go | 0 .../{xdg => xdg-go}/scram/server_conv.go | 0 .../{xdg => xdg-go}/stringprep/.gitignore | 0 .../github.com/xdg-go/stringprep/CHANGELOG.md | 22 + vendor/github.com/xdg-go/stringprep/LICENSE | 175 + .../{xdg => xdg-go}/stringprep/README.md | 7 +- .../{xdg => xdg-go}/stringprep/bidi.go | 0 .../{xdg => xdg-go}/stringprep/doc.go | 0 .../{xdg => xdg-go}/stringprep/error.go | 0 vendor/github.com/xdg-go/stringprep/go.mod | 5 + vendor/github.com/xdg-go/stringprep/go.sum | 3 + .../{xdg => xdg-go}/stringprep/map.go | 0 .../{xdg => xdg-go}/stringprep/profile.go | 0 .../{xdg => xdg-go}/stringprep/saslprep.go | 0 .../{xdg => xdg-go}/stringprep/set.go | 0 .../{xdg => xdg-go}/stringprep/tables.go | 0 vendor/github.com/xdg/scram/.travis.yml | 11 - vendor/github.com/xdg/stringprep/.travis.yml | 11 - .../backoff/v3 => youmark/pkcs8}/.gitignore | 1 + vendor/github.com/youmark/pkcs8/.travis.yml | 9 + vendor/github.com/youmark/pkcs8/LICENSE | 21 + vendor/github.com/youmark/pkcs8/README | 1 + vendor/github.com/youmark/pkcs8/README.md | 21 + vendor/github.com/youmark/pkcs8/pkcs8.go | 305 + .../go.mongodb.org/mongo-driver/bson/bson.go | 2 + .../bson/bsoncodec/array_codec.go | 50 + .../mongo-driver/bson/bsoncodec/bsoncodec.go | 53 + .../bson/bsoncodec/byte_slice_codec.go | 54 +- .../bson/bsoncodec/default_value_decoders.go | 990 ++- .../bson/bsoncodec/default_value_encoders.go | 34 +- .../bson/bsoncodec/empty_interface_codec.go | 43 +- .../mongo-driver/bson/bsoncodec/map_codec.go | 139 +- .../bson/bsoncodec/pointer_codec.go | 9 +- .../mongo-driver/bson/bsoncodec/registry.go | 10 +- .../bson/bsoncodec/slice_codec.go | 7 +- .../bson/bsoncodec/string_codec.go | 55 +- .../bson/bsoncodec/struct_codec.go | 187 +- .../bson/bsoncodec/struct_tag_parser.go | 20 + .../mongo-driver/bson/bsoncodec/time_codec.go | 58 +- .../mongo-driver/bson/bsoncodec/types.go | 1 + .../mongo-driver/bson/bsoncodec/uint_codec.go | 81 +- .../bson/bsonoptions/map_codec_options.go | 21 +- .../bson/bsonoptions/struct_codec_options.go | 27 +- .../mongo-driver/bson/bsonrw/copier.go | 60 +- .../bson/bsonrw/extjson_parser.go | 68 + .../bson/bsonrw/extjson_reader.go | 58 +- .../bson/bsonrw/extjson_wrappers.go | 2 +- .../mongo-driver/bson/bsonrw/json_scanner.go | 101 +- .../mongo-driver/bson/bsonrw/value_writer.go | 15 +- .../go.mongodb.org/mongo-driver/bson/doc.go | 46 +- .../mongo-driver/bson/primitive/decimal.go | 49 + .../mongo-driver/bson/primitive/objectid.go | 33 +- .../mongo-driver/bson/primitive/primitive.go | 45 +- .../mongo-driver/bson/raw_value.go | 28 +- .../go.mongodb.org/mongo-driver/event/doc.go | 56 + .../mongo-driver/event/monitoring.go | 90 + .../internal/background_context.go | 34 + .../internal/cancellation_listener.go | 47 + .../mongo-driver/internal/const.go | 5 + .../mongo-driver/internal/string_util.go | 45 + .../internal/uri_validation_errors.go | 18 + .../{x/mongo/driver => mongo}/address/addr.go | 2 +- .../mongo-driver/mongo/bulk_write.go | 106 +- .../mongo-driver/mongo/bulk_write_models.go | 60 + .../mongo-driver/mongo/change_stream.go | 99 +- .../mongo/change_stream_deployment.go | 8 +- .../mongo-driver/mongo/client.go | 285 +- .../mongo-driver/mongo/client_encryption.go | 11 +- .../mongo-driver/mongo/collection.go | 214 +- .../mongo-driver/mongo/cursor.go | 39 +- .../mongo-driver/mongo/database.go | 230 +- .../description/description.go | 2 +- .../driver => mongo}/description/server.go | 221 +- .../description/server_kind.go | 21 +- .../description/server_selector.go | 42 +- .../mongo/description/topology.go | 142 + .../description/topology_kind.go | 3 + .../mongo/description/topology_version.go | 66 + .../description/version_range.go | 11 + .../go.mongodb.org/mongo-driver/mongo/doc.go | 40 +- .../mongo-driver/mongo/errors.go | 272 +- .../mongo/index_options_builder.go | 84 +- .../mongo-driver/mongo/index_view.go | 85 +- .../mongo-driver/mongo/mongo.go | 212 +- .../mongo-driver/mongo/mongocryptd.go | 2 +- .../mongo/options/aggregateoptions.go | 4 +- .../mongo/options/autoencryptionoptions.go | 18 +- .../mongo/options/clientoptions.go | 306 +- .../mongo/options/clientoptions_1_10.go | 4 + .../mongo/options/clientoptions_1_9.go | 11 +- .../mongo/options/countoptions.go | 3 +- .../mongo/options/createcollectionoptions.go | 210 + .../mongo/options/datakeyoptions.go | 33 +- .../mongo/options/deleteoptions.go | 17 + .../mongo-driver/mongo/options/findoptions.go | 132 +- .../mongo/options/gridfsoptions.go | 17 +- .../mongo/options/indexoptions.go | 58 + .../mongo/options/insertoptions.go | 2 +- .../mongo/options/listcollectionsoptions.go | 12 + .../mongo/options/listdatabasesoptions.go | 14 + .../mongo/options/replaceoptions.go | 17 + .../mongo/options/serverapioptions.go | 60 + .../mongo/options/updateoptions.go | 17 + .../mongo-driver/mongo/readpref/mode.go | 32 + .../mongo-driver/mongo/readpref/options.go | 11 + .../mongo-driver/mongo/readpref/readpref.go | 34 +- .../mongo-driver/mongo/results.go | 102 + .../mongo-driver/mongo/session.go | 95 +- vendor/go.mongodb.org/mongo-driver/tag/tag.go | 22 + .../mongo-driver/version/version.go | 2 +- .../mongo-driver/x/bsonx/bsoncore/array.go | 164 + .../x/bsonx/bsoncore/bson_arraybuilder.go | 201 + .../x/bsonx/bsoncore/bson_documentbuilder.go | 189 + .../mongo-driver/x/bsonx/bsoncore/bsoncore.go | 31 +- .../mongo-driver/x/bsonx/bsoncore/document.go | 75 +- .../mongo-driver/x/bsonx/bsoncore/value.go | 43 +- .../x/bsonx/reflectionfree_d_codec.go | 1026 +++ .../mongo-driver/x/mongo/driver/auth/auth.go | 97 +- .../x/mongo/driver/auth/aws_conv.go | 347 + .../x/mongo/driver/auth/conversation.go | 31 + .../x/mongo/driver/auth/default.go | 51 +- .../x/mongo/driver/auth/gssapi.go | 8 +- .../driver/auth/internal/awsv4/credentials.go | 63 + .../x/mongo/driver/auth/internal/awsv4/doc.go | 15 + .../driver/auth/internal/awsv4/request.go | 80 + .../mongo/driver/auth/internal/awsv4/rest.go | 46 + .../mongo/driver/auth/internal/awsv4/rules.go | 98 + .../driver/auth/internal/awsv4/signer.go | 472 + .../auth/internal/gssapi/sspi_wrapper.c | 27 +- .../x/mongo/driver/auth/mongodbaws.go | 76 + .../x/mongo/driver/auth/mongodbcr.go | 15 +- .../mongo-driver/x/mongo/driver/auth/plain.go | 9 +- .../mongo-driver/x/mongo/driver/auth/sasl.go | 132 +- .../mongo-driver/x/mongo/driver/auth/scram.go | 52 +- .../mongo-driver/x/mongo/driver/auth/x509.go | 54 +- .../x/mongo/driver/batch_cursor.go | 118 +- .../x/mongo/driver/connstring/connstring.go | 182 +- .../mongo-driver/x/mongo/driver/crypt.go | 40 +- .../x/mongo/driver/description/feature.go | 36 - .../x/mongo/driver/description/version.go | 44 - .../mongo-driver/x/mongo/driver/dns/dns.go | 5 +- .../mongo-driver/x/mongo/driver/driver.go | 90 +- .../mongo-driver/x/mongo/driver/errors.go | 144 +- .../x/mongo/driver/mongocrypt/mongocrypt.go | 88 +- .../mongocrypt/options/mongocrypt_options.go | 17 +- .../mongocrypt/options/provider_options.go | 46 - .../mongo-driver/x/mongo/driver/ocsp/cache.go | 121 + .../x/mongo/driver/ocsp/config.go | 60 + .../mongo-driver/x/mongo/driver/ocsp/ocsp.go | 353 + .../x/mongo/driver/ocsp/options.go | 13 + .../mongo-driver/x/mongo/driver/operation.go | 308 +- .../driver/operation/abort_transaction.go | 4 +- .../x/mongo/driver/operation/aggregate.go | 19 +- .../x/mongo/driver/operation/command.go | 83 +- .../driver/operation/commit_transaction.go | 4 +- .../x/mongo/driver/operation/count.go | 96 +- .../x/mongo/driver/operation/create.go | 333 + .../x/mongo/driver/operation/create.toml | 62 + .../x/mongo/driver/operation/createIndexes.go | 38 +- .../mongo/driver/operation/createIndexes.toml | 8 + .../x/mongo/driver/operation/delete.go | 41 +- .../x/mongo/driver/operation/delete.toml | 9 + .../x/mongo/driver/operation/distinct.go | 18 +- .../mongo/driver/operation/drop_collection.go | 18 +- .../x/mongo/driver/operation/drop_database.go | 68 +- .../x/mongo/driver/operation/drop_indexes.go | 18 +- .../x/mongo/driver/operation/end_sessions.go | 16 +- .../x/mongo/driver/operation/errors.go | 13 + .../x/mongo/driver/operation/find.go | 36 +- .../x/mongo/driver/operation/find.toml | 5 + .../mongo/driver/operation/find_and_modify.go | 40 +- .../driver/operation/find_and_modify.toml | 5 + .../x/mongo/driver/operation/insert.go | 20 +- .../x/mongo/driver/operation/ismaster.go | 331 +- .../x/mongo/driver/operation/listDatabases.go | 55 +- .../mongo/driver/operation/listDatabases.toml | 6 +- .../driver/operation/list_collections.go | 36 +- .../x/mongo/driver/operation/list_indexes.go | 19 +- .../x/mongo/driver/operation/operation.go | 2 +- .../x/mongo/driver/operation/update.go | 69 +- .../x/mongo/driver/operation/update.toml | 11 +- .../x/mongo/driver/operation_exhaust.go | 38 + .../x/mongo/driver/operation_legacy.go | 55 +- .../x/mongo/driver/serverapioptions.go | 36 + .../x/mongo/driver/session/client_session.go | 164 +- .../x/mongo/driver/session/server_session.go | 21 +- .../x/mongo/driver/session/session_pool.go | 36 +- .../driver/topology/cancellation_listener.go | 14 + .../x/mongo/driver/topology/connection.go | 410 +- .../driver/topology/connection_options.go | 104 +- .../topology.go => topology/diff.go} | 80 +- .../x/mongo/driver/topology/errors.go | 71 +- .../x/mongo/driver/topology/fsm.go | 143 +- .../x/mongo/driver/topology/pool.go | 98 +- .../topology/pool_generation_counter.go | 133 + .../x/mongo/driver/topology/rtt_monitor.go | 165 + .../x/mongo/driver/topology/server.go | 622 +- .../x/mongo/driver/topology/server_options.go | 36 + .../driver/topology/tls_connection_source.go | 36 + .../x/mongo/driver/topology/topology.go | 280 +- .../mongo/driver/topology/topology_options.go | 33 +- .../x/mongo/driver/wiremessage/wiremessage.go | 27 +- vendor/go.opentelemetry.io/otel/.gitignore | 19 + vendor/go.opentelemetry.io/otel/.gitmodules | 3 + vendor/go.opentelemetry.io/otel/.golangci.yml | 32 + vendor/go.opentelemetry.io/otel/CHANGELOG.md | 1188 +++ vendor/go.opentelemetry.io/otel/CODEOWNERS | 17 + .../go.opentelemetry.io/otel/CONTRIBUTING.md | 380 + .../jwt => go.opentelemetry.io/otel}/LICENSE | 0 vendor/go.opentelemetry.io/otel/Makefile | 179 + .../go.opentelemetry.io/otel/Makefile.protos | 129 + vendor/go.opentelemetry.io/otel/README.md | 92 + vendor/go.opentelemetry.io/otel/RELEASING.md | 81 + vendor/go.opentelemetry.io/otel/VERSIONING.md | 217 + .../go.opentelemetry.io/otel/attribute/doc.go | 20 + .../otel/attribute/encoder.go | 150 + .../otel/attribute/iterator.go | 143 + .../go.opentelemetry.io/otel/attribute/key.go | 102 + .../go.opentelemetry.io/otel/attribute/kv.go | 108 + .../go.opentelemetry.io/otel/attribute/set.go | 471 + .../otel/attribute/type_string.go | 28 + .../otel/attribute/value.go | 204 + .../go.opentelemetry.io/otel/codes/codes.go | 106 + vendor/go.opentelemetry.io/otel/codes/doc.go | 25 + vendor/go.opentelemetry.io/otel/doc.go | 38 + .../go.opentelemetry.io/otel/error_handler.go | 22 + .../go.opentelemetry.io/otel/get_main_pkgs.sh | 41 + vendor/go.opentelemetry.io/otel/go.mod | 55 + vendor/go.opentelemetry.io/otel/go.sum | 15 + vendor/go.opentelemetry.io/otel/handler.go | 89 + .../otel/internal/baggage/baggage.go | 338 + .../otel/internal/global/meter.go | 348 + .../otel/internal/global/propagator.go | 82 + .../otel/internal/global/state.go | 143 + .../otel/internal/global/trace.go | 147 + .../otel/internal/rawhelpers.go | 55 + .../otel/internal/trace/noop/noop.go} | 34 +- .../go.opentelemetry.io/otel/metric/LICENSE | 201 + .../go.opentelemetry.io/otel/metric/config.go | 128 + vendor/go.opentelemetry.io/otel/metric/doc.go | 67 + .../otel/metric/global/metric.go | 49 + vendor/go.opentelemetry.io/otel/metric/go.mod | 54 + vendor/go.opentelemetry.io/otel/metric/go.sum | 15 + .../otel/metric/instrumentkind_string.go | 28 + .../go.opentelemetry.io/otel/metric/metric.go | 577 ++ .../otel/metric/metric_instrument.go | 777 ++ .../otel/metric/metric_noop.go | 59 + .../otel/metric/metric_sdkapi.go | 95 + .../otel/metric/number/doc.go | 23 + .../otel/metric/number/kind_string.go | 24 + .../otel/metric/number/number.go | 538 ++ .../otel/metric/registry/doc.go | 24 + .../otel/metric/registry/registry.go | 170 + .../go.opentelemetry.io/otel/pre_release.sh | 95 + .../go.opentelemetry.io/otel/propagation.go | 31 + .../otel/propagation/baggage.go | 111 + .../otel/propagation/doc.go | 28 + .../otel/propagation/propagation.go | 105 + .../otel/propagation/trace_context.go | 171 + vendor/go.opentelemetry.io/otel/tag.sh | 178 + vendor/go.opentelemetry.io/otel/trace.go | 44 + vendor/go.opentelemetry.io/otel/trace/LICENSE | 201 + .../go.opentelemetry.io/otel/trace/config.go | 205 + vendor/go.opentelemetry.io/otel/trace/doc.go | 70 + vendor/go.opentelemetry.io/otel/trace/go.mod | 53 + vendor/go.opentelemetry.io/otel/trace/go.sum | 15 + vendor/go.opentelemetry.io/otel/trace/noop.go | 84 + .../go.opentelemetry.io/otel/trace/trace.go | 689 ++ .../otel/unit/doc.go} | 20 +- vendor/go.opentelemetry.io/otel/unit/unit.go | 23 + .../otel/verify_examples.sh | 85 + vendor/go.opentelemetry.io/otel/version.go | 20 + .../x/crypto/curve25519/curve25519_amd64.go | 3 +- .../x/crypto/curve25519/curve25519_amd64.s | 2 +- .../x/crypto/curve25519/curve25519_noasm.go | 3 +- vendor/golang.org/x/crypto/ed25519/ed25519.go | 1 + .../x/crypto/ed25519/ed25519_go113.go | 1 + vendor/golang.org/x/crypto/ocsp/ocsp.go | 789 ++ vendor/golang.org/x/net/context/go17.go | 1 + vendor/golang.org/x/net/context/go19.go | 1 + vendor/golang.org/x/net/context/pre_go17.go | 1 + vendor/golang.org/x/net/context/pre_go19.go | 1 + .../golang.org/x/net/http/httpguts/httplex.go | 10 +- vendor/golang.org/x/net/http2/Dockerfile | 2 +- vendor/golang.org/x/net/http2/ascii.go | 49 + .../x/net/http2/client_conn_pool.go | 79 +- vendor/golang.org/x/net/http2/go111.go | 1 + vendor/golang.org/x/net/http2/go115.go | 27 + vendor/golang.org/x/net/http2/headermap.go | 7 +- vendor/golang.org/x/net/http2/not_go111.go | 1 + vendor/golang.org/x/net/http2/not_go115.go | 31 + vendor/golang.org/x/net/http2/server.go | 68 +- vendor/golang.org/x/net/http2/transport.go | 108 +- vendor/golang.org/x/net/http2/write.go | 7 +- vendor/golang.org/x/net/idna/idna10.0.0.go | 114 +- vendor/golang.org/x/net/idna/idna9.0.0.go | 94 +- vendor/golang.org/x/net/idna/tables10.0.0.go | 1 + vendor/golang.org/x/net/idna/tables11.0.0.go | 1 + .../idna/{tables12.00.go => tables12.0.0.go} | 3 +- vendor/golang.org/x/net/idna/tables13.0.0.go | 4840 ++++++++++ vendor/golang.org/x/net/idna/tables9.0.0.go | 1 + .../x/net/internal/socket/cmsghdr.go | 3 +- .../x/net/internal/socket/cmsghdr_bsd.go | 1 + .../internal/socket/cmsghdr_linux_32bit.go | 3 +- .../internal/socket/cmsghdr_linux_64bit.go | 1 + .../internal/socket/cmsghdr_solaris_64bit.go | 4 +- .../x/net/internal/socket/cmsghdr_stub.go | 17 +- .../x/net/internal/socket/cmsghdr_unix.go | 22 + .../net/internal/socket/cmsghdr_zos_s390x.go | 25 + .../x/net/internal/socket/error_unix.go | 3 +- .../x/net/internal/socket/iovec_32bit.go | 3 +- .../x/net/internal/socket/iovec_64bit.go | 3 +- .../internal/socket/iovec_solaris_64bit.go | 4 +- .../x/net/internal/socket/iovec_stub.go | 3 +- .../x/net/internal/socket/mmsghdr_stub.go | 1 + .../x/net/internal/socket/mmsghdr_unix.go | 104 +- .../x/net/internal/socket/msghdr_bsd.go | 1 + .../x/net/internal/socket/msghdr_bsdvar.go | 1 + .../x/net/internal/socket/msghdr_linux.go | 3 + .../net/internal/socket/msghdr_linux_32bit.go | 3 +- .../net/internal/socket/msghdr_linux_64bit.go | 1 + .../internal/socket/msghdr_solaris_64bit.go | 4 +- .../x/net/internal/socket/msghdr_stub.go | 3 +- .../x/net/internal/socket/msghdr_zos_s390x.go | 36 + .../x/net/internal/socket/norace.go | 1 + .../golang.org/x/net/internal/socket/race.go | 1 + .../x/net/internal/socket/rawconn.go | 33 +- .../x/net/internal/socket/rawconn_mmsg.go | 17 +- .../x/net/internal/socket/rawconn_msg.go | 11 +- .../x/net/internal/socket/rawconn_nommsg.go | 1 + .../x/net/internal/socket/rawconn_nomsg.go | 3 +- .../x/net/internal/socket/socket.go | 10 +- .../golang.org/x/net/internal/socket/sys.go | 14 +- .../x/net/internal/socket/sys_bsd.go | 1 + .../x/net/internal/socket/sys_bsdvar.go | 23 - .../x/net/internal/socket/sys_const_unix.go | 6 +- .../x/net/internal/socket/sys_dragonfly.go | 32 - .../x/net/internal/socket/sys_linkname.go | 1 + .../x/net/internal/socket/sys_linux.go | 6 +- .../x/net/internal/socket/sys_linux_386.go | 2 - .../{sys_darwin.go => sys_linux_ppc.go} | 7 +- .../net/internal/socket/sys_linux_riscv64.go | 1 + .../x/net/internal/socket/sys_linux_s390x.go | 2 - .../x/net/internal/socket/sys_posix.go | 30 +- .../x/net/internal/socket/sys_solaris.go | 11 - .../x/net/internal/socket/sys_stub.go | 22 +- .../x/net/internal/socket/sys_unix.go | 1 + .../x/net/internal/socket/sys_windows.go | 19 +- ...{sys_go1_11_darwin.go => sys_zos_s390x.go} | 19 +- .../x/net/internal/socket/sys_zos_s390x.s | 11 + .../x/net/internal/socket/zsys_aix_ppc64.go | 26 +- .../x/net/internal/socket/zsys_darwin_386.go | 25 +- .../net/internal/socket/zsys_darwin_amd64.go | 25 +- .../x/net/internal/socket/zsys_darwin_arm.go | 25 +- .../net/internal/socket/zsys_darwin_arm64.go | 25 +- .../internal/socket/zsys_dragonfly_amd64.go | 25 +- .../x/net/internal/socket/zsys_freebsd_386.go | 25 +- .../net/internal/socket/zsys_freebsd_amd64.go | 25 +- .../x/net/internal/socket/zsys_freebsd_arm.go | 25 +- .../net/internal/socket/zsys_freebsd_arm64.go | 25 +- .../x/net/internal/socket/zsys_linux_386.go | 23 +- .../x/net/internal/socket/zsys_linux_amd64.go | 23 +- .../x/net/internal/socket/zsys_linux_arm.go | 20 - .../x/net/internal/socket/zsys_linux_arm64.go | 20 - .../x/net/internal/socket/zsys_linux_mips.go | 20 - .../net/internal/socket/zsys_linux_mips64.go | 20 - .../internal/socket/zsys_linux_mips64le.go | 20 - .../net/internal/socket/zsys_linux_mipsle.go | 20 - .../x/net/internal/socket/zsys_linux_ppc.go | 35 + .../x/net/internal/socket/zsys_linux_ppc64.go | 20 - .../net/internal/socket/zsys_linux_ppc64le.go | 20 - .../net/internal/socket/zsys_linux_riscv64.go | 21 +- .../x/net/internal/socket/zsys_linux_s390x.go | 20 - .../x/net/internal/socket/zsys_netbsd_386.go | 22 - .../net/internal/socket/zsys_netbsd_amd64.go | 22 - .../x/net/internal/socket/zsys_netbsd_arm.go | 22 - .../net/internal/socket/zsys_netbsd_arm64.go | 25 +- .../x/net/internal/socket/zsys_openbsd_386.go | 25 +- .../net/internal/socket/zsys_openbsd_amd64.go | 25 +- .../x/net/internal/socket/zsys_openbsd_arm.go | 25 +- .../net/internal/socket/zsys_openbsd_arm64.go | 25 +- .../internal/socket/zsys_openbsd_mips64.go | 30 + .../net/internal/socket/zsys_solaris_amd64.go | 24 +- .../x/net/internal/socket/zsys_zos_s390x.go | 28 + vendor/golang.org/x/net/ipv4/control_bsd.go | 7 +- .../golang.org/x/net/ipv4/control_pktinfo.go | 5 +- vendor/golang.org/x/net/ipv4/control_stub.go | 3 +- vendor/golang.org/x/net/ipv4/control_unix.go | 5 +- vendor/golang.org/x/net/ipv4/control_zos.go | 88 + vendor/golang.org/x/net/ipv4/header.go | 4 +- vendor/golang.org/x/net/ipv4/icmp_stub.go | 1 + vendor/golang.org/x/net/ipv4/payload_cmsg.go | 3 +- .../golang.org/x/net/ipv4/payload_nocmsg.go | 3 +- vendor/golang.org/x/net/ipv4/sockopt_posix.go | 3 +- vendor/golang.org/x/net/ipv4/sockopt_stub.go | 3 +- vendor/golang.org/x/net/ipv4/sys_aix.go | 34 +- vendor/golang.org/x/net/ipv4/sys_asmreq.go | 1 + .../golang.org/x/net/ipv4/sys_asmreq_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_asmreqn.go | 9 +- .../golang.org/x/net/ipv4/sys_asmreqn_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_bpf.go | 1 + vendor/golang.org/x/net/ipv4/sys_bpf_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_bsd.go | 33 +- vendor/golang.org/x/net/ipv4/sys_darwin.go | 46 +- vendor/golang.org/x/net/ipv4/sys_dragonfly.go | 32 +- vendor/golang.org/x/net/ipv4/sys_freebsd.go | 42 +- vendor/golang.org/x/net/ipv4/sys_linux.go | 35 +- vendor/golang.org/x/net/ipv4/sys_solaris.go | 36 +- vendor/golang.org/x/net/ipv4/sys_ssmreq.go | 1 + .../golang.org/x/net/ipv4/sys_ssmreq_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_stub.go | 3 +- vendor/golang.org/x/net/ipv4/sys_windows.go | 43 +- vendor/golang.org/x/net/ipv4/sys_zos.go | 57 + .../golang.org/x/net/ipv4/zsys_aix_ppc64.go | 18 +- vendor/golang.org/x/net/ipv4/zsys_darwin.go | 40 - .../golang.org/x/net/ipv4/zsys_dragonfly.go | 18 - .../golang.org/x/net/ipv4/zsys_freebsd_386.go | 41 - .../x/net/ipv4/zsys_freebsd_amd64.go | 41 - .../golang.org/x/net/ipv4/zsys_freebsd_arm.go | 41 - .../x/net/ipv4/zsys_freebsd_arm64.go | 41 - .../golang.org/x/net/ipv4/zsys_linux_386.go | 58 - .../golang.org/x/net/ipv4/zsys_linux_amd64.go | 58 - .../golang.org/x/net/ipv4/zsys_linux_arm.go | 58 - .../golang.org/x/net/ipv4/zsys_linux_arm64.go | 58 - .../golang.org/x/net/ipv4/zsys_linux_mips.go | 58 - .../x/net/ipv4/zsys_linux_mips64.go | 58 - .../x/net/ipv4/zsys_linux_mips64le.go | 58 - .../x/net/ipv4/zsys_linux_mipsle.go | 58 - .../golang.org/x/net/ipv4/zsys_linux_ppc.go | 58 - .../golang.org/x/net/ipv4/zsys_linux_ppc64.go | 58 - .../x/net/ipv4/zsys_linux_ppc64le.go | 58 - .../x/net/ipv4/zsys_linux_riscv64.go | 59 +- .../golang.org/x/net/ipv4/zsys_linux_s390x.go | 58 - vendor/golang.org/x/net/ipv4/zsys_netbsd.go | 17 - vendor/golang.org/x/net/ipv4/zsys_openbsd.go | 17 - vendor/golang.org/x/net/ipv4/zsys_solaris.go | 43 - .../golang.org/x/net/ipv4/zsys_zos_s390x.go | 56 + .../x/net/ipv6/control_rfc2292_unix.go | 9 +- .../x/net/ipv6/control_rfc3542_unix.go | 15 +- vendor/golang.org/x/net/ipv6/control_stub.go | 3 +- vendor/golang.org/x/net/ipv6/control_unix.go | 3 +- vendor/golang.org/x/net/ipv6/icmp_bsd.go | 1 + vendor/golang.org/x/net/ipv6/icmp_stub.go | 3 +- vendor/golang.org/x/net/ipv6/icmp_zos.go | 29 + vendor/golang.org/x/net/ipv6/payload_cmsg.go | 3 +- .../golang.org/x/net/ipv6/payload_nocmsg.go | 3 +- vendor/golang.org/x/net/ipv6/sockopt_posix.go | 3 +- vendor/golang.org/x/net/ipv6/sockopt_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_aix.go | 41 +- vendor/golang.org/x/net/ipv6/sys_asmreq.go | 1 + .../golang.org/x/net/ipv6/sys_asmreq_stub.go | 1 + vendor/golang.org/x/net/ipv6/sys_bpf.go | 1 + vendor/golang.org/x/net/ipv6/sys_bpf_stub.go | 1 + vendor/golang.org/x/net/ipv6/sys_bsd.go | 41 +- vendor/golang.org/x/net/ipv6/sys_darwin.go | 48 +- vendor/golang.org/x/net/ipv6/sys_freebsd.go | 48 +- vendor/golang.org/x/net/ipv6/sys_linux.go | 45 +- vendor/golang.org/x/net/ipv6/sys_solaris.go | 48 +- vendor/golang.org/x/net/ipv6/sys_ssmreq.go | 3 +- .../golang.org/x/net/ipv6/sys_ssmreq_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_windows.go | 23 +- vendor/golang.org/x/net/ipv6/sys_zos.go | 72 + .../golang.org/x/net/ipv6/zsys_aix_ppc64.go | 36 +- vendor/golang.org/x/net/ipv6/zsys_darwin.go | 67 - .../golang.org/x/net/ipv6/zsys_dragonfly.go | 46 - .../golang.org/x/net/ipv6/zsys_freebsd_386.go | 58 - .../x/net/ipv6/zsys_freebsd_amd64.go | 58 - .../golang.org/x/net/ipv6/zsys_freebsd_arm.go | 58 - .../x/net/ipv6/zsys_freebsd_arm64.go | 58 - .../golang.org/x/net/ipv6/zsys_linux_386.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_amd64.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_arm.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_arm64.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_mips.go | 80 - .../x/net/ipv6/zsys_linux_mips64.go | 80 - .../x/net/ipv6/zsys_linux_mips64le.go | 80 - .../x/net/ipv6/zsys_linux_mipsle.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_ppc.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_ppc64.go | 80 - .../x/net/ipv6/zsys_linux_ppc64le.go | 80 - .../x/net/ipv6/zsys_linux_riscv64.go | 81 +- .../golang.org/x/net/ipv6/zsys_linux_s390x.go | 80 - vendor/golang.org/x/net/ipv6/zsys_netbsd.go | 42 - vendor/golang.org/x/net/ipv6/zsys_openbsd.go | 51 - vendor/golang.org/x/net/ipv6/zsys_solaris.go | 68 - .../golang.org/x/net/ipv6/zsys_zos_s390x.go | 62 + vendor/golang.org/x/net/websocket/client.go | 106 - vendor/golang.org/x/net/websocket/dial.go | 24 - vendor/golang.org/x/net/websocket/hybi.go | 583 -- vendor/golang.org/x/net/websocket/server.go | 113 - .../golang.org/x/net/websocket/websocket.go | 451 - vendor/golang.org/x/sync/errgroup/errgroup.go | 66 + .../golang.org/x/sync/semaphore/semaphore.go | 11 +- vendor/golang.org/x/sys/unix/aliases.go | 3 +- vendor/golang.org/x/sys/unix/asm_aix_ppc64.s | 2 +- .../unix/{asm_netbsd_386.s => asm_bsd_386.s} | 12 +- .../{asm_openbsd_amd64.s => asm_bsd_amd64.s} | 10 +- .../unix/{asm_netbsd_arm.s => asm_bsd_arm.s} | 10 +- .../{asm_netbsd_amd64.s => asm_bsd_arm64.s} | 10 +- vendor/golang.org/x/sys/unix/asm_darwin_386.s | 29 - .../golang.org/x/sys/unix/asm_darwin_amd64.s | 29 - vendor/golang.org/x/sys/unix/asm_darwin_arm.s | 30 - .../golang.org/x/sys/unix/asm_darwin_arm64.s | 30 - .../x/sys/unix/asm_dragonfly_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_386.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm64.s | 29 - vendor/golang.org/x/sys/unix/asm_linux_386.s | 2 +- .../golang.org/x/sys/unix/asm_linux_amd64.s | 2 +- vendor/golang.org/x/sys/unix/asm_linux_arm.s | 2 +- .../golang.org/x/sys/unix/asm_linux_arm64.s | 2 +- .../golang.org/x/sys/unix/asm_linux_mips64x.s | 2 +- .../golang.org/x/sys/unix/asm_linux_mipsx.s | 2 +- .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 2 +- .../golang.org/x/sys/unix/asm_linux_riscv64.s | 2 +- .../golang.org/x/sys/unix/asm_linux_s390x.s | 2 +- .../golang.org/x/sys/unix/asm_netbsd_arm64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm.s | 29 - ...m_openbsd_arm64.s => asm_openbsd_mips64.s} | 4 +- .../golang.org/x/sys/unix/asm_solaris_amd64.s | 2 +- vendor/golang.org/x/sys/unix/asm_zos_s390x.s | 426 + vendor/golang.org/x/sys/unix/cap_freebsd.go | 1 + vendor/golang.org/x/sys/unix/constants.go | 3 +- vendor/golang.org/x/sys/unix/dev_aix_ppc.go | 4 +- vendor/golang.org/x/sys/unix/dev_aix_ppc64.go | 4 +- vendor/golang.org/x/sys/unix/dev_zos.go | 29 + vendor/golang.org/x/sys/unix/dirent.go | 1 + vendor/golang.org/x/sys/unix/endian_big.go | 3 +- vendor/golang.org/x/sys/unix/endian_little.go | 3 +- vendor/golang.org/x/sys/unix/env_unix.go | 3 +- vendor/golang.org/x/sys/unix/epoll_zos.go | 221 + vendor/golang.org/x/sys/unix/fcntl.go | 1 + vendor/golang.org/x/sys/unix/fcntl_darwin.go | 6 + .../x/sys/unix/fcntl_linux_32bit.go | 5 +- vendor/golang.org/x/sys/unix/fdset.go | 1 + vendor/golang.org/x/sys/unix/fstatfs_zos.go | 164 + vendor/golang.org/x/sys/unix/gccgo.go | 6 +- vendor/golang.org/x/sys/unix/gccgo_c.c | 6 + .../x/sys/unix/gccgo_linux_amd64.go | 1 + vendor/golang.org/x/sys/unix/ioctl.go | 10 + vendor/golang.org/x/sys/unix/ioctl_linux.go | 196 + vendor/golang.org/x/sys/unix/ioctl_zos.go | 74 + vendor/golang.org/x/sys/unix/mkall.sh | 17 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 59 +- vendor/golang.org/x/sys/unix/pagesize_unix.go | 1 + vendor/golang.org/x/sys/unix/ptrace_darwin.go | 12 + vendor/golang.org/x/sys/unix/ptrace_ios.go | 12 + vendor/golang.org/x/sys/unix/race.go | 1 + vendor/golang.org/x/sys/unix/race0.go | 3 +- .../x/sys/unix/readdirent_getdents.go | 1 + .../x/sys/unix/readdirent_getdirentries.go | 1 + vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 3 +- .../x/sys/unix/sockcmsg_unix_other.go | 13 +- vendor/golang.org/x/sys/unix/str.go | 1 + vendor/golang.org/x/sys/unix/syscall.go | 46 +- vendor/golang.org/x/sys/unix/syscall_aix.go | 29 +- .../golang.org/x/sys/unix/syscall_aix_ppc.go | 4 +- .../x/sys/unix/syscall_aix_ppc64.go | 4 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 45 +- .../x/sys/unix/syscall_darwin.1_12.go | 5 +- .../x/sys/unix/syscall_darwin.1_13.go | 2 +- .../golang.org/x/sys/unix/syscall_darwin.go | 176 +- .../x/sys/unix/syscall_darwin_386.1_11.go | 9 - .../x/sys/unix/syscall_darwin_386.go | 12 +- .../x/sys/unix/syscall_darwin_amd64.1_11.go | 9 - .../x/sys/unix/syscall_darwin_amd64.go | 12 +- .../x/sys/unix/syscall_darwin_arm.1_11.go | 11 - .../x/sys/unix/syscall_darwin_arm.go | 10 +- .../x/sys/unix/syscall_darwin_arm64.1_11.go | 11 - .../x/sys/unix/syscall_darwin_arm64.go | 14 +- .../x/sys/unix/syscall_darwin_libSystem.go | 1 + .../x/sys/unix/syscall_dragonfly.go | 40 +- .../x/sys/unix/syscall_dragonfly_amd64.go | 1 + .../golang.org/x/sys/unix/syscall_freebsd.go | 36 +- .../x/sys/unix/syscall_freebsd_386.go | 1 + .../x/sys/unix/syscall_freebsd_amd64.go | 1 + .../x/sys/unix/syscall_freebsd_arm.go | 1 + .../x/sys/unix/syscall_freebsd_arm64.go | 1 + .../golang.org/x/sys/unix/syscall_illumos.go | 82 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 255 +- .../x/sys/unix/syscall_linux_386.go | 10 +- .../x/sys/unix/syscall_linux_amd64.go | 3 +- .../x/sys/unix/syscall_linux_amd64_gc.go | 4 +- .../x/sys/unix/syscall_linux_arm.go | 16 +- .../x/sys/unix/syscall_linux_arm64.go | 3 +- .../golang.org/x/sys/unix/syscall_linux_gc.go | 3 +- .../x/sys/unix/syscall_linux_gc_386.go | 3 +- .../x/sys/unix/syscall_linux_gc_arm.go | 14 + .../x/sys/unix/syscall_linux_gccgo_386.go | 1 + .../x/sys/unix/syscall_linux_gccgo_arm.go | 1 + .../x/sys/unix/syscall_linux_mips64x.go | 3 +- .../x/sys/unix/syscall_linux_mipsx.go | 9 +- .../x/sys/unix/syscall_linux_ppc.go | 272 + .../x/sys/unix/syscall_linux_ppc64x.go | 5 +- .../x/sys/unix/syscall_linux_riscv64.go | 3 +- .../x/sys/unix/syscall_linux_s390x.go | 5 +- .../x/sys/unix/syscall_linux_sparc64.go | 5 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 40 +- .../x/sys/unix/syscall_netbsd_386.go | 1 + .../x/sys/unix/syscall_netbsd_amd64.go | 1 + .../x/sys/unix/syscall_netbsd_arm.go | 1 + .../x/sys/unix/syscall_netbsd_arm64.go | 1 + .../golang.org/x/sys/unix/syscall_openbsd.go | 23 +- .../x/sys/unix/syscall_openbsd_386.go | 1 + .../x/sys/unix/syscall_openbsd_amd64.go | 1 + .../x/sys/unix/syscall_openbsd_arm.go | 1 + .../x/sys/unix/syscall_openbsd_arm64.go | 1 + .../x/sys/unix/syscall_openbsd_mips64.go | 35 + .../golang.org/x/sys/unix/syscall_solaris.go | 30 +- .../x/sys/unix/syscall_solaris_amd64.go | 1 + vendor/golang.org/x/sys/unix/syscall_unix.go | 1 + .../golang.org/x/sys/unix/syscall_unix_gc.go | 5 +- .../x/sys/unix/syscall_unix_gc_ppc64x.go | 3 +- .../x/sys/unix/syscall_zos_s390x.go | 1781 ++++ vendor/golang.org/x/sys/unix/timestruct.go | 29 +- vendor/golang.org/x/sys/unix/xattr_bsd.go | 1 + .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1 + .../x/sys/unix/zerrors_aix_ppc64.go | 1 + .../x/sys/unix/zerrors_darwin_386.go | 5 + .../x/sys/unix/zerrors_darwin_amd64.go | 92 +- .../x/sys/unix/zerrors_darwin_arm.go | 5 + .../x/sys/unix/zerrors_darwin_arm64.go | 92 +- .../x/sys/unix/zerrors_dragonfly_amd64.go | 139 +- .../x/sys/unix/zerrors_freebsd_386.go | 13 + .../x/sys/unix/zerrors_freebsd_amd64.go | 13 + .../x/sys/unix/zerrors_freebsd_arm.go | 22 + .../x/sys/unix/zerrors_freebsd_arm64.go | 13 + vendor/golang.org/x/sys/unix/zerrors_linux.go | 401 +- .../x/sys/unix/zerrors_linux_386.go | 16 +- .../x/sys/unix/zerrors_linux_amd64.go | 16 +- .../x/sys/unix/zerrors_linux_arm.go | 16 +- .../x/sys/unix/zerrors_linux_arm64.go | 20 +- .../x/sys/unix/zerrors_linux_mips.go | 16 +- .../x/sys/unix/zerrors_linux_mips64.go | 16 +- .../x/sys/unix/zerrors_linux_mips64le.go | 16 +- .../x/sys/unix/zerrors_linux_mipsle.go | 16 +- .../x/sys/unix/zerrors_linux_ppc.go | 860 ++ .../x/sys/unix/zerrors_linux_ppc64.go | 16 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 16 +- .../x/sys/unix/zerrors_linux_riscv64.go | 16 +- .../x/sys/unix/zerrors_linux_s390x.go | 16 +- .../x/sys/unix/zerrors_linux_sparc64.go | 16 +- .../x/sys/unix/zerrors_netbsd_386.go | 7 + .../x/sys/unix/zerrors_netbsd_amd64.go | 7 + .../x/sys/unix/zerrors_netbsd_arm.go | 7 + .../x/sys/unix/zerrors_netbsd_arm64.go | 7 + .../x/sys/unix/zerrors_openbsd_386.go | 8 + .../x/sys/unix/zerrors_openbsd_amd64.go | 8 + .../x/sys/unix/zerrors_openbsd_arm.go | 8 + .../x/sys/unix/zerrors_openbsd_arm64.go | 8 + .../x/sys/unix/zerrors_openbsd_mips64.go | 1863 ++++ .../x/sys/unix/zerrors_solaris_amd64.go | 26 +- .../x/sys/unix/zerrors_zos_s390x.go | 838 ++ .../x/sys/unix/zptrace_armnn_linux.go | 1 + .../x/sys/unix/zptrace_mipsnn_linux.go | 1 + .../x/sys/unix/zptrace_mipsnnle_linux.go | 1 + .../x/sys/unix/zptrace_x86_linux.go | 1 + .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1 + .../x/sys/unix/zsyscall_aix_ppc64.go | 1 + .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 4 +- .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 4 +- .../x/sys/unix/zsyscall_darwin_386.1_11.go | 1809 ---- .../x/sys/unix/zsyscall_darwin_386.1_13.go | 3 +- .../x/sys/unix/zsyscall_darwin_386.go | 276 +- .../x/sys/unix/zsyscall_darwin_386.s | 18 +- .../x/sys/unix/zsyscall_darwin_amd64.1_11.go | 1809 ---- .../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 3 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 276 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 18 +- .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 1782 ---- .../x/sys/unix/zsyscall_darwin_arm.1_13.go | 3 +- .../x/sys/unix/zsyscall_darwin_arm.go | 247 +- .../x/sys/unix/zsyscall_darwin_arm.s | 14 +- .../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 3 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 261 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 16 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 45 +- .../x/sys/unix/zsyscall_freebsd_386.go | 1 + .../x/sys/unix/zsyscall_freebsd_amd64.go | 1 + .../x/sys/unix/zsyscall_freebsd_arm.go | 1 + .../x/sys/unix/zsyscall_freebsd_arm64.go | 1 + .../x/sys/unix/zsyscall_illumos_amd64.go | 43 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 88 + .../x/sys/unix/zsyscall_linux_386.go | 1 + .../x/sys/unix/zsyscall_linux_amd64.go | 1 + .../x/sys/unix/zsyscall_linux_arm.go | 1 + .../x/sys/unix/zsyscall_linux_arm64.go | 1 + .../x/sys/unix/zsyscall_linux_mips.go | 1 + .../x/sys/unix/zsyscall_linux_mips64.go | 1 + .../x/sys/unix/zsyscall_linux_mips64le.go | 1 + .../x/sys/unix/zsyscall_linux_mipsle.go | 1 + .../x/sys/unix/zsyscall_linux_ppc.go | 762 ++ .../x/sys/unix/zsyscall_linux_ppc64.go | 1 + .../x/sys/unix/zsyscall_linux_ppc64le.go | 1 + .../x/sys/unix/zsyscall_linux_riscv64.go | 1 + .../x/sys/unix/zsyscall_linux_s390x.go | 1 + .../x/sys/unix/zsyscall_linux_sparc64.go | 1 + .../x/sys/unix/zsyscall_netbsd_386.go | 11 + .../x/sys/unix/zsyscall_netbsd_amd64.go | 11 + .../x/sys/unix/zsyscall_netbsd_arm.go | 11 + .../x/sys/unix/zsyscall_netbsd_arm64.go | 11 + .../x/sys/unix/zsyscall_openbsd_386.go | 1 + .../x/sys/unix/zsyscall_openbsd_amd64.go | 1 + .../x/sys/unix/zsyscall_openbsd_arm.go | 1 + .../x/sys/unix/zsyscall_openbsd_arm64.go | 1 + ...m64.1_11.go => zsyscall_openbsd_mips64.go} | 497 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 33 +- .../x/sys/unix/zsyscall_zos_s390x.go | 1217 +++ .../x/sys/unix/zsysctl_openbsd_386.go | 1 + .../x/sys/unix/zsysctl_openbsd_amd64.go | 1 + .../x/sys/unix/zsysctl_openbsd_arm.go | 1 + .../x/sys/unix/zsysctl_openbsd_arm64.go | 1 + .../x/sys/unix/zsysctl_openbsd_mips64.go | 280 + .../x/sys/unix/zsysnum_darwin_386.go | 2 + .../x/sys/unix/zsysnum_darwin_amd64.go | 2 + .../x/sys/unix/zsysnum_darwin_arm.go | 2 + .../x/sys/unix/zsysnum_darwin_arm64.go | 2 + .../x/sys/unix/zsysnum_dragonfly_amd64.go | 256 +- .../x/sys/unix/zsysnum_freebsd_386.go | 1 + .../x/sys/unix/zsysnum_freebsd_amd64.go | 1 + .../x/sys/unix/zsysnum_freebsd_arm.go | 1 + .../x/sys/unix/zsysnum_freebsd_arm64.go | 1 + .../x/sys/unix/zsysnum_linux_386.go | 5 + .../x/sys/unix/zsysnum_linux_amd64.go | 5 + .../x/sys/unix/zsysnum_linux_arm.go | 5 + .../x/sys/unix/zsysnum_linux_arm64.go | 5 + .../x/sys/unix/zsysnum_linux_mips.go | 5 + .../x/sys/unix/zsysnum_linux_mips64.go | 5 + .../x/sys/unix/zsysnum_linux_mips64le.go | 5 + .../x/sys/unix/zsysnum_linux_mipsle.go | 5 + .../x/sys/unix/zsysnum_linux_ppc.go | 433 + .../x/sys/unix/zsysnum_linux_ppc64.go | 5 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 5 + .../x/sys/unix/zsysnum_linux_riscv64.go | 5 + .../x/sys/unix/zsysnum_linux_s390x.go | 5 + .../x/sys/unix/zsysnum_linux_sparc64.go | 5 + .../x/sys/unix/zsysnum_netbsd_386.go | 1 + .../x/sys/unix/zsysnum_netbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_netbsd_arm.go | 1 + .../x/sys/unix/zsysnum_netbsd_arm64.go | 1 + .../x/sys/unix/zsysnum_openbsd_386.go | 1 + .../x/sys/unix/zsysnum_openbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm64.go | 1 + .../x/sys/unix/zsysnum_openbsd_mips64.go | 221 + .../x/sys/unix/zsysnum_zos_s390x.go | 2670 ++++++ .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 2 + .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 2 + .../x/sys/unix/ztypes_darwin_386.go | 41 +- .../x/sys/unix/ztypes_darwin_amd64.go | 60 +- .../x/sys/unix/ztypes_darwin_arm.go | 48 +- .../x/sys/unix/ztypes_darwin_arm64.go | 60 +- .../x/sys/unix/ztypes_dragonfly_amd64.go | 48 +- .../x/sys/unix/ztypes_freebsd_386.go | 11 + .../x/sys/unix/ztypes_freebsd_amd64.go | 11 + .../x/sys/unix/ztypes_freebsd_arm.go | 23 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 11 + .../x/sys/unix/ztypes_illumos_amd64.go | 40 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 2602 ++++-- .../golang.org/x/sys/unix/ztypes_linux_386.go | 23 +- .../x/sys/unix/ztypes_linux_amd64.go | 26 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 26 +- .../x/sys/unix/ztypes_linux_arm64.go | 26 +- .../x/sys/unix/ztypes_linux_mips.go | 26 +- .../x/sys/unix/ztypes_linux_mips64.go | 26 +- .../x/sys/unix/ztypes_linux_mips64le.go | 26 +- .../x/sys/unix/ztypes_linux_mipsle.go | 26 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 627 ++ .../x/sys/unix/ztypes_linux_ppc64.go | 26 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 26 +- .../x/sys/unix/ztypes_linux_riscv64.go | 26 +- .../x/sys/unix/ztypes_linux_s390x.go | 26 +- .../x/sys/unix/ztypes_linux_sparc64.go | 26 +- .../x/sys/unix/ztypes_netbsd_386.go | 2 + .../x/sys/unix/ztypes_netbsd_amd64.go | 2 + .../x/sys/unix/ztypes_netbsd_arm.go | 2 + .../x/sys/unix/ztypes_netbsd_arm64.go | 2 + .../x/sys/unix/ztypes_openbsd_386.go | 2 + .../x/sys/unix/ztypes_openbsd_amd64.go | 2 + .../x/sys/unix/ztypes_openbsd_arm.go | 2 + .../x/sys/unix/ztypes_openbsd_arm64.go | 2 + .../x/sys/unix/ztypes_openbsd_mips64.go | 567 ++ .../x/sys/unix/ztypes_solaris_amd64.go | 33 +- .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 402 + .../golang.org/x/sys/windows/dll_windows.go | 3 +- .../golang.org/x/sys/windows/exec_windows.go | 35 + .../x/sys/windows/memory_windows.go | 20 +- vendor/golang.org/x/sys/windows/mkerrors.bash | 7 + .../x/sys/windows/security_windows.go | 43 +- vendor/golang.org/x/sys/windows/service.go | 8 + .../x/sys/windows/setupapierrors_windows.go | 100 + vendor/golang.org/x/sys/windows/syscall.go | 46 +- .../x/sys/windows/syscall_windows.go | 262 +- .../golang.org/x/sys/windows/types_windows.go | 1052 ++- .../x/sys/windows/types_windows_386.go | 13 + .../x/sys/windows/types_windows_amd64.go | 12 + .../x/sys/windows/types_windows_arm.go | 13 + .../x/sys/windows/types_windows_arm64.go | 34 + .../x/sys/windows/zerrors_windows.go | 2619 +++++- .../x/sys/windows/zsyscall_windows.go | 5029 +++++------ .../x/text/secure/bidirule/bidirule10.0.0.go | 1 + .../x/text/secure/bidirule/bidirule9.0.0.go | 1 + vendor/golang.org/x/text/unicode/bidi/bidi.go | 221 +- vendor/golang.org/x/text/unicode/bidi/core.go | 63 +- .../x/text/unicode/bidi/tables10.0.0.go | 1 + .../x/text/unicode/bidi/tables11.0.0.go | 1 + .../x/text/unicode/bidi/tables12.0.0.go | 3 +- .../x/text/unicode/bidi/tables13.0.0.go | 1956 +++++ .../x/text/unicode/bidi/tables9.0.0.go | 1 + .../x/text/unicode/norm/tables10.0.0.go | 1 + .../x/text/unicode/norm/tables11.0.0.go | 1 + .../x/text/unicode/norm/tables12.0.0.go | 3 +- .../x/text/unicode/norm/tables13.0.0.go | 7761 +++++++++++++++++ .../x/text/unicode/norm/tables9.0.0.go | 1 + vendor/golang.org/x/time/rate/rate.go | 12 +- vendor/gonum.org/v1/gonum/AUTHORS | 17 +- vendor/gonum.org/v1/gonum/CONTRIBUTORS | 18 +- vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go | 53 +- vendor/gonum.org/v1/gonum/blas/gonum/gonum.go | 6 - .../v1/gonum/blas/gonum/level3cmplx128.go | 23 +- .../v1/gonum/blas/gonum/level3cmplx64.go | 23 +- .../v1/gonum/blas/gonum/level3float32.go | 97 +- .../v1/gonum/blas/gonum/level3float64.go | 97 +- vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go | 53 +- vendor/gonum.org/v1/gonum/floats/floats.go | 374 +- .../gonum.org/v1/gonum/floats/scalar/doc.go | 6 + .../v1/gonum/floats/scalar/scalar.go | 192 + .../gonum/internal/asm/c128/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/c128/axpyincto_amd64.s | 2 +- .../internal/asm/c128/axpyunitary_amd64.s | 2 +- .../internal/asm/c128/axpyunitaryto_amd64.s | 2 +- .../gonum/internal/asm/c128/dotcinc_amd64.s | 2 +- .../internal/asm/c128/dotcunitary_amd64.s | 2 +- .../gonum/internal/asm/c128/dotuinc_amd64.s | 2 +- .../internal/asm/c128/dotuunitary_amd64.s | 2 +- .../gonum/internal/asm/c128/dscalinc_amd64.s | 2 +- .../internal/asm/c128/dscalunitary_amd64.s | 2 +- .../internal/asm/c128/scalUnitary_amd64.s | 2 +- .../gonum/internal/asm/c128/scalinc_amd64.s | 2 +- .../v1/gonum/internal/asm/c128/stubs.go | 172 + .../v1/gonum/internal/asm/c128/stubs_amd64.go | 2 +- .../v1/gonum/internal/asm/c128/stubs_noasm.go | 2 +- .../v1/gonum/internal/asm/c64/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/c64/axpyincto_amd64.s | 2 +- .../internal/asm/c64/axpyunitary_amd64.s | 2 +- .../internal/asm/c64/axpyunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/c64/dotcinc_amd64.s | 2 +- .../internal/asm/c64/dotcunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/c64/dotuinc_amd64.s | 2 +- .../internal/asm/c64/dotuunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/c64/stubs.go | 172 + .../v1/gonum/internal/asm/c64/stubs_amd64.go | 2 +- .../v1/gonum/internal/asm/c64/stubs_noasm.go | 2 +- .../v1/gonum/internal/asm/f32/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/f32/axpyincto_amd64.s | 2 +- .../internal/asm/f32/axpyunitary_amd64.s | 2 +- .../internal/asm/f32/axpyunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/ddotinc_amd64.s | 2 +- .../internal/asm/f32/ddotunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/dotinc_amd64.s | 2 +- .../gonum/internal/asm/f32/dotunitary_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/ge_amd64.go | 2 +- .../v1/gonum/internal/asm/f32/ge_amd64.s | 2 +- .../v1/gonum/internal/asm/f32/ge_noasm.go | 2 +- .../v1/gonum/internal/asm/f32/stubs_amd64.go | 10 +- .../v1/gonum/internal/asm/f32/stubs_noasm.go | 16 +- .../v1/gonum/internal/asm/f32/sum_amd64.s | 100 + .../v1/gonum/internal/asm/f64/abssum_amd64.s | 2 +- .../gonum/internal/asm/f64/abssuminc_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/add_amd64.s | 2 +- .../gonum/internal/asm/f64/addconst_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/axpy.go | 2 +- .../v1/gonum/internal/asm/f64/axpyinc_amd64.s | 2 +- .../gonum/internal/asm/f64/axpyincto_amd64.s | 2 +- .../internal/asm/f64/axpyunitary_amd64.s | 2 +- .../internal/asm/f64/axpyunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/cumprod_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/cumsum_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/div_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/divto_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/dot.go | 2 +- .../v1/gonum/internal/asm/f64/dot_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/ge_amd64.go | 2 +- .../v1/gonum/internal/asm/f64/ge_noasm.go | 2 +- .../v1/gonum/internal/asm/f64/gemvN_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/gemvT_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/ger_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/l1norm_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/l2norm_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/l2norm_noasm.go | 2 +- .../gonum/internal/asm/f64/l2normdist_amd64.s | 2 +- .../gonum/internal/asm/f64/l2norminc_amd64.s | 2 +- .../gonum/internal/asm/f64/linfnorm_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/scal.go | 2 +- .../v1/gonum/internal/asm/f64/scalinc_amd64.s | 2 +- .../gonum/internal/asm/f64/scalincto_amd64.s | 2 +- .../internal/asm/f64/scalunitary_amd64.s | 2 +- .../internal/asm/f64/scalunitaryto_amd64.s | 2 +- .../v1/gonum/internal/asm/f64/stubs_amd64.go | 2 +- .../v1/gonum/internal/asm/f64/stubs_noasm.go | 2 +- .../v1/gonum/internal/asm/f64/sum_amd64.s | 41 +- .../v1/gonum/internal/math32/sqrt.go | 2 +- .../v1/gonum/internal/math32/sqrt_amd64.go | 2 +- .../v1/gonum/internal/math32/sqrt_amd64.s | 2 +- .../v1/gonum/internal/math32/sqrt_arm64.go | 2 +- .../v1/gonum/internal/math32/sqrt_arm64.s | 2 +- .../v1/gonum/lapack/gonum/dcombssq.go | 7 +- .../gonum.org/v1/gonum/lapack/gonum/dgtsv.go | 99 + .../gonum.org/v1/gonum/lapack/gonum/dlacpy.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dlagtm.go | 109 + .../gonum.org/v1/gonum/lapack/gonum/dlangt.go | 115 + .../gonum.org/v1/gonum/lapack/gonum/dlantb.go | 213 + .../gonum.org/v1/gonum/lapack/gonum/dlanv2.go | 17 + vendor/gonum.org/v1/gonum/lapack/gonum/doc.go | 2 +- .../gonum.org/v1/gonum/lapack/gonum/dtbtrs.go | 75 + .../gonum.org/v1/gonum/lapack/gonum/errors.go | 2 + .../gonum.org/v1/gonum/lapack/gonum/ilaenv.go | 4 +- vendor/gonum.org/v1/gonum/lapack/lapack.go | 4 + .../v1/gonum/lapack/lapack64/lapack64.go | 129 +- vendor/gonum.org/v1/gonum/mat/band.go | 4 +- vendor/gonum.org/v1/gonum/mat/cdense.go | 176 +- vendor/gonum.org/v1/gonum/mat/cholesky.go | 269 +- vendor/gonum.org/v1/gonum/mat/cmatrix.go | 165 +- vendor/gonum.org/v1/gonum/mat/dense.go | 4 +- .../v1/gonum/mat/dense_arithmetic.go | 55 +- vendor/gonum.org/v1/gonum/mat/doc.go | 33 +- vendor/gonum.org/v1/gonum/mat/errors.go | 5 +- vendor/gonum.org/v1/gonum/mat/format.go | 286 +- vendor/gonum.org/v1/gonum/mat/matrix.go | 26 +- vendor/gonum.org/v1/gonum/mat/offset.go | 2 +- .../v1/gonum/mat/offset_appengine.go | 2 +- vendor/gonum.org/v1/gonum/mat/pool.go | 35 + .../gonum.org/v1/gonum/mat/shadow_complex.go | 4 +- vendor/gonum.org/v1/gonum/mat/solve.go | 46 +- vendor/gonum.org/v1/gonum/mat/svd.go | 166 +- vendor/gonum.org/v1/gonum/mat/symband.go | 4 +- vendor/gonum.org/v1/gonum/mat/symmetric.go | 13 +- vendor/gonum.org/v1/gonum/mat/triangular.go | 40 +- vendor/gonum.org/v1/gonum/mat/triband.go | 211 +- vendor/gonum.org/v1/gonum/mat/vector.go | 42 +- vendor/gonum.org/v1/gonum/stat/roc.go | 26 +- vendor/gonum.org/v1/gonum/stat/stat.go | 57 +- vendor/google.golang.org/grpc/.travis.yml | 6 +- vendor/google.golang.org/grpc/CONTRIBUTING.md | 1 - vendor/google.golang.org/grpc/Makefile | 31 +- vendor/google.golang.org/grpc/README.md | 123 +- vendor/google.golang.org/grpc/SECURITY.md | 3 + .../grpc/attributes/attributes.go | 5 +- vendor/google.golang.org/grpc/backoff.go | 5 +- .../grpc/balancer/balancer.go | 14 +- .../grpc/balancer/base/balancer.go | 48 +- .../grpc/balancer/base/base.go | 11 - .../grpc/balancer/roundrobin/roundrobin.go | 4 +- .../grpc/balancer_conn_wrappers.go | 2 +- .../grpc_binarylog_v1/binarylog.pb.go | 1249 ++- vendor/google.golang.org/grpc/clientconn.go | 174 +- vendor/google.golang.org/grpc/codes/codes.go | 46 + .../grpc/connectivity/connectivity.go | 16 +- .../grpc/credentials/credentials.go | 19 +- .../google.golang.org/grpc/credentials/tls.go | 68 +- vendor/google.golang.org/grpc/dialoptions.go | 63 +- .../grpc/encoding/encoding.go | 12 +- .../grpc/encoding/proto/proto.go | 70 +- vendor/google.golang.org/grpc/go.mod | 12 +- vendor/google.golang.org/grpc/go.sum | 59 +- .../grpc/grpclog/component.go | 117 + .../grpc/grpclog/loggerv2.go | 9 +- vendor/google.golang.org/grpc/install_gae.sh | 2 +- vendor/google.golang.org/grpc/interceptor.go | 36 +- .../grpc/internal/binarylog/binarylog.go | 4 +- .../grpc/internal/binarylog/env_config.go | 4 +- .../grpc/internal/binarylog/method_logger.go | 15 +- .../grpc/internal/binarylog/sink.go | 71 +- .../grpc/internal/channelz/funcs.go | 20 +- .../grpc/internal/channelz/logging.go | 56 +- .../grpc/internal/channelz/types.go | 33 +- .../grpc/internal/channelz/types_nonlinux.go | 4 +- .../grpc/internal/credentials/spiffe.go | 77 + .../spiffe_appengine.go} | 35 +- .../credentials}/syscallconn.go | 3 +- .../credentials}/syscallconn_appengine.go | 2 +- .../grpc/internal/credentials/util.go | 50 + .../grpc/internal/grpclog/grpclog.go | 18 +- .../grpc/internal/grpclog/prefixLogger.go | 32 +- .../grpc/internal/grpcutil/encode_duration.go | 63 + .../grpc/internal/grpcutil/metadata.go | 40 + .../grpc/internal/grpcutil/method.go | 44 + .../grpc/internal/grpcutil/target.go | 42 +- .../grpc/internal/internal.go | 13 + .../grpc/internal/metadata/metadata.go | 50 + .../grpc/internal/resolver/config_selector.go | 95 + .../internal/resolver/dns/dns_resolver.go | 10 +- .../grpc/internal/resolver/unix/unix.go | 63 + .../internal/serviceconfig/serviceconfig.go | 82 +- .../grpc/internal/syscall/syscall_linux.go | 26 +- .../grpc/internal/syscall/syscall_nonlinux.go | 5 +- .../grpc/internal/transport/controlbuf.go | 12 +- .../grpc/internal/transport/handler_server.go | 3 +- .../grpc/internal/transport/http2_client.go | 105 +- .../grpc/internal/transport/http2_server.go | 58 +- .../grpc/internal/transport/http_util.go | 136 +- .../transport/networktype/networktype.go | 46 + .../grpc/{ => internal/transport}/proxy.go | 52 +- .../grpc/internal/transport/transport.go | 4 + .../google.golang.org/grpc/picker_wrapper.go | 5 +- vendor/google.golang.org/grpc/pickfirst.go | 17 +- vendor/google.golang.org/grpc/preloader.go | 5 +- vendor/google.golang.org/grpc/regenerate.sh | 70 +- .../grpc/resolver/resolver.go | 6 +- .../grpc/resolver_conn_wrapper.go | 16 +- vendor/google.golang.org/grpc/rpc_util.go | 126 +- vendor/google.golang.org/grpc/server.go | 207 +- .../google.golang.org/grpc/service_config.go | 128 +- .../grpc/serviceconfig/serviceconfig.go | 5 +- .../google.golang.org/grpc/status/status.go | 8 +- vendor/google.golang.org/grpc/stream.go | 57 +- vendor/google.golang.org/grpc/tap/tap.go | 7 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/vet.sh | 47 +- .../protobuf/encoding/prototext/decode.go | 65 +- .../protobuf/encoding/prototext/encode.go | 12 +- .../protobuf/internal/fieldnum/any_gen.go | 13 - .../protobuf/internal/fieldnum/api_gen.go | 35 - .../internal/fieldnum/descriptor_gen.go | 240 - .../protobuf/internal/fieldnum/doc.go | 7 - .../internal/fieldnum/duration_gen.go | 13 - .../protobuf/internal/fieldnum/empty_gen.go | 10 - .../internal/fieldnum/field_mask_gen.go | 12 - .../internal/fieldnum/source_context_gen.go | 12 - .../protobuf/internal/fieldnum/struct_gen.go | 33 - .../internal/fieldnum/timestamp_gen.go | 13 - .../protobuf/internal/fieldnum/type_gen.go | 53 - .../internal/fieldnum/wrappers_gen.go | 52 - .../protobuf/internal/filedesc/build.go | 16 +- .../protobuf/internal/filedesc/desc.go | 5 +- .../protobuf/internal/filedesc/desc_init.go | 62 +- .../protobuf/internal/filedesc/desc_lazy.go | 124 +- .../protobuf/internal/filedesc/desc_list.go | 6 +- .../protobuf/internal/genid/any_gen.go | 34 + .../protobuf/internal/genid/api_gen.go | 106 + .../protobuf/internal/genid/descriptor_gen.go | 829 ++ .../protobuf/internal/genid/doc.go | 11 + .../protobuf/internal/genid/duration_gen.go | 34 + .../protobuf/internal/genid/empty_gen.go | 19 + .../protobuf/internal/genid/field_mask_gen.go | 31 + .../protobuf/internal/genid/goname.go | 25 + .../protobuf/internal/genid/map_entry.go | 16 + .../internal/genid/source_context_gen.go | 31 + .../protobuf/internal/genid/struct_gen.go | 116 + .../protobuf/internal/genid/timestamp_gen.go | 34 + .../protobuf/internal/genid/type_gen.go | 184 + .../protobuf/internal/genid/wrappers.go | 13 + .../protobuf/internal/genid/wrappers_gen.go | 175 + .../protobuf/internal/genname/name.go | 25 - .../protobuf/internal/impl/api_export.go | 7 + .../protobuf/internal/impl/codec_map.go | 5 +- .../protobuf/internal/impl/message.go | 10 +- .../protobuf/internal/impl/validate.go | 5 +- .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 5 +- .../protobuf/reflect/protoreflect/proto.go | 50 +- .../protobuf/types/known/anypb/any.pb.go | 207 + .../types/known/durationpb/duration.pb.go | 130 + .../types/known/timestamppb/timestamp.pb.go | 110 + vendor/gopkg.in/yaml.v2/.travis.yml | 1 + vendor/gopkg.in/yaml.v2/apic.go | 6 +- vendor/gopkg.in/yaml.v2/go.mod | 8 +- vendor/gopkg.in/yaml.v2/yaml.go | 14 +- vendor/modules.txt | 189 +- 1687 files changed, 108526 insertions(+), 44255 deletions(-) delete mode 100644 vendor/github.com/BurntSushi/toml/.gitignore delete mode 100644 vendor/github.com/BurntSushi/toml/.travis.yml delete mode 100644 vendor/github.com/BurntSushi/toml/COMPATIBLE delete mode 100644 vendor/github.com/BurntSushi/toml/Makefile delete mode 100644 vendor/github.com/BurntSushi/toml/README.md delete mode 100644 vendor/github.com/BurntSushi/toml/decode.go delete mode 100644 vendor/github.com/BurntSushi/toml/decode_meta.go delete mode 100644 vendor/github.com/BurntSushi/toml/doc.go delete mode 100644 vendor/github.com/BurntSushi/toml/encode.go delete mode 100644 vendor/github.com/BurntSushi/toml/encoding_types.go delete mode 100644 vendor/github.com/BurntSushi/toml/encoding_types_1.1.go delete mode 100644 vendor/github.com/BurntSushi/toml/lex.go delete mode 100644 vendor/github.com/BurntSushi/toml/parse.go delete mode 100644 vendor/github.com/BurntSushi/toml/session.vim delete mode 100644 vendor/github.com/BurntSushi/toml/type_check.go delete mode 100644 vendor/github.com/BurntSushi/toml/type_fields.go delete mode 100644 vendor/github.com/cenkalti/backoff/v3/.travis.yml delete mode 100644 vendor/github.com/cenkalti/backoff/v3/LICENSE delete mode 100644 vendor/github.com/cenkalti/backoff/v3/README.md delete mode 100644 vendor/github.com/cenkalti/backoff/v3/backoff.go delete mode 100644 vendor/github.com/cenkalti/backoff/v3/context.go delete mode 100644 vendor/github.com/cenkalti/backoff/v3/exponential.go delete mode 100644 vendor/github.com/cenkalti/backoff/v3/go.mod delete mode 100644 vendor/github.com/cenkalti/backoff/v3/retry.go delete mode 100644 vendor/github.com/cenkalti/backoff/v3/ticker.go delete mode 100644 vendor/github.com/cenkalti/backoff/v3/tries.go rename vendor/github.com/{BurntSushi/toml/COPYING => dgryski/go-rendezvous/LICENSE} (94%) create mode 100644 vendor/github.com/dgryski/go-rendezvous/rdv.go delete mode 100644 vendor/github.com/docker/docker/pkg/random/random.go create mode 100644 vendor/github.com/eclipse/paho.mqtt.golang/go.mod create mode 100644 vendor/github.com/eclipse/paho.mqtt.golang/go.sum create mode 100644 vendor/github.com/eclipse/paho.mqtt.golang/netconn.go create mode 100644 vendor/github.com/eclipse/paho.mqtt.golang/websocket.go delete mode 100644 vendor/github.com/go-redis/redis/.travis.yml delete mode 100644 vendor/github.com/go-redis/redis/CHANGELOG.md delete mode 100644 vendor/github.com/go-redis/redis/README.md delete mode 100644 vendor/github.com/go-redis/redis/cluster_commands.go delete mode 100644 vendor/github.com/go-redis/redis/command.go delete mode 100644 vendor/github.com/go-redis/redis/commands.go delete mode 100644 vendor/github.com/go-redis/redis/internal/consistenthash/consistenthash.go delete mode 100644 vendor/github.com/go-redis/redis/internal/error.go delete mode 100644 vendor/github.com/go-redis/redis/internal/internal.go delete mode 100644 vendor/github.com/go-redis/redis/internal/log.go delete mode 100644 vendor/github.com/go-redis/redis/internal/pool/conn.go delete mode 100644 vendor/github.com/go-redis/redis/internal/pool/pool_sticky.go delete mode 100644 vendor/github.com/go-redis/redis/internal/util.go delete mode 100644 vendor/github.com/go-redis/redis/redis.go delete mode 100644 vendor/github.com/go-redis/redis/script.go delete mode 100644 vendor/github.com/go-redis/redis/sentinel.go delete mode 100644 vendor/github.com/go-redis/redis/tx.go rename vendor/github.com/go-redis/redis/{ => v8}/.gitignore (72%) create mode 100644 vendor/github.com/go-redis/redis/v8/.golangci.yml create mode 100644 vendor/github.com/go-redis/redis/v8/.prettierrc create mode 100644 vendor/github.com/go-redis/redis/v8/CHANGELOG.md rename vendor/github.com/go-redis/redis/{ => v8}/LICENSE (100%) rename vendor/github.com/go-redis/redis/{ => v8}/Makefile (53%) create mode 100644 vendor/github.com/go-redis/redis/v8/README.md rename vendor/github.com/go-redis/redis/{ => v8}/cluster.go (59%) create mode 100644 vendor/github.com/go-redis/redis/v8/cluster_commands.go create mode 100644 vendor/github.com/go-redis/redis/v8/command.go create mode 100644 vendor/github.com/go-redis/redis/v8/commands.go rename vendor/github.com/go-redis/redis/{ => v8}/doc.go (100%) create mode 100644 vendor/github.com/go-redis/redis/v8/error.go create mode 100644 vendor/github.com/go-redis/redis/v8/go.mod create mode 100644 vendor/github.com/go-redis/redis/v8/go.sum create mode 100644 vendor/github.com/go-redis/redis/v8/internal/arg.go rename vendor/github.com/go-redis/redis/{ => v8}/internal/hashtag/hashtag.go (98%) create mode 100644 vendor/github.com/go-redis/redis/v8/internal/hscan/hscan.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/hscan/structmap.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/instruments.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/internal.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/log.go rename vendor/github.com/go-redis/redis/{ => v8}/internal/once.go (100%) create mode 100644 vendor/github.com/go-redis/redis/v8/internal/pool/conn.go rename vendor/github.com/go-redis/redis/{ => v8}/internal/pool/pool.go (68%) create mode 100644 vendor/github.com/go-redis/redis/v8/internal/pool/pool_single.go rename vendor/github.com/go-redis/redis/{internal/pool/pool_single.go => v8/internal/pool/pool_sticky.go} (55%) rename vendor/github.com/go-redis/redis/{ => v8}/internal/proto/reader.go (79%) rename vendor/github.com/go-redis/redis/{ => v8}/internal/proto/scan.go (92%) rename vendor/github.com/go-redis/redis/{ => v8}/internal/proto/writer.go (72%) create mode 100644 vendor/github.com/go-redis/redis/v8/internal/rand/rand.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/safe.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/unsafe.go create mode 100644 vendor/github.com/go-redis/redis/v8/internal/util.go rename vendor/github.com/go-redis/redis/{ => v8}/internal/util/safe.go (100%) rename vendor/github.com/go-redis/redis/{ => v8}/internal/util/strconv.go (100%) rename vendor/github.com/go-redis/redis/{ => v8}/internal/util/unsafe.go (100%) rename vendor/github.com/go-redis/redis/{ => v8}/iterator.go (83%) rename vendor/github.com/go-redis/redis/{ => v8}/options.go (57%) rename vendor/github.com/go-redis/redis/{ => v8}/pipeline.go (70%) rename vendor/github.com/go-redis/redis/{ => v8}/pubsub.go (50%) create mode 100644 vendor/github.com/go-redis/redis/v8/redis.go rename vendor/github.com/go-redis/redis/{ => v8}/result.go (63%) rename vendor/github.com/go-redis/redis/{ => v8}/ring.go (58%) create mode 100644 vendor/github.com/go-redis/redis/v8/script.go create mode 100644 vendor/github.com/go-redis/redis/v8/sentinel.go create mode 100644 vendor/github.com/go-redis/redis/v8/tx.go rename vendor/github.com/go-redis/redis/{ => v8}/universal.go (59%) create mode 100644 vendor/github.com/hashicorp/go-multierror/group.go create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go create mode 100644 vendor/github.com/hashicorp/vault/api/README.md create mode 100644 vendor/github.com/hashicorp/vault/api/lifetime_watcher.go delete mode 100644 vendor/github.com/hashicorp/vault/api/renewer.go create mode 100644 vendor/github.com/hashicorp/vault/api/sys_monitor.go create mode 100644 vendor/github.com/mattn/go-colorable/go.test.sh create mode 100644 vendor/github.com/mattn/go-isatty/go.test.sh delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_android.go create mode 100644 vendor/github.com/mattn/go-isatty/renovate.json delete mode 100644 vendor/github.com/mitchellh/mapstructure/.travis.yml create mode 100644 vendor/github.com/moby/term/.gitignore create mode 100644 vendor/github.com/moby/term/LICENSE create mode 100644 vendor/github.com/moby/term/README.md rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/ascii.go (93%) create mode 100644 vendor/github.com/moby/term/go.mod create mode 100644 vendor/github.com/moby/term/go.sum create mode 100644 vendor/github.com/moby/term/proxy.go create mode 100644 vendor/github.com/moby/term/tc.go rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/term.go (89%) rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/term_windows.go (67%) rename vendor/github.com/{ory/dockertest/v3/docker/pkg/term/termios_linux.go => moby/term/termios.go} (61%) create mode 100644 vendor/github.com/moby/term/termios_bsd.go create mode 100644 vendor/github.com/moby/term/termios_nonbsd.go rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/windows/ansi_reader.go (87%) rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/windows/ansi_writer.go (78%) rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/windows/console.go (64%) create mode 100644 vendor/github.com/moby/term/windows/doc.go rename vendor/github.com/{ory/dockertest/v3/docker/pkg => moby}/term/winsize.go (89%) delete mode 100644 vendor/github.com/nats-io/jwt/.travis.yml delete mode 100644 vendor/github.com/nats-io/jwt/Makefile delete mode 100644 vendor/github.com/nats-io/jwt/README.md delete mode 100644 vendor/github.com/nats-io/jwt/ReleaseNotes.md delete mode 100644 vendor/github.com/nats-io/jwt/account_claims.go delete mode 100644 vendor/github.com/nats-io/jwt/activation_claims.go delete mode 100644 vendor/github.com/nats-io/jwt/claims.go delete mode 100644 vendor/github.com/nats-io/jwt/cluster_claims.go delete mode 100644 vendor/github.com/nats-io/jwt/creds_utils.go delete mode 100644 vendor/github.com/nats-io/jwt/exports.go delete mode 100644 vendor/github.com/nats-io/jwt/genericlaims.go delete mode 100644 vendor/github.com/nats-io/jwt/go.mod delete mode 100644 vendor/github.com/nats-io/jwt/go.sum delete mode 100644 vendor/github.com/nats-io/jwt/header.go delete mode 100644 vendor/github.com/nats-io/jwt/imports.go delete mode 100644 vendor/github.com/nats-io/jwt/operator_claims.go delete mode 100644 vendor/github.com/nats-io/jwt/revocation_list.go delete mode 100644 vendor/github.com/nats-io/jwt/server_claims.go delete mode 100644 vendor/github.com/nats-io/jwt/types.go delete mode 100644 vendor/github.com/nats-io/jwt/user_claims.go delete mode 100644 vendor/github.com/nats-io/jwt/validation.go create mode 100644 vendor/github.com/nats-io/nats.go/dependencies.md create mode 100644 vendor/github.com/nats-io/nats.go/go_test.mod create mode 100644 vendor/github.com/nats-io/nats.go/go_test.sum create mode 100644 vendor/github.com/nats-io/nats.go/js.go create mode 100644 vendor/github.com/nats-io/nats.go/jsm.go create mode 100644 vendor/github.com/nats-io/nats.go/ws.go create mode 100644 vendor/github.com/nats-io/nkeys/creds_utils.go create mode 100644 vendor/github.com/ory/dockertest/v3/.reference-ignore delete mode 100644 vendor/github.com/ory/dockertest/v3/docker/pkg/term/proxy.go delete mode 100644 vendor/github.com/ory/dockertest/v3/docker/pkg/term/tc.go delete mode 100644 vendor/github.com/ory/dockertest/v3/docker/pkg/term/termios_bsd.go delete mode 100644 vendor/github.com/ory/dockertest/v3/docker/pkg/term/windows/windows.go delete mode 100644 vendor/github.com/pelletier/go-toml/benchmark.json delete mode 100644 vendor/github.com/pelletier/go-toml/benchmark.toml delete mode 100644 vendor/github.com/pelletier/go-toml/benchmark.yml delete mode 100644 vendor/github.com/pelletier/go-toml/fuzzit.sh delete mode 100644 vendor/github.com/pelletier/go-toml/go.sum create mode 100644 vendor/github.com/pelletier/go-toml/tomlpub.go create mode 100644 vendor/github.com/pelletier/go-toml/tomltree_writepub.go delete mode 100644 vendor/github.com/plgd-dev/go-coap/v2/.travis.yml delete mode 100644 vendor/github.com/plgd-dev/go-coap/v2/net/keepalive/error.go delete mode 100644 vendor/github.com/plgd-dev/go-coap/v2/net/keepalive/keepalive.go create mode 100644 vendor/github.com/plgd-dev/go-coap/v2/net/monitor/inactivity/inactivitymonitor.go create mode 100644 vendor/github.com/plgd-dev/go-coap/v2/net/monitor/inactivity/keepalive.go create mode 100644 vendor/github.com/plgd-dev/go-coap/v2/net/observation/observation.go create mode 100644 vendor/github.com/plgd-dev/go-coap/v2/net/options.go create mode 100644 vendor/github.com/plgd-dev/go-coap/v2/udp/client/inactivitymonitor.go create mode 100644 vendor/github.com/plgd-dev/go-coap/v2/udp/client/mutexmap.go create mode 100644 vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md create mode 100644 vendor/github.com/prometheus/procfs/SECURITY.md rename vendor/github.com/prometheus/procfs/{cpuinfo_arm.go => cpuinfo_armx.go} (97%) delete mode 100644 vendor/github.com/prometheus/procfs/cpuinfo_mips64le.go delete mode 100644 vendor/github.com/prometheus/procfs/cpuinfo_mipsle.go rename vendor/github.com/prometheus/procfs/{cpuinfo_mips.go => cpuinfo_mipsx.go} (94%) rename vendor/github.com/prometheus/procfs/{cpuinfo_arm64.go => cpuinfo_others.go} (82%) delete mode 100644 vendor/github.com/prometheus/procfs/cpuinfo_ppc64le.go rename vendor/github.com/prometheus/procfs/{cpuinfo_ppc64.go => cpuinfo_ppcx.go} (96%) rename vendor/github.com/prometheus/procfs/{cpuinfo_mips64.go => cpuinfo_riscvx.go} (91%) rename vendor/github.com/prometheus/procfs/{cpuinfo_default.go => cpuinfo_x86.go} (100%) create mode 100644 vendor/github.com/prometheus/procfs/net_ip_socket.go create mode 100644 vendor/github.com/prometheus/procfs/net_protocols.go create mode 100644 vendor/github.com/prometheus/procfs/net_tcp.go create mode 100644 vendor/github.com/prometheus/procfs/slab.go create mode 100644 vendor/github.com/rubenv/sql-migrate/.dockerignore create mode 100644 vendor/github.com/rubenv/sql-migrate/Dockerfile create mode 100644 vendor/github.com/sirupsen/logrus/.golangci.yml create mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_js.go create mode 100644 vendor/github.com/spf13/cobra/.golangci.yml create mode 100644 vendor/github.com/spf13/cobra/CHANGELOG.md create mode 100644 vendor/github.com/spf13/cobra/CONDUCT.md create mode 100644 vendor/github.com/spf13/cobra/CONTRIBUTING.md create mode 100644 vendor/github.com/spf13/cobra/projects_using_cobra.md create mode 100644 vendor/github.com/spf13/cobra/shell_completions.md create mode 100644 vendor/github.com/stretchr/testify/assert/assertion_order.go create mode 100644 vendor/github.com/uber/jaeger-client-go/CODEOWNERS create mode 100644 vendor/github.com/uber/jaeger-client-go/utils/reconnecting_udp_conn.go rename vendor/github.com/{nats-io/jwt => xdg-go/pbkdf2}/.gitignore (87%) rename vendor/github.com/{xdg/scram => xdg-go/pbkdf2}/LICENSE (100%) create mode 100644 vendor/github.com/xdg-go/pbkdf2/README.md create mode 100644 vendor/github.com/xdg-go/pbkdf2/go.mod create mode 100644 vendor/github.com/xdg-go/pbkdf2/pbkdf2.go rename vendor/github.com/{xdg => xdg-go}/scram/.gitignore (100%) create mode 100644 vendor/github.com/xdg-go/scram/CHANGELOG.md rename vendor/github.com/{xdg/stringprep => xdg-go/scram}/LICENSE (100%) rename vendor/github.com/{xdg => xdg-go}/scram/README.md (81%) rename vendor/github.com/{xdg => xdg-go}/scram/client.go (99%) rename vendor/github.com/{xdg => xdg-go}/scram/client_conv.go (100%) rename vendor/github.com/{xdg => xdg-go}/scram/common.go (100%) rename vendor/github.com/{xdg => xdg-go}/scram/doc.go (100%) create mode 100644 vendor/github.com/xdg-go/scram/go.mod create mode 100644 vendor/github.com/xdg-go/scram/go.sum rename vendor/github.com/{xdg => xdg-go}/scram/parse.go (100%) rename vendor/github.com/{xdg => xdg-go}/scram/scram.go (98%) rename vendor/github.com/{xdg => xdg-go}/scram/server.go (100%) rename vendor/github.com/{xdg => xdg-go}/scram/server_conv.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/.gitignore (100%) create mode 100644 vendor/github.com/xdg-go/stringprep/CHANGELOG.md create mode 100644 vendor/github.com/xdg-go/stringprep/LICENSE rename vendor/github.com/{xdg => xdg-go}/stringprep/README.md (55%) rename vendor/github.com/{xdg => xdg-go}/stringprep/bidi.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/doc.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/error.go (100%) create mode 100644 vendor/github.com/xdg-go/stringprep/go.mod create mode 100644 vendor/github.com/xdg-go/stringprep/go.sum rename vendor/github.com/{xdg => xdg-go}/stringprep/map.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/profile.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/saslprep.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/set.go (100%) rename vendor/github.com/{xdg => xdg-go}/stringprep/tables.go (100%) delete mode 100644 vendor/github.com/xdg/scram/.travis.yml delete mode 100644 vendor/github.com/xdg/stringprep/.travis.yml rename vendor/github.com/{cenkalti/backoff/v3 => youmark/pkcs8}/.gitignore (97%) create mode 100644 vendor/github.com/youmark/pkcs8/.travis.yml create mode 100644 vendor/github.com/youmark/pkcs8/LICENSE create mode 100644 vendor/github.com/youmark/pkcs8/README create mode 100644 vendor/github.com/youmark/pkcs8/README.md create mode 100644 vendor/github.com/youmark/pkcs8/pkcs8.go create mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go create mode 100644 vendor/go.mongodb.org/mongo-driver/event/doc.go create mode 100644 vendor/go.mongodb.org/mongo-driver/internal/background_context.go create mode 100644 vendor/go.mongodb.org/mongo-driver/internal/cancellation_listener.go create mode 100644 vendor/go.mongodb.org/mongo-driver/internal/string_util.go create mode 100644 vendor/go.mongodb.org/mongo-driver/internal/uri_validation_errors.go rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/address/addr.go (93%) rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/description/description.go (79%) rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/description/server.go (64%) rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/description/server_kind.go (59%) rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/description/server_selector.go (81%) create mode 100644 vendor/go.mongodb.org/mongo-driver/mongo/description/topology.go rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/description/topology_kind.go (92%) create mode 100644 vendor/go.mongodb.org/mongo-driver/mongo/description/topology_version.go rename vendor/go.mongodb.org/mongo-driver/{x/mongo/driver => mongo}/description/version_range.go (75%) create mode 100644 vendor/go.mongodb.org/mongo-driver/mongo/options/createcollectionoptions.go create mode 100644 vendor/go.mongodb.org/mongo-driver/mongo/options/serverapioptions.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_arraybuilder.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/reflectionfree_d_codec.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/aws_conv.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/conversation.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/awsv4/credentials.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/awsv4/doc.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/awsv4/request.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/awsv4/rest.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/awsv4/rules.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/awsv4/signer.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/mongodbaws.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/feature.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/version.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/options/provider_options.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/cache.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/config.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/ocsp.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/options.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/create.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/create.toml create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/errors.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation_exhaust.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/serverapioptions.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/cancellation_listener.go rename vendor/go.mongodb.org/mongo-driver/x/mongo/driver/{description/topology.go => topology/diff.go} (51%) create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool_generation_counter.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/rtt_monitor.go create mode 100644 vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/tls_connection_source.go create mode 100644 vendor/go.opentelemetry.io/otel/.gitignore create mode 100644 vendor/go.opentelemetry.io/otel/.gitmodules create mode 100644 vendor/go.opentelemetry.io/otel/.golangci.yml create mode 100644 vendor/go.opentelemetry.io/otel/CHANGELOG.md create mode 100644 vendor/go.opentelemetry.io/otel/CODEOWNERS create mode 100644 vendor/go.opentelemetry.io/otel/CONTRIBUTING.md rename vendor/{github.com/nats-io/jwt => go.opentelemetry.io/otel}/LICENSE (100%) create mode 100644 vendor/go.opentelemetry.io/otel/Makefile create mode 100644 vendor/go.opentelemetry.io/otel/Makefile.protos create mode 100644 vendor/go.opentelemetry.io/otel/README.md create mode 100644 vendor/go.opentelemetry.io/otel/RELEASING.md create mode 100644 vendor/go.opentelemetry.io/otel/VERSIONING.md create mode 100644 vendor/go.opentelemetry.io/otel/attribute/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/encoder.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/iterator.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/key.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/kv.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/set.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/type_string.go create mode 100644 vendor/go.opentelemetry.io/otel/attribute/value.go create mode 100644 vendor/go.opentelemetry.io/otel/codes/codes.go create mode 100644 vendor/go.opentelemetry.io/otel/codes/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/error_handler.go create mode 100644 vendor/go.opentelemetry.io/otel/get_main_pkgs.sh create mode 100644 vendor/go.opentelemetry.io/otel/go.mod create mode 100644 vendor/go.opentelemetry.io/otel/go.sum create mode 100644 vendor/go.opentelemetry.io/otel/handler.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/meter.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/propagator.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/state.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/global/trace.go create mode 100644 vendor/go.opentelemetry.io/otel/internal/rawhelpers.go rename vendor/{github.com/prometheus/client_golang/prometheus/build_info.go => go.opentelemetry.io/otel/internal/trace/noop/noop.go} (51%) create mode 100644 vendor/go.opentelemetry.io/otel/metric/LICENSE create mode 100644 vendor/go.opentelemetry.io/otel/metric/config.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/global/metric.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/go.mod create mode 100644 vendor/go.opentelemetry.io/otel/metric/go.sum create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrumentkind_string.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/metric.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/metric_instrument.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/metric_noop.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/metric_sdkapi.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/number/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/number/kind_string.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/number/number.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/registry/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/metric/registry/registry.go create mode 100644 vendor/go.opentelemetry.io/otel/pre_release.sh create mode 100644 vendor/go.opentelemetry.io/otel/propagation.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/baggage.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/propagation.go create mode 100644 vendor/go.opentelemetry.io/otel/propagation/trace_context.go create mode 100644 vendor/go.opentelemetry.io/otel/tag.sh create mode 100644 vendor/go.opentelemetry.io/otel/trace.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/LICENSE create mode 100644 vendor/go.opentelemetry.io/otel/trace/config.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/doc.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/go.mod create mode 100644 vendor/go.opentelemetry.io/otel/trace/go.sum create mode 100644 vendor/go.opentelemetry.io/otel/trace/noop.go create mode 100644 vendor/go.opentelemetry.io/otel/trace/trace.go rename vendor/{github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go => go.opentelemetry.io/otel/unit/doc.go} (55%) create mode 100644 vendor/go.opentelemetry.io/otel/unit/unit.go create mode 100644 vendor/go.opentelemetry.io/otel/verify_examples.sh create mode 100644 vendor/go.opentelemetry.io/otel/version.go create mode 100644 vendor/golang.org/x/crypto/ocsp/ocsp.go create mode 100644 vendor/golang.org/x/net/http2/ascii.go create mode 100644 vendor/golang.org/x/net/http2/go115.go create mode 100644 vendor/golang.org/x/net/http2/not_go115.go rename vendor/golang.org/x/net/idna/{tables12.00.go => tables12.0.0.go} (99%) create mode 100644 vendor/golang.org/x/net/idna/tables13.0.0.go create mode 100644 vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go create mode 100644 vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go create mode 100644 vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_bsdvar.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_dragonfly.go rename vendor/golang.org/x/net/internal/socket/{sys_darwin.go => sys_linux_ppc.go} (53%) rename vendor/golang.org/x/net/internal/socket/{sys_go1_11_darwin.go => sys_zos_s390x.go} (52%) create mode 100644 vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s create mode 100644 vendor/golang.org/x/net/internal/socket/zsys_linux_ppc.go create mode 100644 vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go create mode 100644 vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go create mode 100644 vendor/golang.org/x/net/ipv4/control_zos.go create mode 100644 vendor/golang.org/x/net/ipv4/sys_zos.go create mode 100644 vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go create mode 100644 vendor/golang.org/x/net/ipv6/icmp_zos.go create mode 100644 vendor/golang.org/x/net/ipv6/sys_zos.go create mode 100644 vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/websocket/client.go delete mode 100644 vendor/golang.org/x/net/websocket/dial.go delete mode 100644 vendor/golang.org/x/net/websocket/hybi.go delete mode 100644 vendor/golang.org/x/net/websocket/server.go delete mode 100644 vendor/golang.org/x/net/websocket/websocket.go create mode 100644 vendor/golang.org/x/sync/errgroup/errgroup.go rename vendor/golang.org/x/sys/unix/{asm_netbsd_386.s => asm_bsd_386.s} (68%) rename vendor/golang.org/x/sys/unix/{asm_openbsd_amd64.s => asm_bsd_amd64.s} (71%) rename vendor/golang.org/x/sys/unix/{asm_netbsd_arm.s => asm_bsd_arm.s} (73%) rename vendor/golang.org/x/sys/unix/{asm_netbsd_amd64.s => asm_bsd_arm64.s} (73%) delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_arm.s rename vendor/golang.org/x/sys/unix/{asm_openbsd_arm64.s => asm_openbsd_mips64.s} (91%) create mode 100644 vendor/golang.org/x/sys/unix/asm_zos_s390x.s create mode 100644 vendor/golang.org/x/sys/unix/dev_zos.go create mode 100644 vendor/golang.org/x/sys/unix/epoll_zos.go create mode 100644 vendor/golang.org/x/sys/unix/fstatfs_zos.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_linux.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_zos.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_darwin.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_ios.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go rename vendor/golang.org/x/sys/unix/{zsyscall_darwin_arm64.1_11.go => zsyscall_openbsd_mips64.go} (86%) create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/windows/setupapierrors_windows.go create mode 100644 vendor/golang.org/x/sys/windows/types_windows_arm64.go create mode 100644 vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go create mode 100644 vendor/golang.org/x/text/unicode/norm/tables13.0.0.go create mode 100644 vendor/gonum.org/v1/gonum/floats/scalar/doc.go create mode 100644 vendor/gonum.org/v1/gonum/floats/scalar/scalar.go create mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/stubs.go create mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/stubs.go create mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/sum_amd64.s create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgtsv.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlagtm.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlangt.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlantb.go create mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtbtrs.go create mode 100644 vendor/google.golang.org/grpc/SECURITY.md create mode 100644 vendor/google.golang.org/grpc/grpclog/component.go create mode 100644 vendor/google.golang.org/grpc/internal/credentials/spiffe.go rename vendor/google.golang.org/grpc/internal/{transport/log.go => credentials/spiffe_appengine.go} (50%) rename vendor/google.golang.org/grpc/{credentials/internal => internal/credentials}/syscallconn.go (96%) rename vendor/google.golang.org/grpc/{credentials/internal => internal/credentials}/syscallconn_appengine.go (97%) create mode 100644 vendor/google.golang.org/grpc/internal/credentials/util.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/metadata.go create mode 100644 vendor/google.golang.org/grpc/internal/metadata/metadata.go create mode 100644 vendor/google.golang.org/grpc/internal/resolver/config_selector.go create mode 100644 vendor/google.golang.org/grpc/internal/resolver/unix/unix.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/networktype/networktype.go rename vendor/google.golang.org/grpc/{ => internal/transport}/proxy.go (73%) delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/any_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/api_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/descriptor_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/doc.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/duration_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/empty_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/field_mask_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/source_context_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/struct_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/timestamp_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/type_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/fieldnum/wrappers_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/any_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/api_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/doc.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/duration_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/empty_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/goname.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/map_entry.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/struct_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/type_gen.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/wrappers.go create mode 100644 vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go delete mode 100644 vendor/google.golang.org/protobuf/internal/genname/name.go diff --git a/bootstrap/api/endpoint.go b/bootstrap/api/endpoint.go index ab9c49f84f..03b694aa96 100644 --- a/bootstrap/api/endpoint.go +++ b/bootstrap/api/endpoint.go @@ -11,7 +11,7 @@ import ( ) func addEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(addReq) if err := req.validate(); err != nil { return nil, err @@ -34,7 +34,7 @@ func addEndpoint(svc bootstrap.Service) endpoint.Endpoint { Content: req.Content, } - saved, err := svc.Add(req.token, config) + saved, err := svc.Add(ctx, req.token, config) if err != nil { return nil, err } @@ -49,13 +49,13 @@ func addEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func updateCertEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(updateCertReq) if err := req.validate(); err != nil { return nil, err } - if err := svc.UpdateCert(req.key, req.thingID, req.ClientCert, req.ClientKey, req.CACert); err != nil { + if err := svc.UpdateCert(ctx, req.key, req.thingID, req.ClientCert, req.ClientKey, req.CACert); err != nil { return nil, err } @@ -66,14 +66,14 @@ func updateCertEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func viewEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(entityReq) if err := req.validate(); err != nil { return nil, err } - config, err := svc.View(req.key, req.id) + config, err := svc.View(ctx, req.key, req.id) if err != nil { return nil, err } @@ -103,7 +103,7 @@ func viewEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func updateEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(updateReq) if err := req.validate(); err != nil { @@ -116,7 +116,7 @@ func updateEndpoint(svc bootstrap.Service) endpoint.Endpoint { Content: req.Content, } - if err := svc.Update(req.key, config); err != nil { + if err := svc.Update(ctx, req.key, config); err != nil { return nil, err } @@ -130,14 +130,14 @@ func updateEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func updateConnEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(updateConnReq) if err := req.validate(); err != nil { return nil, err } - if err := svc.UpdateConnections(req.key, req.id, req.Channels); err != nil { + if err := svc.UpdateConnections(ctx, req.key, req.id, req.Channels); err != nil { return nil, err } @@ -151,14 +151,14 @@ func updateConnEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func listEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(listReq) if err := req.validate(); err != nil { return nil, err } - page, err := svc.List(req.key, req.filter, req.offset, req.limit) + page, err := svc.List(ctx, req.key, req.filter, req.offset, req.limit) if err != nil { return nil, err } @@ -197,14 +197,14 @@ func listEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func removeEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(entityReq) if err := req.validate(); err != nil { return removeRes{}, err } - if err := svc.Remove(req.key, req.id); err != nil { + if err := svc.Remove(ctx, req.key, req.id); err != nil { return nil, err } @@ -213,13 +213,13 @@ func removeEndpoint(svc bootstrap.Service) endpoint.Endpoint { } func bootstrapEndpoint(svc bootstrap.Service, reader bootstrap.ConfigReader, secure bool) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(bootstrapReq) if err := req.validate(); err != nil { return nil, err } - cfg, err := svc.Bootstrap(req.key, req.id, secure) + cfg, err := svc.Bootstrap(ctx, req.key, req.id, secure) if err != nil { return nil, err } @@ -229,14 +229,14 @@ func bootstrapEndpoint(svc bootstrap.Service, reader bootstrap.ConfigReader, sec } func stateEndpoint(svc bootstrap.Service) endpoint.Endpoint { - return func(_ context.Context, request interface{}) (interface{}, error) { + return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(changeStateReq) if err := req.validate(); err != nil { return nil, err } - if err := svc.ChangeState(req.key, req.id, req.State); err != nil { + if err := svc.ChangeState(ctx, req.key, req.id, req.State); err != nil { return nil, err } diff --git a/bootstrap/api/endpoint_test.go b/bootstrap/api/endpoint_test.go index a05f8bd12c..199a68ffbd 100644 --- a/bootstrap/api/endpoint_test.go +++ b/bootstrap/api/endpoint_test.go @@ -4,6 +4,7 @@ package api_test import ( + "context" "crypto/aes" "crypto/cipher" "crypto/rand" @@ -339,7 +340,7 @@ func TestView(t *testing.T) { }) } - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) var channels []channel @@ -428,7 +429,7 @@ func TestUpdate(t *testing.T) { c := newConfig([]bootstrap.Channel{bootstrap.Channel{ID: "1"}}) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) data := toJSON(updateReq) @@ -522,7 +523,7 @@ func TestUpdateCert(t *testing.T) { c := newConfig([]bootstrap.Channel{bootstrap.Channel{ID: "1"}}) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) data := toJSON(updateReq) @@ -617,7 +618,7 @@ func TestUpdateConnections(t *testing.T) { c := newConfig([]bootstrap.Channel{bootstrap.Channel{ID: "1"}}) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) data := toJSON(updateReq) @@ -736,7 +737,7 @@ func TestList(t *testing.T) { c.Name = fmt.Sprintf("%s-%d", addName, i) c.ExternalKey = fmt.Sprintf("%s%s", addExternalKey, strconv.Itoa(i)) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) var channels []channel @@ -762,7 +763,7 @@ func TestList(t *testing.T) { if i%2 == 0 { state = bootstrap.Inactive } - err := svc.ChangeState(validToken, list[i].MFThing, state) + err := svc.ChangeState(context.Background(), validToken, list[i].MFThing, state) require.Nil(t, err, fmt.Sprintf("Changing state expected to succeed: %s.\n", err)) list[i].State = state if state == bootstrap.Inactive { @@ -978,7 +979,7 @@ func TestRemove(t *testing.T) { c := newConfig([]bootstrap.Channel{bootstrap.Channel{ID: "1"}}) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -1040,7 +1041,7 @@ func TestBootstrap(t *testing.T) { c := newConfig([]bootstrap.Channel{bootstrap.Channel{ID: "1"}}) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) encExternKey, err := enc([]byte(c.ExternalKey)) @@ -1168,7 +1169,7 @@ func TestChangeState(t *testing.T) { c := newConfig([]bootstrap.Channel{bootstrap.Channel{ID: "1"}}) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) inactive := fmt.Sprintf("{\"state\": %d}", bootstrap.Inactive) diff --git a/bootstrap/api/logging.go b/bootstrap/api/logging.go index e9ed80bda7..b99028ef89 100644 --- a/bootstrap/api/logging.go +++ b/bootstrap/api/logging.go @@ -6,6 +6,7 @@ package api import ( + "context" "fmt" "time" @@ -25,7 +26,7 @@ func NewLoggingMiddleware(svc bootstrap.Service, logger log.Logger) bootstrap.Se return &loggingMiddleware{logger, svc} } -func (lm *loggingMiddleware) Add(token string, cfg bootstrap.Config) (saved bootstrap.Config, err error) { +func (lm *loggingMiddleware) Add(ctx context.Context, token string, cfg bootstrap.Config) (saved bootstrap.Config, err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method add for token %s and thing %s took %s to complete", token, saved.MFThing, time.Since(begin)) if err != nil { @@ -35,10 +36,10 @@ func (lm *loggingMiddleware) Add(token string, cfg bootstrap.Config) (saved boot lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.Add(token, cfg) + return lm.svc.Add(ctx, token, cfg) } -func (lm *loggingMiddleware) View(token, id string) (saved bootstrap.Config, err error) { +func (lm *loggingMiddleware) View(ctx context.Context, token, id string) (saved bootstrap.Config, err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method view for token %s and thing %s took %s to complete", token, saved.MFThing, time.Since(begin)) if err != nil { @@ -48,10 +49,10 @@ func (lm *loggingMiddleware) View(token, id string) (saved bootstrap.Config, err lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.View(token, id) + return lm.svc.View(ctx, token, id) } -func (lm *loggingMiddleware) Update(token string, cfg bootstrap.Config) (err error) { +func (lm *loggingMiddleware) Update(ctx context.Context, token string, cfg bootstrap.Config) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method update for token %s and thing %s took %s to complete", token, cfg.MFThing, time.Since(begin)) if err != nil { @@ -61,10 +62,10 @@ func (lm *loggingMiddleware) Update(token string, cfg bootstrap.Config) (err err lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.Update(token, cfg) + return lm.svc.Update(ctx, token, cfg) } -func (lm *loggingMiddleware) UpdateCert(token, thingID, clientCert, clientKey, caCert string) (err error) { +func (lm *loggingMiddleware) UpdateCert(ctx context.Context, token, thingID, clientCert, clientKey, caCert string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method update_cert for thing with id %s took %s to complete", thingID, time.Since(begin)) if err != nil { @@ -74,10 +75,10 @@ func (lm *loggingMiddleware) UpdateCert(token, thingID, clientCert, clientKey, c lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateCert(token, thingID, clientCert, clientKey, caCert) + return lm.svc.UpdateCert(ctx, token, thingID, clientCert, clientKey, caCert) } -func (lm *loggingMiddleware) UpdateConnections(token, id string, connections []string) (err error) { +func (lm *loggingMiddleware) UpdateConnections(ctx context.Context, token, id string, connections []string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method update_connections for token %s and thing %s took %s to complete", token, id, time.Since(begin)) if err != nil { @@ -87,10 +88,10 @@ func (lm *loggingMiddleware) UpdateConnections(token, id string, connections []s lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateConnections(token, id, connections) + return lm.svc.UpdateConnections(ctx, token, id, connections) } -func (lm *loggingMiddleware) List(token string, filter bootstrap.Filter, offset, limit uint64) (res bootstrap.ConfigsPage, err error) { +func (lm *loggingMiddleware) List(ctx context.Context, token string, filter bootstrap.Filter, offset, limit uint64) (res bootstrap.ConfigsPage, err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method list for token %s and offset %d and limit %d took %s to complete", token, offset, limit, time.Since(begin)) if err != nil { @@ -100,10 +101,10 @@ func (lm *loggingMiddleware) List(token string, filter bootstrap.Filter, offset, lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.List(token, filter, offset, limit) + return lm.svc.List(ctx, token, filter, offset, limit) } -func (lm *loggingMiddleware) Remove(token, id string) (err error) { +func (lm *loggingMiddleware) Remove(ctx context.Context, token, id string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method remove for token %s and thing %s took %s to complete", token, id, time.Since(begin)) if err != nil { @@ -113,10 +114,10 @@ func (lm *loggingMiddleware) Remove(token, id string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.Remove(token, id) + return lm.svc.Remove(ctx, token, id) } -func (lm *loggingMiddleware) Bootstrap(externalKey, externalID string, secure bool) (cfg bootstrap.Config, err error) { +func (lm *loggingMiddleware) Bootstrap(ctx context.Context, externalKey, externalID string, secure bool) (cfg bootstrap.Config, err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method bootstrap for thing with external id %s took %s to complete", externalID, time.Since(begin)) if err != nil { @@ -126,10 +127,10 @@ func (lm *loggingMiddleware) Bootstrap(externalKey, externalID string, secure bo lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.Bootstrap(externalKey, externalID, secure) + return lm.svc.Bootstrap(ctx, externalKey, externalID, secure) } -func (lm *loggingMiddleware) ChangeState(token, id string, state bootstrap.State) (err error) { +func (lm *loggingMiddleware) ChangeState(ctx context.Context, token, id string, state bootstrap.State) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method change_state for token %s and thing %s took %s to complete", token, id, time.Since(begin)) if err != nil { @@ -139,10 +140,10 @@ func (lm *loggingMiddleware) ChangeState(token, id string, state bootstrap.State lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.ChangeState(token, id, state) + return lm.svc.ChangeState(ctx, token, id, state) } -func (lm *loggingMiddleware) UpdateChannelHandler(channel bootstrap.Channel) (err error) { +func (lm *loggingMiddleware) UpdateChannelHandler(ctx context.Context, channel bootstrap.Channel) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method update_channel_handler for channel %s took %s to complete", channel.ID, time.Since(begin)) if err != nil { @@ -152,10 +153,10 @@ func (lm *loggingMiddleware) UpdateChannelHandler(channel bootstrap.Channel) (er lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateChannelHandler(channel) + return lm.svc.UpdateChannelHandler(ctx, channel) } -func (lm *loggingMiddleware) RemoveConfigHandler(id string) (err error) { +func (lm *loggingMiddleware) RemoveConfigHandler(ctx context.Context, id string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method remove_config_handler for config %s took %s to complete", id, time.Since(begin)) if err != nil { @@ -165,10 +166,10 @@ func (lm *loggingMiddleware) RemoveConfigHandler(id string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.RemoveConfigHandler(id) + return lm.svc.RemoveConfigHandler(ctx, id) } -func (lm *loggingMiddleware) RemoveChannelHandler(id string) (err error) { +func (lm *loggingMiddleware) RemoveChannelHandler(ctx context.Context, id string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method remove_channel_handler for channel %s took %s to complete", id, time.Since(begin)) if err != nil { @@ -178,10 +179,10 @@ func (lm *loggingMiddleware) RemoveChannelHandler(id string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.RemoveChannelHandler(id) + return lm.svc.RemoveChannelHandler(ctx, id) } -func (lm *loggingMiddleware) DisconnectThingHandler(channelID, thingID string) (err error) { +func (lm *loggingMiddleware) DisconnectThingHandler(ctx context.Context, channelID, thingID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("Method disconnect_thing_handler for channel %s and thing %s took %s to complete", channelID, thingID, time.Since(begin)) if err != nil { @@ -191,5 +192,5 @@ func (lm *loggingMiddleware) DisconnectThingHandler(channelID, thingID string) ( lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.DisconnectThingHandler(channelID, thingID) + return lm.svc.DisconnectThingHandler(ctx, channelID, thingID) } diff --git a/bootstrap/api/metrics.go b/bootstrap/api/metrics.go index 6de32e369e..79c47c1fb1 100644 --- a/bootstrap/api/metrics.go +++ b/bootstrap/api/metrics.go @@ -6,6 +6,7 @@ package api import ( + "context" "time" "github.com/go-kit/kit/metrics" @@ -29,119 +30,119 @@ func MetricsMiddleware(svc bootstrap.Service, counter metrics.Counter, latency m } } -func (mm *metricsMiddleware) Add(token string, cfg bootstrap.Config) (saved bootstrap.Config, err error) { +func (mm *metricsMiddleware) Add(ctx context.Context, token string, cfg bootstrap.Config) (saved bootstrap.Config, err error) { defer func(begin time.Time) { mm.counter.With("method", "add").Add(1) mm.latency.With("method", "add").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.Add(token, cfg) + return mm.svc.Add(ctx, token, cfg) } -func (mm *metricsMiddleware) View(token, id string) (saved bootstrap.Config, err error) { +func (mm *metricsMiddleware) View(ctx context.Context, token, id string) (saved bootstrap.Config, err error) { defer func(begin time.Time) { mm.counter.With("method", "view").Add(1) mm.latency.With("method", "view").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.View(token, id) + return mm.svc.View(ctx, token, id) } -func (mm *metricsMiddleware) Update(token string, cfg bootstrap.Config) (err error) { +func (mm *metricsMiddleware) Update(ctx context.Context, token string, cfg bootstrap.Config) (err error) { defer func(begin time.Time) { mm.counter.With("method", "update").Add(1) mm.latency.With("method", "update").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.Update(token, cfg) + return mm.svc.Update(ctx, token, cfg) } -func (mm *metricsMiddleware) UpdateCert(token, thingKey, clientCert, clientKey, caCert string) (err error) { +func (mm *metricsMiddleware) UpdateCert(ctx context.Context, token, thingKey, clientCert, clientKey, caCert string) (err error) { defer func(begin time.Time) { mm.counter.With("method", "update_cert").Add(1) mm.latency.With("method", "update_cert").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateCert(token, thingKey, clientCert, clientKey, caCert) + return mm.svc.UpdateCert(ctx, token, thingKey, clientCert, clientKey, caCert) } -func (mm *metricsMiddleware) UpdateConnections(token, id string, connections []string) (err error) { +func (mm *metricsMiddleware) UpdateConnections(ctx context.Context, token, id string, connections []string) (err error) { defer func(begin time.Time) { mm.counter.With("method", "update_connections").Add(1) mm.latency.With("method", "update_connections").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateConnections(token, id, connections) + return mm.svc.UpdateConnections(ctx, token, id, connections) } -func (mm *metricsMiddleware) List(token string, filter bootstrap.Filter, offset, limit uint64) (saved bootstrap.ConfigsPage, err error) { +func (mm *metricsMiddleware) List(ctx context.Context, token string, filter bootstrap.Filter, offset, limit uint64) (saved bootstrap.ConfigsPage, err error) { defer func(begin time.Time) { mm.counter.With("method", "list").Add(1) mm.latency.With("method", "list").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.List(token, filter, offset, limit) + return mm.svc.List(ctx, token, filter, offset, limit) } -func (mm *metricsMiddleware) Remove(token, id string) (err error) { +func (mm *metricsMiddleware) Remove(ctx context.Context, token, id string) (err error) { defer func(begin time.Time) { mm.counter.With("method", "remove").Add(1) mm.latency.With("method", "remove").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.Remove(token, id) + return mm.svc.Remove(ctx, token, id) } -func (mm *metricsMiddleware) Bootstrap(externalKey, externalID string, secure bool) (cfg bootstrap.Config, err error) { +func (mm *metricsMiddleware) Bootstrap(ctx context.Context, externalKey, externalID string, secure bool) (cfg bootstrap.Config, err error) { defer func(begin time.Time) { mm.counter.With("method", "bootstrap").Add(1) mm.latency.With("method", "bootstrap").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.Bootstrap(externalKey, externalID, secure) + return mm.svc.Bootstrap(ctx, externalKey, externalID, secure) } -func (mm *metricsMiddleware) ChangeState(token, id string, state bootstrap.State) (err error) { +func (mm *metricsMiddleware) ChangeState(ctx context.Context, token, id string, state bootstrap.State) (err error) { defer func(begin time.Time) { mm.counter.With("method", "change_state").Add(1) mm.latency.With("method", "change_state").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.ChangeState(token, id, state) + return mm.svc.ChangeState(ctx, token, id, state) } -func (mm *metricsMiddleware) UpdateChannelHandler(channel bootstrap.Channel) (err error) { +func (mm *metricsMiddleware) UpdateChannelHandler(ctx context.Context, channel bootstrap.Channel) (err error) { defer func(begin time.Time) { mm.counter.With("method", "update_channel").Add(1) mm.latency.With("method", "update_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateChannelHandler(channel) + return mm.svc.UpdateChannelHandler(ctx, channel) } -func (mm *metricsMiddleware) RemoveConfigHandler(id string) (err error) { +func (mm *metricsMiddleware) RemoveConfigHandler(ctx context.Context, id string) (err error) { defer func(begin time.Time) { mm.counter.With("method", "remove_config").Add(1) mm.latency.With("method", "remove_config").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.RemoveConfigHandler(id) + return mm.svc.RemoveConfigHandler(ctx, id) } -func (mm *metricsMiddleware) RemoveChannelHandler(id string) (err error) { +func (mm *metricsMiddleware) RemoveChannelHandler(ctx context.Context, id string) (err error) { defer func(begin time.Time) { mm.counter.With("method", "remove_channel").Add(1) mm.latency.With("method", "remove_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.RemoveChannelHandler(id) + return mm.svc.RemoveChannelHandler(ctx, id) } -func (mm *metricsMiddleware) DisconnectThingHandler(channelID, thingID string) (err error) { +func (mm *metricsMiddleware) DisconnectThingHandler(ctx context.Context, channelID, thingID string) (err error) { defer func(begin time.Time) { mm.counter.With("method", "disconnect_thing_handler").Add(1) mm.latency.With("method", "disconnect_thing_handler").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.DisconnectThingHandler(channelID, thingID) + return mm.svc.DisconnectThingHandler(ctx, channelID, thingID) } diff --git a/bootstrap/postgres/configs.go b/bootstrap/postgres/configs.go index f465554205..522ae20b4b 100644 --- a/bootstrap/postgres/configs.go +++ b/bootstrap/postgres/configs.go @@ -19,8 +19,8 @@ import ( const ( duplicateErr = "unique_violation" uuidErr = "invalid input syntax for type uuid" - connConstraintErr = "connections_config_id_fkey" fkViolation = "foreign_key_violation" + connConstraintErr = "connections_config_id_config_owner_fkey" configFieldsNum = 8 chanFieldsNum = 3 connFieldsNum = 2 diff --git a/bootstrap/postgres/setup_test.go b/bootstrap/postgres/setup_test.go index 5e07c80fbc..6d56fedb53 100644 --- a/bootstrap/postgres/setup_test.go +++ b/bootstrap/postgres/setup_test.go @@ -36,7 +36,7 @@ func TestMain(m *testing.M) { "POSTGRES_PASSWORD=test", "POSTGRES_DB=test", } - container, err := pool.Run("postgres", "10.8-alpine", cfg) + container, err := pool.Run("postgres", "13.3-alpine", cfg) if err != nil { log.Fatalf("Could not start container: %s", err) } diff --git a/bootstrap/redis/consumer/streams.go b/bootstrap/redis/consumer/streams.go index ca30330418..212ea14e81 100644 --- a/bootstrap/redis/consumer/streams.go +++ b/bootstrap/redis/consumer/streams.go @@ -4,10 +4,11 @@ package consumer import ( + "context" "encoding/json" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/bootstrap" "github.com/mainflux/mainflux/logger" ) @@ -30,7 +31,7 @@ const ( // Subscriber represents event source for things and channels provisioning. type Subscriber interface { // Subscribes to given subject and receives events. - Subscribe(string) error + Subscribe(context.Context, string) error } type eventStore struct { @@ -50,14 +51,14 @@ func NewEventStore(svc bootstrap.Service, client *redis.Client, consumer string, } } -func (es eventStore) Subscribe(subject string) error { - err := es.client.XGroupCreateMkStream(stream, group, "$").Err() +func (es eventStore) Subscribe(ctx context.Context, subject string) error { + err := es.client.XGroupCreateMkStream(ctx, stream, group, "$").Err() if err != nil && err.Error() != exists { return err } for { - streams, err := es.client.XReadGroup(&redis.XReadGroupArgs{ + streams, err := es.client.XReadGroup(ctx, &redis.XReadGroupArgs{ Group: group, Consumer: es.consumer, Streams: []string{stream, ">"}, @@ -74,22 +75,22 @@ func (es eventStore) Subscribe(subject string) error { switch event["operation"] { case thingRemove: rte := decodeRemoveThing(event) - err = es.handleRemoveThing(rte) + err = es.svc.RemoveConfigHandler(ctx, rte.id) case thingDisconnect: dte := decodeDisconnectThing(event) - err = es.handleDisconnectThing(dte) + err = es.svc.DisconnectThingHandler(ctx, dte.channelID, dte.thingID) case channelUpdate: uce := decodeUpdateChannel(event) - err = es.handleUpdateChannel(uce) + err = es.handleUpdateChannel(ctx, uce) case channelRemove: rce := decodeRemoveChannel(event) - err = es.handleRemoveChannel(rce) + err = es.svc.RemoveChannelHandler(ctx, rce.id) } if err != nil { es.logger.Warn(fmt.Sprintf("Failed to handle event sourcing: %s", err.Error())) break } - es.client.XAck(stream, group, msg.ID) + es.client.XAck(ctx, stream, group, msg.ID) } } } @@ -127,25 +128,13 @@ func decodeDisconnectThing(event map[string]interface{}) disconnectEvent { } } -func (es eventStore) handleRemoveThing(rte removeEvent) error { - return es.svc.RemoveConfigHandler(rte.id) -} - -func (es eventStore) handleUpdateChannel(uce updateChannelEvent) error { +func (es eventStore) handleUpdateChannel(ctx context.Context, uce updateChannelEvent) error { channel := bootstrap.Channel{ ID: uce.id, Name: uce.name, Metadata: uce.metadata, } - return es.svc.UpdateChannelHandler(channel) -} - -func (es eventStore) handleRemoveChannel(rce removeEvent) error { - return es.svc.RemoveChannelHandler(rce.id) -} - -func (es eventStore) handleDisconnectThing(dte disconnectEvent) error { - return es.svc.DisconnectThingHandler(dte.channelID, dte.thingID) + return es.svc.UpdateChannelHandler(ctx, channel) } func read(event map[string]interface{}, key, def string) string { diff --git a/bootstrap/redis/producer/setup_test.go b/bootstrap/redis/producer/setup_test.go index d51da44246..3f916620e3 100644 --- a/bootstrap/redis/producer/setup_test.go +++ b/bootstrap/redis/producer/setup_test.go @@ -4,12 +4,13 @@ package producer_test import ( + "context" "fmt" "log" "os" "testing" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" dockertest "github.com/ory/dockertest/v3" ) @@ -38,7 +39,7 @@ func TestMain(m *testing.M) { DB: 0, }) - return redisClient.Ping().Err() + return redisClient.Ping(context.Background()).Err() }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } diff --git a/bootstrap/redis/producer/streams.go b/bootstrap/redis/producer/streams.go index 484bd2b95f..09f441bf2f 100644 --- a/bootstrap/redis/producer/streams.go +++ b/bootstrap/redis/producer/streams.go @@ -4,9 +4,10 @@ package producer import ( + "context" "time" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/bootstrap" ) @@ -31,8 +32,8 @@ func NewEventStoreMiddleware(svc bootstrap.Service, client *redis.Client) bootst } } -func (es eventStore) Add(token string, cfg bootstrap.Config) (bootstrap.Config, error) { - saved, err := es.svc.Add(token, cfg) +func (es eventStore) Add(ctx context.Context, token string, cfg bootstrap.Config) (bootstrap.Config, error) { + saved, err := es.svc.Add(ctx, token, cfg) if err != nil { return saved, err } @@ -52,17 +53,17 @@ func (es eventStore) Add(token string, cfg bootstrap.Config) (bootstrap.Config, timestamp: time.Now(), } - es.add(ev) + es.add(ctx, ev) return saved, err } -func (es eventStore) View(token, id string) (bootstrap.Config, error) { - return es.svc.View(token, id) +func (es eventStore) View(ctx context.Context, token, id string) (bootstrap.Config, error) { + return es.svc.View(ctx, token, id) } -func (es eventStore) Update(token string, cfg bootstrap.Config) error { - if err := es.svc.Update(token, cfg); err != nil { +func (es eventStore) Update(ctx context.Context, token string, cfg bootstrap.Config) error { + if err := es.svc.Update(ctx, token, cfg); err != nil { return err } @@ -73,17 +74,17 @@ func (es eventStore) Update(token string, cfg bootstrap.Config) error { timestamp: time.Now(), } - es.add(ev) + es.add(ctx, ev) return nil } -func (es eventStore) UpdateCert(token, thingKey, clientCert, clientKey, caCert string) error { - return es.svc.UpdateCert(token, thingKey, clientCert, clientKey, caCert) +func (es eventStore) UpdateCert(ctx context.Context, token, thingKey, clientCert, clientKey, caCert string) error { + return es.svc.UpdateCert(ctx, token, thingKey, clientCert, clientKey, caCert) } -func (es eventStore) UpdateConnections(token, id string, connections []string) error { - if err := es.svc.UpdateConnections(token, id, connections); err != nil { +func (es eventStore) UpdateConnections(ctx context.Context, token, id string, connections []string) error { + if err := es.svc.UpdateConnections(ctx, token, id, connections); err != nil { return err } @@ -93,17 +94,17 @@ func (es eventStore) UpdateConnections(token, id string, connections []string) e timestamp: time.Now(), } - es.add(ev) + es.add(ctx, ev) return nil } -func (es eventStore) List(token string, filter bootstrap.Filter, offset, limit uint64) (bootstrap.ConfigsPage, error) { - return es.svc.List(token, filter, offset, limit) +func (es eventStore) List(ctx context.Context, token string, filter bootstrap.Filter, offset, limit uint64) (bootstrap.ConfigsPage, error) { + return es.svc.List(ctx, token, filter, offset, limit) } -func (es eventStore) Remove(token, id string) error { - if err := es.svc.Remove(token, id); err != nil { +func (es eventStore) Remove(ctx context.Context, token, id string) error { + if err := es.svc.Remove(ctx, token, id); err != nil { return err } @@ -112,13 +113,13 @@ func (es eventStore) Remove(token, id string) error { timestamp: time.Now(), } - es.add(ev) + es.add(ctx, ev) return nil } -func (es eventStore) Bootstrap(externalKey, externalID string, secure bool) (bootstrap.Config, error) { - cfg, err := es.svc.Bootstrap(externalKey, externalID, secure) +func (es eventStore) Bootstrap(ctx context.Context, externalKey, externalID string, secure bool) (bootstrap.Config, error) { + cfg, err := es.svc.Bootstrap(ctx, externalKey, externalID, secure) ev := bootstrapEvent{ externalID: externalID, @@ -130,13 +131,13 @@ func (es eventStore) Bootstrap(externalKey, externalID string, secure bool) (boo ev.success = false } - es.add(ev) + es.add(ctx, ev) return cfg, err } -func (es eventStore) ChangeState(token, id string, state bootstrap.State) error { - if err := es.svc.ChangeState(token, id, state); err != nil { +func (es eventStore) ChangeState(ctx context.Context, token, id string, state bootstrap.State) error { + if err := es.svc.ChangeState(ctx, token, id, state); err != nil { return err } @@ -146,33 +147,33 @@ func (es eventStore) ChangeState(token, id string, state bootstrap.State) error timestamp: time.Now(), } - es.add(ev) + es.add(ctx, ev) return nil } -func (es eventStore) RemoveConfigHandler(id string) error { - return es.svc.RemoveConfigHandler(id) +func (es eventStore) RemoveConfigHandler(ctx context.Context, id string) error { + return es.svc.RemoveConfigHandler(ctx, id) } -func (es eventStore) RemoveChannelHandler(id string) error { - return es.svc.RemoveChannelHandler(id) +func (es eventStore) RemoveChannelHandler(ctx context.Context, id string) error { + return es.svc.RemoveChannelHandler(ctx, id) } -func (es eventStore) UpdateChannelHandler(channel bootstrap.Channel) error { - return es.UpdateChannelHandler(channel) +func (es eventStore) UpdateChannelHandler(ctx context.Context, channel bootstrap.Channel) error { + return es.UpdateChannelHandler(ctx, channel) } -func (es eventStore) DisconnectThingHandler(channelID, thingID string) error { - return es.svc.DisconnectThingHandler(channelID, thingID) +func (es eventStore) DisconnectThingHandler(ctx context.Context, channelID, thingID string) error { + return es.svc.DisconnectThingHandler(ctx, channelID, thingID) } -func (es eventStore) add(ev event) error { +func (es eventStore) add(ctx context.Context, ev event) error { record := &redis.XAddArgs{ Stream: streamID, MaxLenApprox: streamLen, Values: ev.encode(), } - return es.client.XAdd(record).Err() + return es.client.XAdd(ctx, record).Err() } diff --git a/bootstrap/redis/producer/streams_test.go b/bootstrap/redis/producer/streams_test.go index 9c384b2272..b22454a956 100644 --- a/bootstrap/redis/producer/streams_test.go +++ b/bootstrap/redis/producer/streams_test.go @@ -4,6 +4,7 @@ package producer_test import ( + "context" "fmt" "net/http/httptest" "strconv" @@ -11,7 +12,7 @@ import ( "testing" "time" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" "github.com/mainflux/mainflux/pkg/errors" "github.com/opentracing/opentracing-go/mocktracer" @@ -90,7 +91,7 @@ func newThingsServer(svc things.Service) *httptest.Server { return httptest.NewServer(mux) } func TestAdd(t *testing.T) { - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() users := mocks.NewUsersService(map[string]string{validToken: email}) server := newThingsServer(newThingsService(users)) @@ -139,10 +140,10 @@ func TestAdd(t *testing.T) { lastID := "0" for _, tc := range cases { - _, err := svc.Add(tc.token, tc.config) + _, err := svc.Add(context.Background(), tc.token, tc.config) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&redis.XReadArgs{ + streams := redisClient.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -164,20 +165,20 @@ func TestView(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - svcConfig, svcErr := svc.View(validToken, saved.MFThing) + svcConfig, svcErr := svc.View(context.Background(), validToken, saved.MFThing) svc = producer.NewEventStoreMiddleware(svc, redisClient) - esConfig, esErr := svc.View(validToken, saved.MFThing) + esConfig, esErr := svc.View(context.Background(), validToken, saved.MFThing) assert.Equal(t, svcConfig, esConfig, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", svcConfig, esConfig)) assert.Equal(t, svcErr, esErr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", svcErr, esErr)) } func TestUpdate(t *testing.T) { - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() users := mocks.NewUsersService(map[string]string{validToken: email}) server := newThingsServer(newThingsService(users)) @@ -189,9 +190,9 @@ func TestUpdate(t *testing.T) { ch := channel ch.ID = "2" c.MFChannels = append(c.MFChannels, ch) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() modified := saved modified.Content = "new-config" @@ -231,10 +232,10 @@ func TestUpdate(t *testing.T) { lastID := "0" for _, tc := range cases { - err := svc.Update(tc.token, tc.config) + err := svc.Update(context.Background(), tc.token, tc.config) assert.Equal(t, tc.err, err, fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&redis.XReadArgs{ + streams := redisClient.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -252,16 +253,16 @@ func TestUpdate(t *testing.T) { } func TestUpdateConnections(t *testing.T) { - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() users := mocks.NewUsersService(map[string]string{validToken: email}) server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) svc = producer.NewEventStoreMiddleware(svc, redisClient) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() cases := []struct { desc string @@ -296,10 +297,10 @@ func TestUpdateConnections(t *testing.T) { lastID := "0" for _, tc := range cases { - err := svc.UpdateConnections(tc.token, tc.id, tc.connections) + err := svc.UpdateConnections(context.Background(), tc.token, tc.id, tc.connections) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&redis.XReadArgs{ + streams := redisClient.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -320,22 +321,22 @@ func TestList(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - _, err := svc.Add(validToken, config) + _, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) offset := uint64(0) limit := uint64(10) - svcConfigs, svcErr := svc.List(validToken, bootstrap.Filter{}, offset, limit) + svcConfigs, svcErr := svc.List(context.Background(), validToken, bootstrap.Filter{}, offset, limit) svc = producer.NewEventStoreMiddleware(svc, redisClient) - esConfigs, esErr := svc.List(validToken, bootstrap.Filter{}, offset, limit) + esConfigs, esErr := svc.List(context.Background(), validToken, bootstrap.Filter{}, offset, limit) assert.Equal(t, svcConfigs, esConfigs, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", svcConfigs, esConfigs)) assert.Equal(t, svcErr, esErr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", svcErr, esErr)) } func TestRemove(t *testing.T) { - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() users := mocks.NewUsersService(map[string]string{validToken: email}) server := newThingsServer(newThingsService(users)) @@ -344,9 +345,9 @@ func TestRemove(t *testing.T) { c := config - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() cases := []struct { desc string @@ -377,10 +378,10 @@ func TestRemove(t *testing.T) { lastID := "0" for _, tc := range cases { - err := svc.Remove(tc.token, tc.id) + err := svc.Remove(context.Background(), tc.token, tc.id) assert.Equal(t, tc.err, err, fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&redis.XReadArgs{ + streams := redisClient.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -398,7 +399,7 @@ func TestRemove(t *testing.T) { } func TestBootstrap(t *testing.T) { - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() users := mocks.NewUsersService(map[string]string{validToken: email}) server := newThingsServer(newThingsService(users)) @@ -407,9 +408,9 @@ func TestBootstrap(t *testing.T) { c := config - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() cases := []struct { desc string @@ -446,10 +447,10 @@ func TestBootstrap(t *testing.T) { lastID := "0" for _, tc := range cases { - _, err := svc.Bootstrap(tc.externalKey, tc.externalID, false) + _, err := svc.Bootstrap(context.Background(), tc.externalKey, tc.externalID, false) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&redis.XReadArgs{ + streams := redisClient.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -467,7 +468,7 @@ func TestBootstrap(t *testing.T) { } func TestChangeState(t *testing.T) { - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() users := mocks.NewUsersService(map[string]string{validToken: email}) server := newThingsServer(newThingsService(users)) @@ -476,9 +477,9 @@ func TestChangeState(t *testing.T) { c := config - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - redisClient.FlushAll().Err() + redisClient.FlushAll(context.Background()).Err() cases := []struct { desc string @@ -513,10 +514,10 @@ func TestChangeState(t *testing.T) { lastID := "0" for _, tc := range cases { - err := svc.ChangeState(tc.token, tc.id, tc.state) + err := svc.ChangeState(context.Background(), tc.token, tc.id, tc.state) assert.Equal(t, tc.err, err, fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&redis.XReadArgs{ + streams := redisClient.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, diff --git a/bootstrap/service.go b/bootstrap/service.go index f14ab8e179..d91160b8e5 100644 --- a/bootstrap/service.go +++ b/bootstrap/service.go @@ -63,48 +63,48 @@ var _ Service = (*bootstrapService)(nil) // implementation, and all of its decorators (e.g. logging & metrics). type Service interface { // Add adds new Thing Config to the user identified by the provided token. - Add(token string, cfg Config) (Config, error) + Add(ctx context.Context, token string, cfg Config) (Config, error) // View returns Thing Config with given ID belonging to the user identified by the given token. - View(token, id string) (Config, error) + View(ctx context.Context, token, id string) (Config, error) // Update updates editable fields of the provided Config. - Update(token string, cfg Config) error + Update(ctx context.Context, token string, cfg Config) error // UpdateCert updates an existing Config certificate and token. // A non-nil error is returned to indicate operation failure. - UpdateCert(token, thingID, clientCert, clientKey, caCert string) error + UpdateCert(ctx context.Context, token, thingID, clientCert, clientKey, caCert string) error // UpdateConnections updates list of Channels related to given Config. - UpdateConnections(token, id string, connections []string) error + UpdateConnections(ctx context.Context, token, id string, connections []string) error // List returns subset of Configs with given search params that belong to the // user identified by the given token. - List(token string, filter Filter, offset, limit uint64) (ConfigsPage, error) + List(ctx context.Context, token string, filter Filter, offset, limit uint64) (ConfigsPage, error) // Remove removes Config with specified token that belongs to the user identified by the given token. - Remove(token, id string) error + Remove(ctx context.Context, token, id string) error // Bootstrap returns Config to the Thing with provided external ID using external key. - Bootstrap(externalKey, externalID string, secure bool) (Config, error) + Bootstrap(ctx context.Context, externalKey, externalID string, secure bool) (Config, error) // ChangeState changes state of the Thing with given ID and owner. - ChangeState(token, id string, state State) error + ChangeState(ctx context.Context, token, id string, state State) error // Methods RemoveConfig, UpdateChannel, and RemoveChannel are used as // handlers for events. That's why these methods surpass ownership check. // UpdateChannelHandler updates Channel with data received from an event. - UpdateChannelHandler(channel Channel) error + UpdateChannelHandler(ctx context.Context, channel Channel) error // RemoveConfigHandler removes Configuration with id received from an event. - RemoveConfigHandler(id string) error + RemoveConfigHandler(ctx context.Context, id string) error // RemoveChannelHandler removes Channel with id received from an event. - RemoveChannelHandler(id string) error + RemoveChannelHandler(ctx context.Context, id string) error // DisconnectHandler changes state of the Config when connect/disconnect event occurs. - DisconnectThingHandler(channelID, thingID string) error + DisconnectThingHandler(ctx context.Context, channelID, thingID string) error } // ConfigReader is used to parse Config into format which will be encoded @@ -133,7 +133,7 @@ func New(auth mainflux.AuthServiceClient, configs ConfigRepository, sdk mfsdk.SD } } -func (bs bootstrapService) Add(token string, cfg Config) (Config, error) { +func (bs bootstrapService) Add(ctx context.Context, token string, cfg Config) (Config, error) { owner, err := bs.identify(token) if err != nil { return Config{}, err @@ -180,7 +180,7 @@ func (bs bootstrapService) Add(token string, cfg Config) (Config, error) { return cfg, nil } -func (bs bootstrapService) View(token, id string) (Config, error) { +func (bs bootstrapService) View(ctx context.Context, token, id string) (Config, error) { owner, err := bs.identify(token) if err != nil { return Config{}, err @@ -189,7 +189,7 @@ func (bs bootstrapService) View(token, id string) (Config, error) { return bs.configs.RetrieveByID(owner, id) } -func (bs bootstrapService) Update(token string, cfg Config) error { +func (bs bootstrapService) Update(ctx context.Context, token string, cfg Config) error { owner, err := bs.identify(token) if err != nil { return err @@ -200,7 +200,7 @@ func (bs bootstrapService) Update(token string, cfg Config) error { return bs.configs.Update(cfg) } -func (bs bootstrapService) UpdateCert(token, thingID, clientCert, clientKey, caCert string) error { +func (bs bootstrapService) UpdateCert(ctx context.Context, token, thingID, clientCert, clientKey, caCert string) error { owner, err := bs.identify(token) if err != nil { return err @@ -211,7 +211,7 @@ func (bs bootstrapService) UpdateCert(token, thingID, clientCert, clientKey, caC return nil } -func (bs bootstrapService) UpdateConnections(token, id string, connections []string) error { +func (bs bootstrapService) UpdateConnections(ctx context.Context, token, id string, connections []string) error { owner, err := bs.identify(token) if err != nil { return err @@ -268,7 +268,7 @@ func (bs bootstrapService) UpdateConnections(token, id string, connections []str return bs.configs.UpdateConnections(owner, id, channels, connections) } -func (bs bootstrapService) List(token string, filter Filter, offset, limit uint64) (ConfigsPage, error) { +func (bs bootstrapService) List(ctx context.Context, token string, filter Filter, offset, limit uint64) (ConfigsPage, error) { owner, err := bs.identify(token) if err != nil { return ConfigsPage{}, err @@ -277,7 +277,7 @@ func (bs bootstrapService) List(token string, filter Filter, offset, limit uint6 return bs.configs.RetrieveAll(owner, filter, offset, limit), nil } -func (bs bootstrapService) Remove(token, id string) error { +func (bs bootstrapService) Remove(ctx context.Context, token, id string) error { owner, err := bs.identify(token) if err != nil { return err @@ -288,7 +288,7 @@ func (bs bootstrapService) Remove(token, id string) error { return nil } -func (bs bootstrapService) Bootstrap(externalKey, externalID string, secure bool) (Config, error) { +func (bs bootstrapService) Bootstrap(ctx context.Context, externalKey, externalID string, secure bool) (Config, error) { cfg, err := bs.configs.RetrieveByExternalID(externalID) if err != nil { return cfg, errors.Wrap(ErrBootstrap, err) @@ -309,7 +309,7 @@ func (bs bootstrapService) Bootstrap(externalKey, externalID string, secure bool return cfg, nil } -func (bs bootstrapService) ChangeState(token, id string, state State) error { +func (bs bootstrapService) ChangeState(ctx context.Context, token, id string, state State) error { owner, err := bs.identify(token) if err != nil { return err @@ -351,28 +351,28 @@ func (bs bootstrapService) ChangeState(token, id string, state State) error { return nil } -func (bs bootstrapService) UpdateChannelHandler(channel Channel) error { +func (bs bootstrapService) UpdateChannelHandler(ctx context.Context, channel Channel) error { if err := bs.configs.UpdateChannel(channel); err != nil { return errors.Wrap(errUpdateChannel, err) } return nil } -func (bs bootstrapService) RemoveConfigHandler(id string) error { +func (bs bootstrapService) RemoveConfigHandler(ctx context.Context, id string) error { if err := bs.configs.RemoveThing(id); err != nil { return errors.Wrap(errRemoveConfig, err) } return nil } -func (bs bootstrapService) RemoveChannelHandler(id string) error { +func (bs bootstrapService) RemoveChannelHandler(ctx context.Context, id string) error { if err := bs.configs.RemoveChannel(id); err != nil { return errors.Wrap(errRemoveChannel, err) } return nil } -func (bs bootstrapService) DisconnectThingHandler(channelID, thingID string) error { +func (bs bootstrapService) DisconnectThingHandler(ctx context.Context, channelID, thingID string) error { if err := bs.configs.DisconnectThing(channelID, thingID); err != nil { return errors.Wrap(errDisconnectThing, err) } diff --git a/bootstrap/service_test.go b/bootstrap/service_test.go index ed91854318..d365dc8ab9 100644 --- a/bootstrap/service_test.go +++ b/bootstrap/service_test.go @@ -4,6 +4,7 @@ package bootstrap_test import ( + "context" "crypto/aes" "crypto/cipher" "crypto/rand" @@ -144,7 +145,7 @@ func TestAdd(t *testing.T) { } for _, tc := range cases { - _, err := svc.Add(tc.token, tc.config) + _, err := svc.Add(context.Background(), tc.token, tc.config) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -155,7 +156,7 @@ func TestView(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -185,7 +186,7 @@ func TestView(t *testing.T) { } for _, tc := range cases { - _, err := svc.View(tc.token, tc.id) + _, err := svc.View(context.Background(), tc.token, tc.id) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -200,7 +201,7 @@ func TestUpdate(t *testing.T) { ch := channel ch.ID = "2" c.MFChannels = append(c.MFChannels, ch) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) modifiedCreated := saved @@ -237,7 +238,7 @@ func TestUpdate(t *testing.T) { } for _, tc := range cases { - err := svc.Update(tc.token, tc.config) + err := svc.Update(context.Background(), tc.token, tc.config) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -252,7 +253,7 @@ func TestUpdateCert(t *testing.T) { ch := channel ch.ID = "2" c.MFChannels = append(c.MFChannels, ch) - saved, err := svc.Add(validToken, c) + saved, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -295,7 +296,7 @@ func TestUpdateCert(t *testing.T) { } for _, tc := range cases { - err := svc.UpdateCert(tc.token, tc.thingKey, tc.clientCert, tc.clientKey, tc.caCert) + err := svc.UpdateCert(context.Background(), tc.token, tc.thingKey, tc.clientCert, tc.clientKey, tc.caCert) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -310,15 +311,15 @@ func TestUpdateConnections(t *testing.T) { ch := channel ch.ID = "2" c.MFChannels = append(c.MFChannels, ch) - created, err := svc.Add(validToken, c) + created, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) externalID, err := uuid.NewV4() require.Nil(t, err, fmt.Sprintf("Got unexpected error: %s.\n", err)) c.ExternalID = externalID.String() - active, err := svc.Add(validToken, c) + active, err := svc.Add(context.Background(), validToken, c) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) - err = svc.ChangeState(validToken, active.MFThing, bootstrap.Active) + err = svc.ChangeState(context.Background(), validToken, active.MFThing, bootstrap.Active) require.Nil(t, err, fmt.Sprintf("Changing state expected to succeed: %s.\n", err)) nonExisting := config @@ -369,7 +370,7 @@ func TestUpdateConnections(t *testing.T) { } for _, tc := range cases { - err := svc.UpdateConnections(tc.token, tc.id, tc.connections) + err := svc.UpdateConnections(context.Background(), tc.token, tc.id, tc.connections) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -389,12 +390,12 @@ func TestList(t *testing.T) { c.ExternalID = id.String() c.ExternalKey = id.String() c.Name = fmt.Sprintf("%s-%d", config.Name, i) - s, err := svc.Add(validToken, c) + s, err := svc.Add(context.Background(), validToken, c) saved = append(saved, s) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) } // Set one Thing to the different state - err := svc.ChangeState(validToken, "42", bootstrap.Active) + err := svc.ChangeState(context.Background(), validToken, "42", bootstrap.Active) require.Nil(t, err, fmt.Sprintf("Changing config state expected to succeed: %s.\n", err)) saved[41].State = bootstrap.Active @@ -475,7 +476,7 @@ func TestList(t *testing.T) { } for _, tc := range cases { - result, err := svc.List(tc.token, tc.filter, tc.offset, tc.limit) + result, err := svc.List(context.Background(), tc.token, tc.filter, tc.offset, tc.limit) assert.ElementsMatch(t, tc.config.Configs, result.Configs, fmt.Sprintf("%s: expected %v got %v", tc.desc, tc.config.Configs, result.Configs)) assert.Equal(t, tc.config.Total, result.Total, fmt.Sprintf("%s: expected %v got %v", tc.desc, tc.config.Total, result.Total)) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) @@ -488,7 +489,7 @@ func TestRemove(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -524,7 +525,7 @@ func TestRemove(t *testing.T) { } for _, tc := range cases { - err := svc.Remove(tc.token, tc.id) + err := svc.Remove(context.Background(), tc.token, tc.id) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -535,7 +536,7 @@ func TestBootstrap(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) e, err := enc([]byte(saved.ExternalKey)) @@ -584,7 +585,7 @@ func TestBootstrap(t *testing.T) { } for _, tc := range cases { - config, err := svc.Bootstrap(tc.externalKey, tc.externalID, tc.encrypted) + config, err := svc.Bootstrap(context.Background(), tc.externalKey, tc.externalID, tc.encrypted) assert.Equal(t, tc.config, config, fmt.Sprintf("%s: expected %v got %v\n", tc.desc, tc.config, config)) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } @@ -596,7 +597,7 @@ func TestChangeState(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -644,7 +645,7 @@ func TestChangeState(t *testing.T) { } for _, tc := range cases { - err := svc.ChangeState(tc.token, tc.id, tc.state) + err := svc.ChangeState(context.Background(), tc.token, tc.id, tc.state) assert.True(t, errors.Contains(err, tc.err), err, fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -655,7 +656,7 @@ func TestUpdateChannelHandler(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - _, err := svc.Add(validToken, config) + _, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) ch := bootstrap.Channel{ ID: channel.ID, @@ -681,7 +682,7 @@ func TestUpdateChannelHandler(t *testing.T) { } for _, tc := range cases { - err := svc.UpdateChannelHandler(tc.channel) + err := svc.UpdateChannelHandler(context.Background(), tc.channel) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -692,7 +693,7 @@ func TestRemoveChannelHandler(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - _, err := svc.Add(validToken, config) + _, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -713,7 +714,7 @@ func TestRemoveChannelHandler(t *testing.T) { } for _, tc := range cases { - err := svc.RemoveChannelHandler(tc.id) + err := svc.RemoveChannelHandler(context.Background(), tc.id) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -724,7 +725,7 @@ func TestRemoveCoinfigHandler(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -745,7 +746,7 @@ func TestRemoveCoinfigHandler(t *testing.T) { } for _, tc := range cases { - err := svc.RemoveConfigHandler(tc.id) + err := svc.RemoveConfigHandler(context.Background(), tc.id) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } @@ -756,7 +757,7 @@ func TestDisconnectThingsHandler(t *testing.T) { server := newThingsServer(newThingsService(users)) svc := newService(users, server.URL) - saved, err := svc.Add(validToken, config) + saved, err := svc.Add(context.Background(), validToken, config) require.Nil(t, err, fmt.Sprintf("Saving config expected to succeed: %s.\n", err)) cases := []struct { @@ -780,7 +781,7 @@ func TestDisconnectThingsHandler(t *testing.T) { } for _, tc := range cases { - err := svc.DisconnectThingHandler(tc.channelID, tc.thingID) + err := svc.DisconnectThingHandler(context.Background(), tc.channelID, tc.thingID) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } diff --git a/cmd/bootstrap/main.go b/cmd/bootstrap/main.go index 10593efc1a..1166d783e2 100644 --- a/cmd/bootstrap/main.go +++ b/cmd/bootstrap/main.go @@ -3,6 +3,7 @@ package main import ( + "context" "crypto/aes" "encoding/hex" "fmt" @@ -23,7 +24,7 @@ import ( opentracing "github.com/opentracing/opentracing-go" kitprometheus "github.com/go-kit/kit/metrics/prometheus" - r "github.com/go-redis/redis" + r "github.com/go-redis/redis/v8" "github.com/jmoiron/sqlx" "github.com/mainflux/mainflux" "github.com/mainflux/mainflux/bootstrap" @@ -335,7 +336,7 @@ func startHTTPServer(svc bootstrap.Service, cfg config, logger mflog.Logger, err func subscribeToThingsES(svc bootstrap.Service, client *r.Client, consumer string, logger mflog.Logger) { eventStore := rediscons.NewEventStore(svc, client, consumer, logger) logger.Info("Subscribed to Redis Event Store") - if err := eventStore.Subscribe("mainflux.things"); err != nil { + if err := eventStore.Subscribe(context.Background(), "mainflux.things"); err != nil { logger.Warn(fmt.Sprintf("Bootstrap service failed to subscribe to event sourcing: %s", err)) } } diff --git a/cmd/certs/main.go b/cmd/certs/main.go index ff8c100cf3..e3cfa6bde8 100644 --- a/cmd/certs/main.go +++ b/cmd/certs/main.go @@ -17,7 +17,7 @@ import ( "time" kitprometheus "github.com/go-kit/kit/metrics/prometheus" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" authapi "github.com/mainflux/mainflux/auth/api/grpc" "github.com/mainflux/mainflux/certs" diff --git a/cmd/lora/main.go b/cmd/lora/main.go index ef7901be63..d15e629c86 100644 --- a/cmd/lora/main.go +++ b/cmd/lora/main.go @@ -4,6 +4,7 @@ package main import ( + "context" "encoding/json" "fmt" "log" @@ -14,7 +15,7 @@ import ( "syscall" "time" - r "github.com/go-redis/redis" + r "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" "github.com/mainflux/mainflux/logger" "github.com/mainflux/mainflux/lora" @@ -186,7 +187,7 @@ func subscribeToLoRaBroker(svc lora.Service, msub messaging.Subscriber, logger l logger.Warn(fmt.Sprintf("Failed to Unmarshal message: %s", err.Error())) return err } - if err := svc.Publish(m); err != nil { + if err := svc.Publish(context.Background(), m); err != nil { return err } return nil @@ -201,7 +202,7 @@ func subscribeToLoRaBroker(svc lora.Service, msub messaging.Subscriber, logger l func subscribeToThingsES(svc lora.Service, client *r.Client, consumer string, logger logger.Logger) { eventStore := redis.NewEventStore(svc, client, consumer, logger) logger.Info("Subscribed to Redis Event Store") - if err := eventStore.Subscribe("mainflux.things"); err != nil { + if err := eventStore.Subscribe(context.Background(), "mainflux.things"); err != nil { logger.Warn(fmt.Sprintf("LoRa-adapter service failed to subscribe to Redis event source: %s", err)) } } diff --git a/cmd/mqtt/main.go b/cmd/mqtt/main.go index ed3a5d7b15..a576989295 100644 --- a/cmd/mqtt/main.go +++ b/cmd/mqtt/main.go @@ -13,7 +13,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" mflog "github.com/mainflux/mainflux/logger" "github.com/mainflux/mainflux/mqtt" diff --git a/cmd/opcua/main.go b/cmd/opcua/main.go index 561311b202..fc90fe7352 100644 --- a/cmd/opcua/main.go +++ b/cmd/opcua/main.go @@ -13,7 +13,7 @@ import ( "strconv" "syscall" - r "github.com/go-redis/redis" + r "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" "github.com/mainflux/mainflux/logger" "github.com/mainflux/mainflux/opcua" @@ -191,7 +191,7 @@ func subscribeToStoredSubs(sub opcua.Subscriber, cfg opcua.Config, logger logger cfg.ServerURI = n.ServerURI cfg.NodeID = n.NodeID go func() { - if err := sub.Subscribe(cfg); err != nil { + if err := sub.Subscribe(context.Background(), cfg); err != nil { logger.Warn(fmt.Sprintf("Subscription failed: %s", err)) } }() @@ -199,14 +199,14 @@ func subscribeToStoredSubs(sub opcua.Subscriber, cfg opcua.Config, logger logger } func subscribeToOpcuaServer(gc opcua.Subscriber, cfg opcua.Config, logger logger.Logger) { - if err := gc.Subscribe(cfg); err != nil { + if err := gc.Subscribe(context.Background(), cfg); err != nil { logger.Warn(fmt.Sprintf("OPC-UA Subscription failed: %s", err)) } } func subscribeToThingsES(svc opcua.Service, client *r.Client, prefix string, logger logger.Logger) { eventStore := redis.NewEventStore(svc, client, prefix, logger) - if err := eventStore.Subscribe("mainflux.things"); err != nil { + if err := eventStore.Subscribe(context.Background(), "mainflux.things"); err != nil { logger.Warn(fmt.Sprintf("Failed to subscribe to Redis event source: %s", err)) } } diff --git a/cmd/things/main.go b/cmd/things/main.go index 25f1ec6b30..a5cddccd1c 100644 --- a/cmd/things/main.go +++ b/cmd/things/main.go @@ -23,7 +23,7 @@ import ( "google.golang.org/grpc/credentials" kitprometheus "github.com/go-kit/kit/metrics/prometheus" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" authapi "github.com/mainflux/mainflux/auth/api/grpc" "github.com/mainflux/mainflux/logger" diff --git a/cmd/twins/main.go b/cmd/twins/main.go index 8cfcc280e8..ca435d093a 100644 --- a/cmd/twins/main.go +++ b/cmd/twins/main.go @@ -16,7 +16,7 @@ import ( "time" kitprometheus "github.com/go-kit/kit/metrics/prometheus" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" authapi "github.com/mainflux/mainflux/auth/api/grpc" "github.com/mainflux/mainflux/logger" diff --git a/consumers/messages.go b/consumers/messages.go index 4f5c86204c..e30cf0813a 100644 --- a/consumers/messages.go +++ b/consumers/messages.go @@ -7,7 +7,8 @@ import ( "fmt" "io/ioutil" - "github.com/BurntSushi/toml" + "github.com/pelletier/go-toml" + "github.com/mainflux/mainflux/logger" "github.com/mainflux/mainflux/pkg/errors" "github.com/mainflux/mainflux/pkg/messaging" diff --git a/consumers/writers/cassandra/setup_test.go b/consumers/writers/cassandra/setup_test.go index 4de0322d1f..0ef83b9c75 100644 --- a/consumers/writers/cassandra/setup_test.go +++ b/consumers/writers/cassandra/setup_test.go @@ -22,7 +22,7 @@ func TestMain(m *testing.M) { logger.Error(fmt.Sprintf("Could not connect to docker: %s", err)) } - container, err := pool.Run("cassandra", "3.11.9", []string{}) + container, err := pool.Run("cassandra", "3.11.10", []string{}) if err != nil { logger.Error(fmt.Sprintf("Could not start container: %s", err)) } diff --git a/consumers/writers/influxdb/setup_test.go b/consumers/writers/influxdb/setup_test.go index 14a824e52a..e2b92cfd9e 100644 --- a/consumers/writers/influxdb/setup_test.go +++ b/consumers/writers/influxdb/setup_test.go @@ -24,7 +24,7 @@ func TestMain(m *testing.M) { "INFLUXDB_USER_PASSWORD=test", "INFLUXDB_DB=test", } - container, err := pool.Run("influxdb", "1.8.4", cfg) + container, err := pool.Run("influxdb", "1.8.5", cfg) if err != nil { testLog.Error(fmt.Sprintf("Could not start container: %s", err)) } diff --git a/consumers/writers/mongodb/setup_test.go b/consumers/writers/mongodb/setup_test.go index 3c881dab13..d08d818c2a 100644 --- a/consumers/writers/mongodb/setup_test.go +++ b/consumers/writers/mongodb/setup_test.go @@ -25,7 +25,7 @@ func TestMain(m *testing.M) { "MONGO_INITDB_DATABASE=test", } - container, err := pool.Run("mongo", "4.4.3-bionic", cfg) + container, err := pool.Run("mongo", "4.4.6", cfg) if err != nil { testLog.Error(fmt.Sprintf("Could not start container: %s", err)) } diff --git a/consumers/writers/postgres/setup_test.go b/consumers/writers/postgres/setup_test.go index 762b74ced2..5af8929b6c 100644 --- a/consumers/writers/postgres/setup_test.go +++ b/consumers/writers/postgres/setup_test.go @@ -29,7 +29,7 @@ func TestMain(m *testing.M) { "POSTGRES_PASSWORD=test", "POSTGRES_DB=test", } - container, err := pool.Run("postgres", "10.8-alpine", cfg) + container, err := pool.Run("postgres", "13.3-alpine", cfg) if err != nil { log.Fatalf("Could not start container: %s", err) } diff --git a/docker/addons/bootstrap/docker-compose.yml b/docker/addons/bootstrap/docker-compose.yml index 16e9a7091f..f117c38db7 100644 --- a/docker/addons/bootstrap/docker-compose.yml +++ b/docker/addons/bootstrap/docker-compose.yml @@ -17,7 +17,7 @@ volumes: services: bootstrap-db: - image: postgres:10.8-alpine + image: postgres:13.3-alpine container_name: mainflux-bootstrap-db restart: on-failure environment: diff --git a/docker/addons/cassandra-writer/docker-compose.yml b/docker/addons/cassandra-writer/docker-compose.yml index 3b6d2f3cce..f333042f4f 100644 --- a/docker/addons/cassandra-writer/docker-compose.yml +++ b/docker/addons/cassandra-writer/docker-compose.yml @@ -17,7 +17,7 @@ volumes: services: cassandra: - image: cassandra:3.11.9 + image: cassandra:3.11.10 container_name: mainflux-cassandra restart: on-failure networks: diff --git a/docker/addons/cassandra-writer/init.sh b/docker/addons/cassandra-writer/init.sh index d5c19149e7..944389cf6e 100755 --- a/docker/addons/cassandra-writer/init.sh +++ b/docker/addons/cassandra-writer/init.sh @@ -1,3 +1,3 @@ -docker-compose -f docker/addons/cassandra-writer/docker-compose.yml up -d +docker-compose -f docker/addons/cassandra-writer/docker-compose.yml --env-file docker/.env up -d sleep 20 docker exec mainflux-cassandra cqlsh -e "CREATE KEYSPACE IF NOT EXISTS mainflux WITH replication = {'class':'SimpleStrategy','replication_factor':'1'};" diff --git a/docker/addons/influxdb-writer/docker-compose.yml b/docker/addons/influxdb-writer/docker-compose.yml index ede9ec8388..50c8ee40e7 100644 --- a/docker/addons/influxdb-writer/docker-compose.yml +++ b/docker/addons/influxdb-writer/docker-compose.yml @@ -18,7 +18,7 @@ volumes: services: influxdb: - image: influxdb:1.8.4 + image: influxdb:1.8.5 container_name: mainflux-influxdb restart: on-failure environment: diff --git a/docker/addons/mongodb-writer/docker-compose.yml b/docker/addons/mongodb-writer/docker-compose.yml index a34e9bce82..f85c10587f 100644 --- a/docker/addons/mongodb-writer/docker-compose.yml +++ b/docker/addons/mongodb-writer/docker-compose.yml @@ -20,7 +20,7 @@ volumes: services: mongodb: - image: mongo:4.4.3-bionic + image: mongo:4.4.6 container_name: mainflux-mongodb restart: on-failure environment: diff --git a/docker/addons/postgres-writer/docker-compose.yml b/docker/addons/postgres-writer/docker-compose.yml index b02c015ac1..17a80af2d9 100644 --- a/docker/addons/postgres-writer/docker-compose.yml +++ b/docker/addons/postgres-writer/docker-compose.yml @@ -19,7 +19,7 @@ volumes: services: postgres: - image: postgres:10.8-alpine + image: postgres:13.3-alpine container_name: mainflux-postgres restart: on-failure environment: diff --git a/go.mod b/go.mod index a5188623e6..700a2b5343 100644 --- a/go.mod +++ b/go.mod @@ -3,51 +3,46 @@ module github.com/mainflux/mainflux go 1.14 require ( - github.com/BurntSushi/toml v0.3.1 github.com/cenkalti/backoff/v4 v4.1.0 github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/docker/docker v1.13.1 - github.com/eclipse/paho.mqtt.golang v1.2.0 - github.com/fatih/color v1.9.0 + github.com/docker/docker v20.10.6+incompatible + github.com/eclipse/paho.mqtt.golang v1.3.4 + github.com/fatih/color v1.10.0 github.com/go-kit/kit v0.10.0 - github.com/go-redis/redis v6.15.8+incompatible + github.com/go-redis/redis/v8 v8.8.2 github.com/go-zoo/bone v1.3.0 - github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e - github.com/gofrs/uuid v3.3.0+incompatible - github.com/gogo/protobuf v1.3.1 - github.com/golang/protobuf v1.4.2 + github.com/gocql/gocql v0.0.0-20210504150947-558dfae50b5d + github.com/gofrs/uuid v4.0.0+incompatible + github.com/gogo/protobuf v1.3.2 + github.com/golang/protobuf v1.4.3 github.com/gopcua/opcua v0.1.6 - github.com/hashicorp/vault/api v1.0.4 - github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e - github.com/influxdata/influxdb v1.8.1 - github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5 + github.com/hashicorp/vault/api v1.1.0 + github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 + github.com/influxdata/influxdb v1.8.5 + github.com/jmoiron/sqlx v1.3.3 github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.7.0 + github.com/lib/pq v1.10.1 github.com/mainflux/mproxy v0.2.2 github.com/mainflux/senml v1.5.0 - github.com/mitchellh/mapstructure v1.1.2 - github.com/nats-io/nats.go v1.10.0 - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/mitchellh/mapstructure v1.4.1 + github.com/nats-io/nats.go v1.11.0 github.com/oklog/ulid/v2 v2.0.2 - github.com/onsi/ginkgo v1.12.0 // indirect - github.com/onsi/gomega v1.9.0 // indirect github.com/opentracing/opentracing-go v1.2.0 - github.com/ory/dockertest/v3 v3.6.0 - github.com/pelletier/go-toml v1.8.0 - github.com/plgd-dev/go-coap/v2 v2.0.4 - github.com/prometheus/client_golang v1.7.1 - github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351 - github.com/spf13/cobra v1.0.0 - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.7.0 - github.com/stretchr/testify v1.6.1 + github.com/ory/dockertest/v3 v3.6.5 + github.com/pelletier/go-toml v1.9.1 + github.com/plgd-dev/go-coap/v2 v2.4.0 + github.com/prometheus/client_golang v1.10.0 + github.com/rubenv/sql-migrate v0.0.0-20210408115534-a32ed26c37ea + github.com/spf13/cobra v1.1.3 + github.com/spf13/viper v1.7.1 + github.com/stretchr/testify v1.7.0 github.com/subosito/gotenv v1.2.0 - github.com/uber/jaeger-client-go v2.24.0+incompatible - go.mongodb.org/mongo-driver v1.3.5 - golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 - golang.org/x/net v0.0.0-20200707034311-ab3426394381 - golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770 // indirect - gonum.org/v1/gonum v0.7.0 - google.golang.org/grpc v1.30.0 - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + github.com/uber/jaeger-client-go v2.28.0+incompatible + go.mongodb.org/mongo-driver v1.4.0-beta2.0.20210512200446-5f449ba049cc + golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b + golang.org/x/net v0.0.0-20210510120150-4163338589ed + golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect + golang.org/x/tools v0.1.0 // indirect + gonum.org/v1/gonum v0.9.1 + google.golang.org/grpc v1.36.0 ) diff --git a/go.sum b/go.sum index 2c5f298a28..d6ec46f212 100644 --- a/go.sum +++ b/go.sum @@ -19,15 +19,17 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.4.7 h1:vOvDiY/F1avSWlCWiKJjdYKz2jVjTK3pWPHndeG4OAY= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.7/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -44,7 +46,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= @@ -53,13 +55,14 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -72,14 +75,12 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/casbin/casbin/v2 v2.1.2 h1:bTwon/ECRx9dwBy2ewRVr5OiqjeXSGiTUY74sDPQi/g= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.0.0+incompatible h1:5IIPUHhlnUZbcHQsQou5k1Tn58nJkeJL9U+ig5CHJbY= github.com/cenkalti/backoff v2.0.0+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= 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/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc= github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -91,13 +92,15 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +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/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/continuity v0.0.0-20180416230128-c6cef3483023 h1:ydDbSX89iFHufaVN8xlS22aWpajSFfmXL+fQNWnhrIg= github.com/containerd/continuity v0.0.0-20180416230128-c6cef3483023/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -116,54 +119,58 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= 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/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0 h1:epsH3lb7KVbXHYk7LYGN5EiE0MxcevHU85CKITJ0wUY= github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= 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/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo= github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.3.0 h1:3lOnM9cSzgGwx8VfK/NGOW5fLQ0GjIlCkaktF+n1M6o= +github.com/docker/docker v20.10.6+incompatible h1:oXI3Vas8TI8Eu/EjH4srKHJBVqraSzJybhxY7Om9faQ= +github.com/docker/docker v20.10.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dsnet/golib/memfile v0.0.0-20190531212259-571cdbcff553/go.mod h1:tXGNW9q3RwvWt1VV2qrRKlSSz0npnh12yftCSCy2T64= github.com/dsnet/golib/memfile v0.0.0-20200723050859-c110804dfa93 h1:I48YLRgQEeWsjF7LmNcl62vTHSUfUfEVe3I1oHXiS5o= github.com/dsnet/golib/memfile v0.0.0-20200723050859-c110804dfa93/go.mod h1:tXGNW9q3RwvWt1VV2qrRKlSSz0npnh12yftCSCy2T64= -github.com/dustin/go-coap v0.0.0-20170214053734-ddcc80675fa4 h1:+3t0PiNl/W3Cl4/+XmQ8gD1HQuw3ISaGHHmSBylNVJ8= github.com/dustin/go-coap v0.0.0-20170214053734-ddcc80675fa4/go.mod h1:as2rZ2aojRzZF8bGx1bPAn1yi9ICG6LwkiPOj6PBtjc= -github.com/dustin/go-coap v0.0.0-20190908170653-752e0f79981e h1:oppjHFVTardH+VyOD32F9uBtgT5Wd/qVqEGcwj389Lc= github.com/dustin/go-coap v0.0.0-20190908170653-752e0f79981e/go.mod h1:as2rZ2aojRzZF8bGx1bPAn1yi9ICG6LwkiPOj6PBtjc= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/eclipse/paho.mqtt.golang v1.3.4 h1:/sS2PA+PgomTO1bfJSDJncox+U7X5Boa3AfhEywYdgI= +github.com/eclipse/paho.mqtt.golang v1.3.4/go.mod h1:eTzb4gxwwyWpqBUHGQZ4ABAV7+Jgm1PklsYT/eo8Hcc= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -175,42 +182,46 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-acme/lego v2.7.2+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= +github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-ocf/go-coap/v2 v2.0.4-0.20200728125043-f38b86f047a7/go.mod h1:X9wVKcaOSx7wBxKcvrWgMQq1R2DNeA7NBLW2osIb8TM= github.com/go-ocf/kit v0.0.0-20200728130040-4aebdb6982bc/go.mod h1:TIsoMT/iB7t9P6ahkcOnsmvS83SIJsv9qXRfz/yLf6M= -github.com/go-redis/redis v6.15.0+incompatible h1:/Wib9cA7CF3SQxBZRMHyQvqzlwzc8PJGDMkRfqQebSE= github.com/go-redis/redis v6.15.0+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= +github.com/go-redis/redis/v8 v8.8.2 h1:O/NcHqobw7SEptA0yA6up6spZVFtwE06SXM8rgLtsP8= +github.com/go-redis/redis/v8 v8.8.2/go.mod h1:F7resOH5Kdug49Otu24RjHWwgK7u9AmtqWMnCV1iP5Y= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= +github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-zoo/bone v1.3.0 h1:PY6sHq37FnQhj+4ZyqFIzJQHvrrGx0GEc3vTZZC/OsI= github.com/go-zoo/bone v1.3.0/go.mod h1:HI3Lhb7G3UQcAwEhOJ2WyNcsFtQX1WYHa0Hl4OBbhW8= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8= github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= @@ -225,44 +236,45 @@ github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSC github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= -github.com/gobuffalo/logger v1.0.1 h1:ZEgyRGgAm4ZAhAO45YXMs5Fp+bzGLESFewzAVBMKuTg= github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= +github.com/gobuffalo/logger v1.0.3 h1:YaXOTHNPCvkqqA7w05A4v0k2tCdpr+sgFlgINbQ6gqc= +github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= +github.com/gobuffalo/packd v1.0.0 h1:6ERZvJHfe24rfFmA9OaoKBdC7+c9sydrytMg8SdFGBM= +github.com/gobuffalo/packd v1.0.0/go.mod h1:6VTc4htmJRFB7u1m/4LeMTWjFoYrUiBkU9Fdec9hrhI= github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= -github.com/gobuffalo/packr/v2 v2.7.1 h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= +github.com/gobuffalo/packr/v2 v2.8.1 h1:tkQpju6i3EtMXJ9uoF5GT6kB+LMTimDWD8Xvbz6zDVA= +github.com/gobuffalo/packr/v2 v2.8.1/go.mod h1:c/PLlOuTU+p3SybaJATW3H6lX/iK7xEz5OeMf+NnJpg= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gocql/gocql v0.0.0-20181106112037-68ae1e384be4 h1:n5NlV76GU6337XT+jarynqONI5LlqaYkTPaFZ25og6g= github.com/gocql/gocql v0.0.0-20181106112037-68ae1e384be4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0= -github.com/gocql/gocql v0.0.0-20200526081602-cd04bd7f22a7 h1:TvUE5vjfoa7fFHMlmGOk0CsauNj1w4yJjR9+/GnWVCw= github.com/gocql/gocql v0.0.0-20200526081602-cd04bd7f22a7/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= -github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e h1:SroDcndcOU9BVAduPf/PXihXoR2ZYTQYLXbupbqxAyQ= -github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= +github.com/gocql/gocql v0.0.0-20210504150947-558dfae50b5d h1:QbC6FK7LDUrgkZPYdtaKiXGCIw41fdk39H+vrTgHFMs= +github.com/gocql/gocql v0.0.0-20210504150947-558dfae50b5d/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVHhbSKWg= -github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= +github.com/godror/godror v0.24.2/go.mod h1:wZv/9vPiUib6tkoDl+AZ/QLf5YZgMravZ7jxH2eQWAE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/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 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -273,35 +285,33 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/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 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0 h1:aRz0NBceriICVtjhCgKkDvl+RudKu1CT6h0ZvUTrNfE= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -310,6 +320,7 @@ github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopcua/opcua v0.1.6 h1:B9SVRKQGzcWcwP2QPYN93Uku32+3wL+v5cgzBxE6V5I= @@ -320,17 +331,13 @@ github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51 github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.2.0 h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ= github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -350,25 +357,28 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0 h1:z3ollgGRg8RjfJH6UVBaG54R70GFd++QOkvnJH3VSBY= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= +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-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.4 h1:1BZvpawXoJCWX6pNtow9+rpEj+3itIlutiqnntI6jOE= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM= +github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1 h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -381,57 +391,50 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/vault/api v1.0.4 h1:j08Or/wryXT4AcHj1oCbMd7IijXcKzYUGw59LGu9onU= -github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/sdk v0.1.13 h1:mOEPeOhT7jl0J4AMl1E705+BcmeRs1VmKNb9F0sMLy8= -github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/vault/api v1.1.0 h1:QcxC7FuqEl0sZaIjcXB/kNEeBa0DH5z57qbWBvZwLC4= +github.com/hashicorp/vault/api v1.1.0/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk= +github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 h1:e1ok06zGrWJW91rzRroyl5nRNqraaBe4d5hiKcVZuHM= +github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hokaccha/go-prettyjson v0.0.0-20180920040306-f579f869bbfe h1:MCgzztuoH5LZNr9AkIaicIDvCfACu11KUCCZQnRHDC0= github.com/hokaccha/go-prettyjson v0.0.0-20180920040306-f579f869bbfe/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= -github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e h1:0aewS5NTyxftZHSnFaJmWE5oCCrj4DyEXkAiMa1iZJM= github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= +github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.0/go.mod h1:BwN2XG2lMszOoquQaFdPET8FRQfrXiZsWmcMO9rkaVY= -github.com/influxdata/influxdb v1.6.4 h1:K8wPlkrP02HzHTJbbUQQ1CZ2Hw6LtpG4xbNEgnlhMZU= +github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.6.4/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= -github.com/influxdata/influxdb v1.8.0 h1:/X+G+i3udzHVxpBMuXdPZcUbkIE0ouT+6U+CzQTsOys= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= -github.com/influxdata/influxdb v1.8.1 h1:kzu28jHvuG3ZF6UUmQCtgHpsKlYPogzaEDnb88q23H0= -github.com/influxdata/influxdb v1.8.1/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= +github.com/influxdata/influxdb v1.8.5 h1:MMrJF6eWCD7sWMxOFFctm1U1RNQ2Hh2nHgz2iF9/wHY= +github.com/influxdata/influxdb v1.8.5/go.mod h1:oFH+pbEyDln/1TKwa98oJzVrkZwdjrJOwIDGYZj7Ma0= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= -github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.2.0 h1:lzPl/30ZLkTveYsYZPKMcgXc8MbnE6RsTd4F9KgiLtk= github.com/jcmturner/gokrb5/v8 v8.2.0/go.mod h1:T1hnNppQsBtxW0tCHMHTkAt8n/sABdzZgZdoFrZaZNM= -github.com/jcmturner/rpc/v2 v2.0.2 h1:gMB4IwRXYsWw4Bc6o/az2HJgFUA1ffSh90i26ZJ6Xl0= github.com/jcmturner/rpc/v2 v2.0.2/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmoiron/sqlx v1.2.1-0.20190319043955-cdf62fdf55f6 h1:6KHlj0TRbiafVOoCXCixS0GbdWF/paU373ABxEzhY6s= github.com/jmoiron/sqlx v1.2.1-0.20190319043955-cdf62fdf55f6/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5 h1:lrdPtrORjGv1HbbEvKWDUAy97mPpFm4B8hp77tcCUJY= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/jmoiron/sqlx v1.3.3 h1:j82X0bf7oQ27XeqxicSZsTU5suPwKElg3oyxNn43iTk= +github.com/jmoiron/sqlx v1.3.3/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -443,33 +446,36 @@ github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/karrick/godirwalk v1.15.8 h1:7+rWAZPn9zuRxaIqqT8Ohs2Q2Ac0msBqwRdxNCr2VVs= +github.com/karrick/godirwalk v1.15.8/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= 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 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.4 h1:jFzIFaf586tquEB5EhzQG0HwGNSlgAJpG53G6Ss11wc= github.com/klauspost/compress v1.10.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= 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 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kortschak/utter v1.0.1/go.mod h1:vSmSjbyrlKjjsL71193LmzBOKgwePk9DH6uFaWHIInc= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -477,13 +483,12 @@ github.com/lestrrat-go/iter v0.0.0-20200422075355-fc1769541911/go.mod h1:zIdgO1m github.com/lestrrat-go/jwx v1.0.2/go.mod h1:TPF17WiSFegZo+c20fdpw49QD+/7n4/IsGvEmCSWwT0= github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d/go.mod h1:B06CSso/AWxiPejj+fheUINGeBKeeEZNt8w+EoU7+L8= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.6.0 h1:I5DPxhYJChW9KYc66se+oKFFQX6VuQrKiprsX6ivRZc= github.com/lib/pq v1.6.0/go.mod h1:4vXEAYvW1fRQ2/FhZ78H73A60MHw1geSm145z2mdY1g= -github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY= -github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.1 h1:6VXZrLU0jHBYyAqrSPa+MgPfnSvTPuMgK+k0o5kVFWo= +github.com/lib/pq v1.10.1/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -495,49 +500,52 @@ github.com/mainflux/mainflux v0.0.0-20200314190902-c91fe0d45353/go.mod h1:yijZGL github.com/mainflux/mainflux v0.0.0-20200324100741-6ffa916ed229/go.mod h1:mde8cQhTPjLulu2pn/x8OgQ2S++lDufS+ODE93zuHjY= github.com/mainflux/mainflux v0.0.0-20200512161904-df6f5adff8e4/go.mod h1:2caJ68GaQPVNe85z5pNJMJk0CflgcS3XWghYsJSBesU= github.com/mainflux/mainflux v0.11.1-0.20200603183352-7f3e2c1b21ed/go.mod h1:8jwcwH3MKYgoQks9BBHq19Br25ElzW25vteZX7tWZ+w= -github.com/mainflux/mproxy v0.1.3 h1:/JNnxgo/03wSpbwQH2+WE1AzgMWaSKogTVXblh18x5s= github.com/mainflux/mproxy v0.1.3/go.mod h1:/BdaBfgye1GNCD+eat4ipFamy9IEVRH5nhZS0yEShVg= -github.com/mainflux/mproxy v0.1.5 h1:a0zKiUyuTDld2TwCuhrOFtUvotcvSfwJMuh/JcrqC6I= github.com/mainflux/mproxy v0.1.5/go.mod h1:MBLtv/RvhT8QsmXz4g3GxkRaP8PqlVqBWeqvw9QmO8k= -github.com/mainflux/mproxy v0.1.8 h1:vFpSbSTu327runxYnXoJOg2MrJ2etcMPUF1rPTrZbTk= github.com/mainflux/mproxy v0.1.8/go.mod h1:NnhrUDytvV4pCI5LDuet86/WrymrUaX0/x1tlUHTKhU= -github.com/mainflux/mproxy v0.2.1-0.20200603122422-b08e1fa2cf5c h1:vLMYmnA4W2GzUwpSAnRAB0eBJ9USQpNUo0+WTaVB9uI= github.com/mainflux/mproxy v0.2.1-0.20200603122422-b08e1fa2cf5c/go.mod h1:lFD56bDgNTslCLoTlZfo2DyQbkQOnoxEXmbE4VumRm4= github.com/mainflux/mproxy v0.2.2 h1:Kq8x5iWINlZejlZatDdgIsM427oRWKr1gw7mrkh5j9M= github.com/mainflux/mproxy v0.2.2/go.mod h1:+T8h6ZupYPl6Lx9A0hqpcUQtcLyOBdzm/lfkjvPfGXo= -github.com/mainflux/senml v1.0.0 h1:oLS5aBhvdHjgQ8kfq3jX7yD+DaquhvpyvIWNsPil3X0= github.com/mainflux/senml v1.0.0/go.mod h1:g9i8pj4WMs29KkUpXivbe/PP0qJd1kt3b1CF77S8A3s= -github.com/mainflux/senml v1.0.1 h1:qWKIGeUe7YEygM3xZcJ9Lbq+DHuT8V23dz1hgAYkYEY= github.com/mainflux/senml v1.0.1/go.mod h1:SMX76mM5yenjLVjZOM27+njCGkP+AA64O46nRQiBRlE= github.com/mainflux/senml v1.5.0 h1:GAd1y1eMohfa6sVYcr2iQfVfkkh9l/q7B1TWF5L68xs= github.com/mainflux/senml v1.5.0/go.mod h1:SMX76mM5yenjLVjZOM27+njCGkP+AA64O46nRQiBRlE= +github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= +github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= +github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= +github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-oci8 v0.0.7/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= +github.com/mattn/go-oci8 v0.1.1/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.12.0 h1:u/x3mp++qUxvYfulZ4HKOvVO0JWhk7HtE8lWhbGz/Do= github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -548,9 +556,13 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -558,31 +570,28 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/go-nats v1.6.0 h1:FznPwMfrVwGnSCh7JTXyJDRW0TIkD4Tr+M1LPJt9T70= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/go-nats v1.6.0/go.mod h1:+t7RHT5ApZebkrQdnn6AhQJmhJJiKAvJUio1PiiCtj0= -github.com/nats-io/jwt v0.3.0 h1:xdnzwFETV++jNc4W1mw//qFyJGb2ABOombmZJQS4+Qo= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.1.4 h1:BILRnsJ2Yb/fefiFbBWADpViGF69uh4sxe8poVDQ06g= github.com/nats-io/nats-server/v2 v2.1.4/go.mod h1:Jw1Z28soD/QasIA2uWjXyM9El1jly3YwyFOuR8tH1rg= -github.com/nats-io/nats.go v1.9.1 h1:ik3HbLhZ0YABLto7iX80pZLPw/6dx3T+++MZJwLnMrQ= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.10.0 h1:L8qnKaofSfNFbXg0C5F71LdjPRnmQwSsA4ukmkt1TvY= github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= -github.com/nats-io/nkeys v0.1.0 h1:qMd4+pRHgdr1nAClu+2h/2a5F2TmKcCzjCDazVgRoX4= +github.com/nats-io/nats.go v1.11.0 h1:L263PZkrmkRJRJT2YHU8GwWWvEvmr9/LUKuJTXsF32k= +github.com/nats-io/nats.go v1.11.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3 h1:6JrEfig+HzTH85yxzhSVbjHRJv9cn0p6n3IngIcM5/k= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.4 h1:aEsHIssIk6ETN5m2/MD8Y4B2X7FfXrBAUdkyRvbVYzA= github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nuid v1.0.0 h1:44QGdhbiANq8ZCbUkdn6W5bqtg+mHuDE4wOUuxxndFs= +github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= +github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.0/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= @@ -592,23 +601,23 @@ github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOE github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc9 h1:/k06BMULKF5hidyoZymkoDCzdJzltZpz/UU4LguQVtc= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -616,7 +625,6 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= @@ -626,8 +634,9 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.0+incompatible h1:r+Us+ELHPI8CudFL+l/wr7CrG6phWQ8jaqX0Sgx+OF0= github.com/ory/dockertest v3.3.0+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/ory/dockertest/v3 v3.6.0 h1:I6KNJ6izxGduLACQii2SP/g7GN0JM9Xfaik6aAVaw6Y= github.com/ory/dockertest/v3 v3.6.0/go.mod h1:4ZOpj8qBUmh8fcBSVzkH2bws2s91JdGvHUqan4GHEuQ= +github.com/ory/dockertest/v3 v3.6.5 h1:mhNKFeVEHuvaYW+/u+59mLzM/6XXGjpaet/yApgv+yc= +github.com/ory/dockertest/v3 v3.6.5/go.mod h1:iYKQSRlYrt/2s5fJWYdB98kCQG6g/LjBMvzEYii63vg= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -638,15 +647,16 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= +github.com/pelletier/go-toml v1.9.1 h1:a6qW1EVNZWH9WGI6CsYdD8WAylkoXBS5yv0XHlh17Tc= +github.com/pelletier/go-toml v1.9.1/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -657,82 +667,76 @@ github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pa github.com/pion/transport v0.10.0 h1:9M12BSneJm6ggGhJyWpDveFOstJsTiQjkLf4M44rm80= github.com/pion/transport v0.10.0/go.mod h1:BnHnUipd0rZQyTVB2SBGojFHT9CBt5C5TcsJSQGkvSE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 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/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/plgd-dev/go-coap/v2 v2.0.4-0.20200819112225-8eb712b901bc/go.mod h1:+tCi9Q78H/orWRtpVWyBgrr4vKFo2zYtbbxUllerBp4= -github.com/plgd-dev/go-coap/v2 v2.0.4 h1:Sqvji7v8+yveq6sW8TBM8hJ+kAmTfNdoRZZaBZLnSTo= -github.com/plgd-dev/go-coap/v2 v2.0.4/go.mod h1:DccQmYY6swDlNlOCQOAX+SXTI9laSfGytskmeeNWmms= +github.com/plgd-dev/go-coap/v2 v2.4.0 h1:pEexScWQ0I+t35gyHSKRciIyJxdmcfosnCX78BZbFzk= +github.com/plgd-dev/go-coap/v2 v2.4.0/go.mod h1:0lg7sgOTxlHtfyGhPiak214vQ7CuBRD99LbdBCpDRW8= github.com/plgd-dev/kit v0.0.0-20200819113605-d5fcf3e94f63 h1:cI6kESUBU1KUHtufZepEkaTsSkLN2kE6xz+Ec5V17q0= github.com/plgd-dev/kit v0.0.0-20200819113605-d5fcf3e94f63/go.mod h1:Yl9zisyXfPdtP9hTWlJqjJYXmgU/jtSDKttz9/CeD90= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 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-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.6.0 h1:YVPodQOcK15POxhgARIvnDRVpLcuK8mglnMrWfyrw6A= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg= +github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/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.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= +github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= 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-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.4.0 h1:LUa41nrWTQNGhzdsZ5lTnkwbNjj6rXTdazA1cSdjkOY= github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rubenv/sql-migrate v0.0.0-20181106121204-ba2c6a7295c5 h1:4fmVndFuOuFREP0MPVT+bymEYx/mvRBnmGamM1YfH8c= +github.com/rogpeppe/go-internal v1.5.2 h1:qLvObTrvO/XRCqmkKxUlOBc48bI3efyDuAZe25QiF0w= +github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rubenv/sql-migrate v0.0.0-20181106121204-ba2c6a7295c5/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY= -github.com/rubenv/sql-migrate v0.0.0-20200429072036-ae26b214fa43 h1:0i6uTtxUGc/jpK/CngM4T2S2NFnqYUUxH+lKDgBLw8U= github.com/rubenv/sql-migrate v0.0.0-20200429072036-ae26b214fa43/go.mod h1:DCgfY80j8GYL7MLEfvcpSFvjD0L5yZq/aZUJmhZklyg= -github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351 h1:HXr/qUllAWv9riaI4zh2eXWKmCSDqVS/XH1MRHLKRwk= -github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351/go.mod h1:DCgfY80j8GYL7MLEfvcpSFvjD0L5yZq/aZUJmhZklyg= +github.com/rubenv/sql-migrate v0.0.0-20210408115534-a32ed26c37ea h1:Yiqmu2rZoPdjxW2fWX5gAMpKfi9tYF5ak+lcGwZA4Qg= +github.com/rubenv/sql-migrate v0.0.0-20210408115534-a32ed26c37ea/go.mod h1:HFLT6i9iR4QBOF5rdCyjddC9t59ArqWJV2xx+jwcCMo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= @@ -744,18 +748,17 @@ github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfP github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.0.0-20180905101324-b2a34562d02c h1:7EMc5KMRVlkzEyK5n4YqdPEsmO+6AlAGCJiqnqW6n2Y= github.com/sony/gobreaker v0.0.0-20180905101324-b2a34562d02c/go.mod h1:XvpJiTD8NibaH7z0NzyfhR1+NQDtR9F/x92xheTwC9k= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -764,26 +767,25 @@ github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.5.0 h1:GpsTwfsQ27oS/Aha/6d1oD7tpKIqWnOA6tgOX9HHkt4= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= -github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -791,17 +793,14 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -809,17 +808,14 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/uber/jaeger-client-go v2.16.0+incompatible h1:Q2Pp6v3QYiocMxomCaJuwQGFt7E53bPYqEgug/AoBtY= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/uber/jaeger-client-go v2.16.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM= github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.23.1+incompatible h1:uArBYHQR0HqLFFAypI7RsWTzPSj/bDpmZZuQjMLSg1A= github.com/uber/jaeger-client-go v2.23.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.24.0+incompatible h1:CGchgJcHsDd2jWnaL4XngByMrXoGHh3n8oCqAKx0uMo= -github.com/uber/jaeger-client-go v2.24.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-client-go v2.28.0+incompatible h1:G4QSBfvPKvg5ZM2j9MrJFdfI5iSljY/WnJqOGFao6HI= +github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.0.0+incompatible h1:iMSCV0rmXEogjNWPh2D0xk9YVKvrtGoHJNe9ebLu/pw= github.com/uber/jaeger-lib v2.0.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -832,35 +828,46 @@ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xdg/stringprep v1.0.1-0.20180714160509-73f8eece6fdc h1:vIp1tjhVogU0yBy7w96P027ewvNPeH6gzuNcoc+NReU= github.com/xdg/stringprep v1.0.1-0.20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= 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.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.mongodb.org/mongo-driver v1.1.3 h1:++7u8r9adKhGR+I79NfEtYrk2ktjenErXM99PSufIoI= go.mongodb.org/mongo-driver v1.1.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.3 h1:9kX7WY6sU/5qBuhm5mdnNWdqaDAQKB2qSZOd5wMEPGQ= go.mongodb.org/mongo-driver v1.3.3/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.5 h1:S0ZOruh4YGHjD7JoN7mIsTrNjnQbOjrmgrx6l6pZN7I= -go.mongodb.org/mongo-driver v1.3.5/go.mod h1:Ual6Gkco7ZGQw8wE1t4tLnvBsf6yVSM60qW6TgOeJ5c= +go.mongodb.org/mongo-driver v1.4.0-beta2.0.20210512200446-5f449ba049cc h1:TmKS7/rsHcyq/S/Cf5dsCfNZLhmscDyZ4e6CxgMIWYU= +go.mongodb.org/mongo-driver v1.4.0-beta2.0.20210512200446-5f449ba049cc/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng= +go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= +go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg= +go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc= +go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q= +go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= +go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc= +go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -877,34 +884,33 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200602180216-279210d13fed h1:g4KENRiCMEx58Q7/ecwfT0N2o8z35Fnbsjig/Alf2T4= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b h1:wSOdpTq0/eI46Ez/LkDwIsAKA71YP2SRKBODiRWM0as= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2 h1:y102fOLFqhV41b+4GPiJoa0k/x+pJcEi2/HB1Y5T6fU= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299 h1:zQpM52jfKHG6II1ISZY1ZcpygvuSFZpLwfluuF89XOg= @@ -912,13 +918,18 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= @@ -927,8 +938,9 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= @@ -943,7 +955,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= 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-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -954,15 +965,19 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191003171128-d98b1b443823/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-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -973,10 +988,11 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -998,15 +1014,15 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed h1:uPxWBzB3+mlnjy9W58qY1j/cjyFjutgw/Vhan2zLy/A= golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e h1:D5TXcfTk7xF7hvieo4QErS3qqCB4teTffacDWr7CI+0= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1014,29 +1030,41 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200121082415-34d275377bf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -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/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/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-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1063,6 +1091,7 @@ golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1075,29 +1104,33 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178 h1:f5gMxb6FbpY48csegk9UPd7IAHVrBD013CU7N4pWzoE= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200308013534-11ec41452d41/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200417140056-c07e33ef3290/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770 h1:M9Fif0OxNji8w+HvmhVQ8KJtiZOsjU9RgslJGhn95XE= -golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20190808205415-ced62fe5104b h1:wlZ2AJblZitrh7dfm5OX2WenXLBZCuWqUeNczop2lPA= gonum.org/v1/gonum v0.0.0-20190808205415-ced62fe5104b/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/gonum v0.6.0 h1:DJy6UzXbahnGUf1ujUNkh/NEtK14qMo2nvlBPs4U5yw= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/gonum v0.7.0 h1:Hdks0L0hgznZLG9nzXb8vZ0rRvqNvAcgAp84y7Mwkgw= gonum.org/v1/gonum v0.7.0/go.mod h1:L02bwd0sqlsvRv41G7wGWFCsVNZFv/k1xzGIxeANHGM= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.1 h1:HCWmqqNoELL0RAQeKBXWtkp04mGk8koafcB4He6+uhc= +gonum.org/v1/gonum v0.9.1/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1106,26 +1139,20 @@ google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -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 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -1133,11 +1160,9 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688 h1:1+0Z5cgv1eDXJD9z2tdQF9PSSQnJXwism490hJydMRI= google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200603110839-e855014d5736 h1:+IE3xTD+6Eb7QWG5JFp+dQr/XjKpjmrNkh4pdjTdHEs= google.golang.org/genproto v0.0.0-20200603110839-e855014d5736/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200604104852-0b0486081ffb h1:ek2py5bOqzR7MR/6obzk0rXUgYCLmjyLnaO9ssT+l6w= google.golang.org/genproto v0.0.0-20200604104852-0b0486081ffb/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -1152,44 +1177,35 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 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= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.36.0 h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gorp.v1 v1.7.1 h1:GBB9KrWRATQZh95HJyVGUZrWwOPswitEYEyqlK8JbAA= gopkg.in/gorp.v1 v1.7.1/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/gorp.v1 v1.7.2 h1:j3DWlAyGVv8whO7AcIWznQ2Yj7yJkn34B8s63GViAAw= gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= @@ -1202,13 +1218,9 @@ gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eR gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= -gopkg.in/ory-am/dockertest.v3 v3.3.2 h1:NgIHJacfXajJResc7luKYPF/F2kul6MXqbleEjv4PAY= gopkg.in/ory-am/dockertest.v3 v3.3.2/go.mod h1:s9mmoLkaGeAh97qygnNj4xWkiN7e1SKekYC6CovU+ek= -gopkg.in/ory/dockertest.v3 v3.3.5 h1:bm2RXztqdTSinb1tUP9/iFTPmhy3sk2EL2k9GSMKNEE= gopkg.in/ory/dockertest.v3 v3.3.5/go.mod h1:wI78nwA6jQZVXv3va0CcbJAuftRnAa063zO5Fek7+uI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -1216,16 +1228,14 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= 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 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/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= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= @@ -1237,7 +1247,6 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/lora/adapter.go b/lora/adapter.go index 762968e999..fce4087934 100644 --- a/lora/adapter.go +++ b/lora/adapter.go @@ -1,6 +1,7 @@ package lora import ( + "context" "encoding/base64" "encoding/json" "errors" @@ -34,31 +35,31 @@ var ( // implementation, and all of its decorators (e.g. logging & metrics). type Service interface { // CreateThing creates thingID:devEUI route-map - CreateThing(thingID string, devEUI string) error + CreateThing(ctx context.Context, thingID string, devEUI string) error // UpdateThing updates thingID:devEUI route-map - UpdateThing(thingID string, devEUI string) error + UpdateThing(ctx context.Context, thingID string, devEUI string) error // RemoveThing removes thingID:devEUI route-map - RemoveThing(thingID string) error + RemoveThing(ctx context.Context, thingID string) error // CreateChannel creates channelID:appID route-map - CreateChannel(chanID string, appID string) error + CreateChannel(ctx context.Context, chanID string, appID string) error // UpdateChannel updates channelID:appID route-map - UpdateChannel(chanID string, appID string) error + UpdateChannel(ctx context.Context, chanID string, appID string) error // RemoveChannel removes channelID:appID route-map - RemoveChannel(chanID string) error + RemoveChannel(ctx context.Context, chanID string) error // ConnectThing creates thingID:channelID route-map - ConnectThing(chanID, thingID string) error + ConnectThing(ctx context.Context, chanID, thingID string) error // DisconnectThing removes thingID:channelID route-map - DisconnectThing(chanID, thingID string) error + DisconnectThing(ctx context.Context, chanID, thingID string) error // Publish forwards messages from the LoRa MQTT broker to Mainflux NATS broker - Publish(msg Message) error + Publish(ctx context.Context, msg Message) error } var _ Service = (*adapterService)(nil) @@ -81,21 +82,21 @@ func New(publisher messaging.Publisher, thingsRM, channelsRM, connectRM RouteMap } // Publish forwards messages from Lora MQTT broker to Mainflux NATS broker -func (as *adapterService) Publish(m Message) error { +func (as *adapterService) Publish(ctx context.Context, m Message) error { // Get route map of lora application - thingID, err := as.thingsRM.Get(m.DevEUI) + thingID, err := as.thingsRM.Get(ctx, m.DevEUI) if err != nil { return ErrNotFoundDev } // Get route map of lora application - chanID, err := as.channelsRM.Get(m.ApplicationID) + chanID, err := as.channelsRM.Get(ctx, m.ApplicationID) if err != nil { return ErrNotFoundApp } c := fmt.Sprintf("%s:%s", chanID, thingID) - if _, err := as.connectRM.Get(c); err != nil { + if _, err := as.connectRM.Get(ctx, c); err != nil { return ErrNotConnected } @@ -128,52 +129,52 @@ func (as *adapterService) Publish(m Message) error { return as.publisher.Publish(msg.Channel, msg) } -func (as *adapterService) CreateThing(thingID string, devEUI string) error { - return as.thingsRM.Save(thingID, devEUI) +func (as *adapterService) CreateThing(ctx context.Context, thingID string, devEUI string) error { + return as.thingsRM.Save(ctx, thingID, devEUI) } -func (as *adapterService) UpdateThing(thingID string, devEUI string) error { - return as.thingsRM.Save(thingID, devEUI) +func (as *adapterService) UpdateThing(ctx context.Context, thingID string, devEUI string) error { + return as.thingsRM.Save(ctx, thingID, devEUI) } -func (as *adapterService) RemoveThing(thingID string) error { - return as.thingsRM.Remove(thingID) +func (as *adapterService) RemoveThing(ctx context.Context, thingID string) error { + return as.thingsRM.Remove(ctx, thingID) } -func (as *adapterService) CreateChannel(chanID string, appID string) error { - return as.channelsRM.Save(chanID, appID) +func (as *adapterService) CreateChannel(ctx context.Context, chanID string, appID string) error { + return as.channelsRM.Save(ctx, chanID, appID) } -func (as *adapterService) UpdateChannel(chanID string, appID string) error { - return as.channelsRM.Save(chanID, appID) +func (as *adapterService) UpdateChannel(ctx context.Context, chanID string, appID string) error { + return as.channelsRM.Save(ctx, chanID, appID) } -func (as *adapterService) RemoveChannel(chanID string) error { - return as.channelsRM.Remove(chanID) +func (as *adapterService) RemoveChannel(ctx context.Context, chanID string) error { + return as.channelsRM.Remove(ctx, chanID) } -func (as *adapterService) ConnectThing(chanID, thingID string) error { - if _, err := as.channelsRM.Get(chanID); err != nil { +func (as *adapterService) ConnectThing(ctx context.Context, chanID, thingID string) error { + if _, err := as.channelsRM.Get(ctx, chanID); err != nil { return ErrNotFoundApp } - if _, err := as.thingsRM.Get(thingID); err != nil { + if _, err := as.thingsRM.Get(ctx, thingID); err != nil { return ErrNotFoundDev } c := fmt.Sprintf("%s:%s", chanID, thingID) - return as.connectRM.Save(c, c) + return as.connectRM.Save(ctx, c, c) } -func (as *adapterService) DisconnectThing(chanID, thingID string) error { - if _, err := as.channelsRM.Get(chanID); err != nil { +func (as *adapterService) DisconnectThing(ctx context.Context, chanID, thingID string) error { + if _, err := as.channelsRM.Get(ctx, chanID); err != nil { return ErrNotFoundApp } - if _, err := as.thingsRM.Get(thingID); err != nil { + if _, err := as.thingsRM.Get(ctx, thingID); err != nil { return ErrNotFoundDev } c := fmt.Sprintf("%s:%s", chanID, thingID) - return as.connectRM.Remove(c) + return as.connectRM.Remove(ctx, c) } diff --git a/lora/adapter_test.go b/lora/adapter_test.go index 4a54b5ecfd..5b5f081b86 100644 --- a/lora/adapter_test.go +++ b/lora/adapter_test.go @@ -39,19 +39,19 @@ func newService() lora.Service { func TestPublish(t *testing.T) { svc := newService() - err := svc.CreateChannel(chanID, appID) + err := svc.CreateChannel(nil, chanID, appID) require.Nil(t, err, fmt.Sprintf("unexpected error: %s\n", err)) - err = svc.CreateThing(thingID, devEUI) + err = svc.CreateThing(nil, thingID, devEUI) require.Nil(t, err, fmt.Sprintf("unexpected error: %s\n", err)) - err = svc.ConnectThing(chanID, thingID) + err = svc.ConnectThing(nil, chanID, thingID) require.Nil(t, err, fmt.Sprintf("unexpected error: %s\n", err)) - err = svc.CreateChannel(chanID2, appID2) + err = svc.CreateChannel(nil, chanID2, appID2) require.Nil(t, err, fmt.Sprintf("unexpected error: %s\n", err)) - err = svc.CreateThing(thingID2, devEUI2) + err = svc.CreateThing(nil, thingID2, devEUI2) require.Nil(t, err, fmt.Sprintf("unexpected error: %s\n", err)) msgBase64 := base64.StdEncoding.EncodeToString([]byte(msg)) @@ -106,7 +106,7 @@ func TestPublish(t *testing.T) { } for _, tc := range cases { - err := svc.Publish(tc.msg) + err := svc.Publish(nil, tc.msg) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) } } diff --git a/lora/api/logging.go b/lora/api/logging.go index a3f9660cf6..6db7ab5b8a 100644 --- a/lora/api/logging.go +++ b/lora/api/logging.go @@ -4,6 +4,7 @@ package api import ( + "context" "fmt" "time" @@ -26,7 +27,7 @@ func LoggingMiddleware(svc lora.Service, logger logger.Logger) lora.Service { } } -func (lm loggingMiddleware) CreateThing(thingID string, loraDevEUI string) (err error) { +func (lm loggingMiddleware) CreateThing(ctx context.Context, thingID string, loraDevEUI string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("create_thing for thing %s and lora-dev-eui %s took %s to complete", thingID, loraDevEUI, time.Since(begin)) if err != nil { @@ -36,10 +37,10 @@ func (lm loggingMiddleware) CreateThing(thingID string, loraDevEUI string) (err lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.CreateThing(thingID, loraDevEUI) + return lm.svc.CreateThing(ctx, thingID, loraDevEUI) } -func (lm loggingMiddleware) UpdateThing(thingID string, loraDevEUI string) (err error) { +func (lm loggingMiddleware) UpdateThing(ctx context.Context, thingID string, loraDevEUI string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("update_thing for thing %s and lora-dev-eui %s took %s to complete", thingID, loraDevEUI, time.Since(begin)) if err != nil { @@ -49,10 +50,10 @@ func (lm loggingMiddleware) UpdateThing(thingID string, loraDevEUI string) (err lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateThing(thingID, loraDevEUI) + return lm.svc.UpdateThing(ctx, thingID, loraDevEUI) } -func (lm loggingMiddleware) RemoveThing(thingID string) (err error) { +func (lm loggingMiddleware) RemoveThing(ctx context.Context, thingID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("remove_thing for thing %s took %s to complete", thingID, time.Since(begin)) if err != nil { @@ -62,10 +63,10 @@ func (lm loggingMiddleware) RemoveThing(thingID string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.RemoveThing(thingID) + return lm.svc.RemoveThing(ctx, thingID) } -func (lm loggingMiddleware) CreateChannel(chanID string, loraApp string) (err error) { +func (lm loggingMiddleware) CreateChannel(ctx context.Context, chanID, loraApp string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("create_channel for channel %s and lora-app %s took %s to complete", chanID, loraApp, time.Since(begin)) if err != nil { @@ -75,10 +76,10 @@ func (lm loggingMiddleware) CreateChannel(chanID string, loraApp string) (err er lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.CreateChannel(chanID, loraApp) + return lm.svc.CreateChannel(ctx, chanID, loraApp) } -func (lm loggingMiddleware) UpdateChannel(chanID string, loraApp string) (err error) { +func (lm loggingMiddleware) UpdateChannel(ctx context.Context, chanID, loraApp string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("update_channel for channel %s and lora-app %s took %s to complete", chanID, loraApp, time.Since(begin)) if err != nil { @@ -88,10 +89,10 @@ func (lm loggingMiddleware) UpdateChannel(chanID string, loraApp string) (err er lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateChannel(chanID, loraApp) + return lm.svc.UpdateChannel(ctx, chanID, loraApp) } -func (lm loggingMiddleware) RemoveChannel(chanID string) (err error) { +func (lm loggingMiddleware) RemoveChannel(ctx context.Context, chanID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("remove_channel for channel %s took %s to complete", chanID, time.Since(begin)) if err != nil { @@ -101,10 +102,10 @@ func (lm loggingMiddleware) RemoveChannel(chanID string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.RemoveChannel(chanID) + return lm.svc.RemoveChannel(ctx, chanID) } -func (lm loggingMiddleware) ConnectThing(chanID, thingID string) (err error) { +func (lm loggingMiddleware) ConnectThing(ctx context.Context, chanID, thingID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("connect_thing for channel %s and thing %s, took %s to complete", chanID, thingID, time.Since(begin)) if err != nil { @@ -114,10 +115,10 @@ func (lm loggingMiddleware) ConnectThing(chanID, thingID string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.ConnectThing(chanID, thingID) + return lm.svc.ConnectThing(ctx, chanID, thingID) } -func (lm loggingMiddleware) DisconnectThing(chanID, thingID string) (err error) { +func (lm loggingMiddleware) DisconnectThing(ctx context.Context, chanID, thingID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("disconnect_thing mfx-%s : mfx-%s, took %s to complete", chanID, thingID, time.Since(begin)) if err != nil { @@ -127,12 +128,12 @@ func (lm loggingMiddleware) DisconnectThing(chanID, thingID string) (err error) lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.DisconnectThing(chanID, thingID) + return lm.svc.DisconnectThing(ctx, chanID, thingID) } -func (lm loggingMiddleware) Publish(m lora.Message) (err error) { +func (lm loggingMiddleware) Publish(ctx context.Context, msg lora.Message) (err error) { defer func(begin time.Time) { - message := fmt.Sprintf("publish application/%s/device/%s/rx took %s to complete", m.ApplicationID, m.DevEUI, time.Since(begin)) + message := fmt.Sprintf("publish application/%s/device/%s/rx took %s to complete", msg.ApplicationID, msg.DevEUI, time.Since(begin)) if err != nil { lm.logger.Warn(fmt.Sprintf("%s with error: %s.", message, err)) return @@ -140,5 +141,5 @@ func (lm loggingMiddleware) Publish(m lora.Message) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.Publish(m) + return lm.svc.Publish(ctx, msg) } diff --git a/lora/api/metrics.go b/lora/api/metrics.go index 30aad33dd8..7f65f73c3d 100644 --- a/lora/api/metrics.go +++ b/lora/api/metrics.go @@ -4,6 +4,7 @@ package api import ( + "context" "time" "github.com/go-kit/kit/metrics" @@ -27,83 +28,83 @@ func MetricsMiddleware(svc lora.Service, counter metrics.Counter, latency metric } } -func (mm *metricsMiddleware) CreateThing(thingID string, loraDevEUI string) error { +func (mm *metricsMiddleware) CreateThing(ctx context.Context, thingID string, loraDevEUI string) error { defer func(begin time.Time) { mm.counter.With("method", "create_thing").Add(1) mm.latency.With("method", "create_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.CreateThing(thingID, loraDevEUI) + return mm.svc.CreateThing(ctx, thingID, loraDevEUI) } -func (mm *metricsMiddleware) UpdateThing(thingID string, loraDevEUI string) error { +func (mm *metricsMiddleware) UpdateThing(ctx context.Context, thingID string, loraDevEUI string) error { defer func(begin time.Time) { mm.counter.With("method", "update_thing").Add(1) mm.latency.With("method", "update_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateThing(thingID, loraDevEUI) + return mm.svc.UpdateThing(ctx, thingID, loraDevEUI) } -func (mm *metricsMiddleware) RemoveThing(thingID string) error { +func (mm *metricsMiddleware) RemoveThing(ctx context.Context, thingID string) error { defer func(begin time.Time) { mm.counter.With("method", "remove_thing").Add(1) mm.latency.With("method", "remove_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.RemoveThing(thingID) + return mm.svc.RemoveThing(ctx, thingID) } -func (mm *metricsMiddleware) CreateChannel(chanID string, loraApp string) error { +func (mm *metricsMiddleware) CreateChannel(ctx context.Context, chanID, loraApp string) error { defer func(begin time.Time) { mm.counter.With("method", "create_channel").Add(1) mm.latency.With("method", "create_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.CreateChannel(chanID, loraApp) + return mm.svc.CreateChannel(ctx, chanID, loraApp) } -func (mm *metricsMiddleware) UpdateChannel(chanID string, loraApp string) error { +func (mm *metricsMiddleware) UpdateChannel(ctx context.Context, chanID, loraApp string) error { defer func(begin time.Time) { mm.counter.With("method", "update_channel").Add(1) mm.latency.With("method", "update_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateChannel(chanID, loraApp) + return mm.svc.UpdateChannel(ctx, chanID, loraApp) } -func (mm *metricsMiddleware) RemoveChannel(chanID string) error { +func (mm *metricsMiddleware) RemoveChannel(ctx context.Context, chanID string) error { defer func(begin time.Time) { mm.counter.With("method", "remove_channel").Add(1) mm.latency.With("method", "remove_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.RemoveChannel(chanID) + return mm.svc.RemoveChannel(ctx, chanID) } -func (mm *metricsMiddleware) ConnectThing(chanID, thingID string) error { +func (mm *metricsMiddleware) ConnectThing(ctx context.Context, chanID, thingID string) error { defer func(begin time.Time) { mm.counter.With("method", "connect_thing").Add(1) mm.latency.With("method", "connect_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.ConnectThing(chanID, thingID) + return mm.svc.ConnectThing(ctx, chanID, thingID) } -func (mm *metricsMiddleware) DisconnectThing(chanID, thingID string) error { +func (mm *metricsMiddleware) DisconnectThing(ctx context.Context, chanID, thingID string) error { defer func(begin time.Time) { mm.counter.With("method", "disconnect_thing").Add(1) mm.latency.With("method", "disconnect_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.DisconnectThing(chanID, thingID) + return mm.svc.DisconnectThing(ctx, chanID, thingID) } -func (mm *metricsMiddleware) Publish(m lora.Message) error { +func (mm *metricsMiddleware) Publish(ctx context.Context, msg lora.Message) error { defer func(begin time.Time) { mm.counter.With("method", "publish").Add(1) mm.latency.With("method", "publish").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.Publish(m) + return mm.svc.Publish(ctx, msg) } diff --git a/lora/mocks/routes.go b/lora/mocks/routes.go index eea19ecf26..bcc9de328a 100644 --- a/lora/mocks/routes.go +++ b/lora/mocks/routes.go @@ -4,6 +4,7 @@ package mocks import ( + "context" "errors" "sync" @@ -22,7 +23,7 @@ func NewRouteMap() lora.RouteMapRepository { } } -func (trm *routeMapMock) Save(mfxID, extID string) error { +func (trm *routeMapMock) Save(_ context.Context, mfxID, extID string) error { trm.mu.Lock() defer trm.mu.Unlock() @@ -31,7 +32,7 @@ func (trm *routeMapMock) Save(mfxID, extID string) error { return nil } -func (trm *routeMapMock) Get(extID string) (string, error) { +func (trm *routeMapMock) Get(_ context.Context, extID string) (string, error) { trm.mu.Lock() defer trm.mu.Unlock() @@ -43,7 +44,7 @@ func (trm *routeMapMock) Get(extID string) (string, error) { return id, nil } -func (trm *routeMapMock) Remove(extID string) error { +func (trm *routeMapMock) Remove(_ context.Context, extID string) error { trm.mu.Lock() defer trm.mu.Unlock() diff --git a/lora/redis/routemap.go b/lora/redis/routemap.go index ab6ff34b01..f47679ba3b 100644 --- a/lora/redis/routemap.go +++ b/lora/redis/routemap.go @@ -4,9 +4,10 @@ package redis import ( + "context" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/lora" ) @@ -25,23 +26,23 @@ func NewRouteMapRepository(client *redis.Client, prefix string) lora.RouteMapRep } } -func (mr *routerMap) Save(mfxID, loraID string) error { +func (mr *routerMap) Save(ctx context.Context, mfxID, loraID string) error { tkey := fmt.Sprintf("%s:%s", mr.prefix, mfxID) - if err := mr.client.Set(tkey, loraID, 0).Err(); err != nil { + if err := mr.client.Set(ctx, tkey, loraID, 0).Err(); err != nil { return err } lkey := fmt.Sprintf("%s:%s", mr.prefix, loraID) - if err := mr.client.Set(lkey, mfxID, 0).Err(); err != nil { + if err := mr.client.Set(ctx, lkey, mfxID, 0).Err(); err != nil { return err } return nil } -func (mr *routerMap) Get(id string) (string, error) { +func (mr *routerMap) Get(ctx context.Context, id string) (string, error) { lKey := fmt.Sprintf("%s:%s", mr.prefix, id) - mval, err := mr.client.Get(lKey).Result() + mval, err := mr.client.Get(ctx, lKey).Result() if err != nil { return "", err } @@ -49,13 +50,13 @@ func (mr *routerMap) Get(id string) (string, error) { return mval, nil } -func (mr *routerMap) Remove(mfxID string) error { +func (mr *routerMap) Remove(ctx context.Context, mfxID string) error { mkey := fmt.Sprintf("%s:%s", mr.prefix, mfxID) - lval, err := mr.client.Get(mkey).Result() + lval, err := mr.client.Get(ctx, mkey).Result() if err != nil { return err } lkey := fmt.Sprintf("%s:%s", mr.prefix, lval) - return mr.client.Del(mkey, lkey).Err() + return mr.client.Del(ctx, mkey, lkey).Err() } diff --git a/lora/redis/streams.go b/lora/redis/streams.go index 5b73d7cbc8..6d804a9199 100644 --- a/lora/redis/streams.go +++ b/lora/redis/streams.go @@ -1,11 +1,12 @@ package redis import ( + "context" "encoding/json" "errors" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/logger" "github.com/mainflux/mainflux/lora" ) @@ -46,7 +47,7 @@ var ( // Subscriber represents event source for things and channels provisioning. type Subscriber interface { // Subscribes to geven subject and receives events. - Subscribe(string) error + Subscribe(context.Context, string) error } type eventStore struct { @@ -66,14 +67,14 @@ func NewEventStore(svc lora.Service, client *redis.Client, consumer string, log } } -func (es eventStore) Subscribe(subject string) error { - err := es.client.XGroupCreateMkStream(stream, group, "$").Err() +func (es eventStore) Subscribe(ctx context.Context, subject string) error { + err := es.client.XGroupCreateMkStream(ctx, stream, group, "$").Err() if err != nil && err.Error() != exists { return err } for { - streams, err := es.client.XReadGroup(&redis.XReadGroupArgs{ + streams, err := es.client.XReadGroup(ctx, &redis.XReadGroupArgs{ Group: group, Consumer: es.consumer, Streams: []string{stream, ">"}, @@ -94,46 +95,47 @@ func (es eventStore) Subscribe(subject string) error { err = derr break } - err = es.handleCreateThing(cte) + err = es.svc.CreateThing(ctx, cte.id, cte.loraDevEUI) case thingUpdate: ute, derr := decodeCreateThing(event) if derr != nil { err = derr break } - err = es.handleCreateThing(ute) - case thingRemove: - rte := decodeRemoveThing(event) - err = es.handleRemoveThing(rte) + err = es.svc.CreateThing(ctx, ute.id, ute.loraDevEUI) + case channelCreate: cce, derr := decodeCreateChannel(event) if derr != nil { err = derr break } - err = es.handleCreateChannel(cce) + err = es.svc.CreateChannel(ctx, cce.id, cce.loraAppID) case channelUpdate: uce, derr := decodeCreateChannel(event) if derr != nil { err = derr break } - err = es.handleCreateChannel(uce) + err = es.svc.CreateChannel(ctx, uce.id, uce.loraAppID) + case thingRemove: + rte := decodeRemoveThing(event) + err = es.svc.RemoveThing(ctx, rte.id) case channelRemove: rce := decodeRemoveChannel(event) - err = es.handleRemoveChannel(rce) + err = es.svc.RemoveChannel(ctx, rce.id) case thingConnect: - rce := decodeConnectionThing(event) - err = es.handleConnectThing(rce) + tce := decodeConnectionThing(event) + err = es.svc.ConnectThing(ctx, tce.chanID, tce.thingID) case thingDisconnect: - rce := decodeConnectionThing(event) - err = es.handleDisconnectThing(rce) + tde := decodeConnectionThing(event) + err = es.svc.DisconnectThing(ctx, tde.chanID, tde.thingID) } if err != nil && err != errMetadataType { es.logger.Warn(fmt.Sprintf("Failed to handle event sourcing: %s", err.Error())) break } - es.client.XAck(stream, group, msg.ID) + es.client.XAck(ctx, stream, group, msg.ID) } } } @@ -217,30 +219,6 @@ func decodeRemoveChannel(event map[string]interface{}) removeChannelEvent { } } -func (es eventStore) handleCreateThing(cte createThingEvent) error { - return es.svc.CreateThing(cte.id, cte.loraDevEUI) -} - -func (es eventStore) handleRemoveThing(rte removeThingEvent) error { - return es.svc.RemoveThing(rte.id) -} - -func (es eventStore) handleCreateChannel(cce createChannelEvent) error { - return es.svc.CreateChannel(cce.id, cce.loraAppID) -} - -func (es eventStore) handleRemoveChannel(rce removeChannelEvent) error { - return es.svc.RemoveChannel(rce.id) -} - -func (es eventStore) handleConnectThing(rte connectionThingEvent) error { - return es.svc.ConnectThing(rte.chanID, rte.thingID) -} - -func (es eventStore) handleDisconnectThing(rte connectionThingEvent) error { - return es.svc.DisconnectThing(rte.chanID, rte.thingID) -} - func read(event map[string]interface{}, key, def string) string { val, ok := event[key].(string) if !ok { diff --git a/lora/routemap.go b/lora/routemap.go index 9445b1254e..9f9b9d01ae 100644 --- a/lora/routemap.go +++ b/lora/routemap.go @@ -3,14 +3,16 @@ package lora +import "context" + // RouteMapRepository store route map between Lora App Server and Mainflux type RouteMapRepository interface { // Save stores/routes pair lora application topic & mainflux channel. - Save(string, string) error + Save(context.Context, string, string) error // Channel returns mainflux channel for given lora application. - Get(string) (string, error) + Get(context.Context, string) (string, error) // Removes mapping from cache. - Remove(string) error + Remove(context.Context, string) error } diff --git a/mqtt/handler.go b/mqtt/handler.go index dbbb6cedce..1985614afc 100644 --- a/mqtt/handler.go +++ b/mqtt/handler.go @@ -4,6 +4,7 @@ package mqtt import ( + "context" "errors" "net/url" "regexp" @@ -59,7 +60,7 @@ func (h *handler) AuthConnect(c *session.Client) error { return errInvalidConnect } - thid, err := h.auth.Identify(string(c.Password)) + thid, err := h.auth.Identify(context.Background(), string(c.Password)) if err != nil { return err } @@ -202,7 +203,7 @@ func (h *handler) authAccess(username string, topic string) error { } chanID := channelParts[1] - return h.auth.Authorize(chanID, username) + return h.auth.Authorize(context.Background(), chanID, username) } func parseSubtopic(subtopic string) (string, error) { diff --git a/mqtt/redis/streams.go b/mqtt/redis/streams.go index a68e96269c..aa88b7d562 100644 --- a/mqtt/redis/streams.go +++ b/mqtt/redis/streams.go @@ -4,10 +4,11 @@ package redis import ( + "context" "strconv" "time" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" ) const ( @@ -46,7 +47,7 @@ func (es EventStore) storeEvent(clientID, eventType string) error { Values: event.Encode(), } - if err := es.client.XAdd(record).Err(); err != nil { + if err := es.client.XAdd(context.Background(), record).Err(); err != nil { return err } diff --git a/opcua/adapter.go b/opcua/adapter.go index acabea7e48..d617b2a889 100644 --- a/opcua/adapter.go +++ b/opcua/adapter.go @@ -4,6 +4,7 @@ package opcua import ( + "context" "errors" "fmt" @@ -22,31 +23,31 @@ var ( // implementation, and all of its decorators (e.g. logging & metrics). type Service interface { // CreateThing creates thingID:OPC-UA-nodeID route-map - CreateThing(thingID, nodeID string) error + CreateThing(ctx context.Context, thingID, nodeID string) error // UpdateThing updates thingID:OPC-UA-nodeID route-map - UpdateThing(thingID, nodeID string) error + UpdateThing(ctx context.Context, thingID, nodeID string) error // RemoveThing removes thingID:OPC-UA-nodeID route-map - RemoveThing(thingID string) error + RemoveThing(ctx context.Context, thingID string) error // CreateChannel creates channelID:OPC-UA-serverURI route-map - CreateChannel(chanID, serverURI string) error + CreateChannel(ctx context.Context, chanID, serverURI string) error // UpdateChannel updates channelID:OPC-UA-serverURI route-map - UpdateChannel(chanID, serverURI string) error + UpdateChannel(ctx context.Context, chanID, serverURI string) error // RemoveChannel removes channelID:OPC-UA-serverURI route-map - RemoveChannel(chanID string) error + RemoveChannel(ctx context.Context, chanID string) error // ConnectThing creates thingID:channelID route-map - ConnectThing(chanID, thingID string) error + ConnectThing(ctx context.Context, chanID, thingID string) error // DisconnectThing removes thingID:channelID route-map - DisconnectThing(chanID, thingID string) error + DisconnectThing(ctx context.Context, chanID, thingID string) error // Browse browses available nodes for a given OPC-UA Server URI and NodeID - Browse(serverURI, namespace, identifier string) ([]BrowsedNode, error) + Browse(ctx context.Context, serverURI, namespace, identifier string) ([]BrowsedNode, error) } // Config OPC-UA Server @@ -85,37 +86,37 @@ func New(sub Subscriber, brow Browser, thingsRM, channelsRM, connectRM RouteMapR } } -func (as *adapterService) CreateThing(thingID, nodeID string) error { - return as.thingsRM.Save(thingID, nodeID) +func (as *adapterService) CreateThing(ctx context.Context, thingID, nodeID string) error { + return as.thingsRM.Save(ctx, thingID, nodeID) } -func (as *adapterService) UpdateThing(thingID, nodeID string) error { - return as.thingsRM.Save(thingID, nodeID) +func (as *adapterService) UpdateThing(ctx context.Context, thingID, nodeID string) error { + return as.thingsRM.Save(ctx, thingID, nodeID) } -func (as *adapterService) RemoveThing(thingID string) error { - return as.thingsRM.Remove(thingID) +func (as *adapterService) RemoveThing(ctx context.Context, thingID string) error { + return as.thingsRM.Remove(ctx, thingID) } -func (as *adapterService) CreateChannel(chanID, serverURI string) error { - return as.channelsRM.Save(chanID, serverURI) +func (as *adapterService) CreateChannel(ctx context.Context, chanID, serverURI string) error { + return as.channelsRM.Save(ctx, chanID, serverURI) } -func (as *adapterService) UpdateChannel(chanID, serverURI string) error { - return as.channelsRM.Save(chanID, serverURI) +func (as *adapterService) UpdateChannel(ctx context.Context, chanID, serverURI string) error { + return as.channelsRM.Save(ctx, chanID, serverURI) } -func (as *adapterService) RemoveChannel(chanID string) error { - return as.channelsRM.Remove(chanID) +func (as *adapterService) RemoveChannel(ctx context.Context, chanID string) error { + return as.channelsRM.Remove(ctx, chanID) } -func (as *adapterService) ConnectThing(chanID, thingID string) error { - serverURI, err := as.channelsRM.Get(chanID) +func (as *adapterService) ConnectThing(ctx context.Context, chanID, thingID string) error { + serverURI, err := as.channelsRM.Get(ctx, chanID) if err != nil { return err } - nodeID, err := as.thingsRM.Get(thingID) + nodeID, err := as.thingsRM.Get(ctx, thingID) if err != nil { return err } @@ -124,12 +125,12 @@ func (as *adapterService) ConnectThing(chanID, thingID string) error { as.cfg.ServerURI = serverURI c := fmt.Sprintf("%s:%s", chanID, thingID) - if err := as.connectRM.Save(c, c); err != nil { + if err := as.connectRM.Save(ctx, c, c); err != nil { return err } go func() { - if err := as.subscriber.Subscribe(as.cfg); err != nil { + if err := as.subscriber.Subscribe(ctx, as.cfg); err != nil { as.logger.Warn(fmt.Sprintf("subscription failed: %s", err)) } }() @@ -138,7 +139,7 @@ func (as *adapterService) ConnectThing(chanID, thingID string) error { return db.Save(serverURI, nodeID) } -func (as *adapterService) Browse(serverURI, namespace, identifier string) ([]BrowsedNode, error) { +func (as *adapterService) Browse(ctx context.Context, serverURI, namespace, identifier string) ([]BrowsedNode, error) { nodeID := fmt.Sprintf("%s;%s", namespace, identifier) nodes, err := as.browser.Browse(serverURI, nodeID) @@ -148,7 +149,7 @@ func (as *adapterService) Browse(serverURI, namespace, identifier string) ([]Bro return nodes, nil } -func (as *adapterService) DisconnectThing(chanID, thingID string) error { +func (as *adapterService) DisconnectThing(ctx context.Context, chanID, thingID string) error { c := fmt.Sprintf("%s:%s", chanID, thingID) - return as.connectRM.Remove(c) + return as.connectRM.Remove(ctx, c) } diff --git a/opcua/api/endpoint.go b/opcua/api/endpoint.go index 789ba783f3..3de30872b2 100644 --- a/opcua/api/endpoint.go +++ b/opcua/api/endpoint.go @@ -18,7 +18,7 @@ func browseEndpoint(svc opcua.Service) endpoint.Endpoint { return nil, err } - nodes, err := svc.Browse(req.ServerURI, req.Namespace, req.Identifier) + nodes, err := svc.Browse(ctx, req.ServerURI, req.Namespace, req.Identifier) if err != nil { return nil, err } diff --git a/opcua/api/logging.go b/opcua/api/logging.go index a4415f4326..fe82d18d4e 100644 --- a/opcua/api/logging.go +++ b/opcua/api/logging.go @@ -4,6 +4,7 @@ package api import ( + "context" "fmt" "time" @@ -26,7 +27,7 @@ func LoggingMiddleware(svc opcua.Service, logger logger.Logger) opcua.Service { } } -func (lm loggingMiddleware) CreateThing(mfxThing, opcuaNodeID string) (err error) { +func (lm loggingMiddleware) CreateThing(ctx context.Context, mfxThing, opcuaNodeID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("create_thing %s with NodeID %s, took %s to complete", mfxThing, opcuaNodeID, time.Since(begin)) if err != nil { @@ -36,10 +37,10 @@ func (lm loggingMiddleware) CreateThing(mfxThing, opcuaNodeID string) (err error lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.CreateThing(mfxThing, opcuaNodeID) + return lm.svc.CreateThing(ctx, mfxThing, opcuaNodeID) } -func (lm loggingMiddleware) UpdateThing(mfxThing, opcuaNodeID string) (err error) { +func (lm loggingMiddleware) UpdateThing(ctx context.Context, mfxThing, opcuaNodeID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("update_thing %s with NodeID %s, took %s to complete", mfxThing, opcuaNodeID, time.Since(begin)) if err != nil { @@ -49,10 +50,10 @@ func (lm loggingMiddleware) UpdateThing(mfxThing, opcuaNodeID string) (err error lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateThing(mfxThing, opcuaNodeID) + return lm.svc.UpdateThing(ctx, mfxThing, opcuaNodeID) } -func (lm loggingMiddleware) RemoveThing(mfxThing string) (err error) { +func (lm loggingMiddleware) RemoveThing(ctx context.Context, mfxThing string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("remove_thing %s, took %s to complete", mfxThing, time.Since(begin)) if err != nil { @@ -62,10 +63,10 @@ func (lm loggingMiddleware) RemoveThing(mfxThing string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.RemoveThing(mfxThing) + return lm.svc.RemoveThing(ctx, mfxThing) } -func (lm loggingMiddleware) CreateChannel(mfxChan, opcuaServerURI string) (err error) { +func (lm loggingMiddleware) CreateChannel(ctx context.Context, mfxChan, opcuaServerURI string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("create_channel %s with ServerURI %s, took %s to complete", mfxChan, opcuaServerURI, time.Since(begin)) if err != nil { @@ -75,10 +76,10 @@ func (lm loggingMiddleware) CreateChannel(mfxChan, opcuaServerURI string) (err e lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.CreateChannel(mfxChan, opcuaServerURI) + return lm.svc.CreateChannel(ctx, mfxChan, opcuaServerURI) } -func (lm loggingMiddleware) UpdateChannel(mfxChanID, opcuaServerURI string) (err error) { +func (lm loggingMiddleware) UpdateChannel(ctx context.Context, mfxChanID, opcuaServerURI string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("update_channel %s with ServerURI %s, took %s to complete", mfxChanID, opcuaServerURI, time.Since(begin)) if err != nil { @@ -88,10 +89,10 @@ func (lm loggingMiddleware) UpdateChannel(mfxChanID, opcuaServerURI string) (err lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.UpdateChannel(mfxChanID, opcuaServerURI) + return lm.svc.UpdateChannel(ctx, mfxChanID, opcuaServerURI) } -func (lm loggingMiddleware) RemoveChannel(mfxChanID string) (err error) { +func (lm loggingMiddleware) RemoveChannel(ctx context.Context, mfxChanID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("remove_channel %s, took %s to complete", mfxChanID, time.Since(begin)) if err != nil { @@ -101,10 +102,10 @@ func (lm loggingMiddleware) RemoveChannel(mfxChanID string) (err error) { lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.RemoveChannel(mfxChanID) + return lm.svc.RemoveChannel(ctx, mfxChanID) } -func (lm loggingMiddleware) ConnectThing(mfxChanID, mfxThingID string) (err error) { +func (lm loggingMiddleware) ConnectThing(ctx context.Context, mfxChanID, mfxThingID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("connect_thing for channel %s and thing %s, took %s to complete", mfxChanID, mfxThingID, time.Since(begin)) if err != nil { @@ -114,10 +115,10 @@ func (lm loggingMiddleware) ConnectThing(mfxChanID, mfxThingID string) (err erro lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.ConnectThing(mfxChanID, mfxThingID) + return lm.svc.ConnectThing(ctx, mfxChanID, mfxThingID) } -func (lm loggingMiddleware) DisconnectThing(mfxChanID, mfxThingID string) (err error) { +func (lm loggingMiddleware) DisconnectThing(ctx context.Context, mfxChanID, mfxThingID string) (err error) { defer func(begin time.Time) { message := fmt.Sprintf("disconnect_thing mfx-%s : mfx-%s, took %s to complete", mfxChanID, mfxThingID, time.Since(begin)) if err != nil { @@ -127,10 +128,10 @@ func (lm loggingMiddleware) DisconnectThing(mfxChanID, mfxThingID string) (err e lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.DisconnectThing(mfxChanID, mfxThingID) + return lm.svc.DisconnectThing(ctx, mfxChanID, mfxThingID) } -func (lm loggingMiddleware) Browse(serverURI, namespace, identifier string) (nodes []opcua.BrowsedNode, err error) { +func (lm loggingMiddleware) Browse(ctx context.Context, serverURI, namespace, identifier string) (nodes []opcua.BrowsedNode, err error) { defer func(begin time.Time) { message := fmt.Sprintf("browse server URI %s and node %s;%s, took %s to complete", serverURI, namespace, identifier, time.Since(begin)) if err != nil { @@ -140,5 +141,5 @@ func (lm loggingMiddleware) Browse(serverURI, namespace, identifier string) (nod lm.logger.Info(fmt.Sprintf("%s without errors.", message)) }(time.Now()) - return lm.svc.Browse(serverURI, namespace, identifier) + return lm.svc.Browse(ctx, serverURI, namespace, identifier) } diff --git a/opcua/api/metrics.go b/opcua/api/metrics.go index cacc9b0f95..4222cbc363 100644 --- a/opcua/api/metrics.go +++ b/opcua/api/metrics.go @@ -4,6 +4,7 @@ package api import ( + "context" "time" "github.com/go-kit/kit/metrics" @@ -27,83 +28,83 @@ func MetricsMiddleware(svc opcua.Service, counter metrics.Counter, latency metri } } -func (mm *metricsMiddleware) CreateThing(mfxDevID, opcuaNodeID string) error { +func (mm *metricsMiddleware) CreateThing(ctx context.Context, mfxDevID, opcuaNodeID string) error { defer func(begin time.Time) { mm.counter.With("method", "create_thing").Add(1) mm.latency.With("method", "create_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.CreateThing(mfxDevID, opcuaNodeID) + return mm.svc.CreateThing(ctx, mfxDevID, opcuaNodeID) } -func (mm *metricsMiddleware) UpdateThing(mfxDevID, opcuaNodeID string) error { +func (mm *metricsMiddleware) UpdateThing(ctx context.Context, mfxDevID, opcuaNodeID string) error { defer func(begin time.Time) { mm.counter.With("method", "update_thing").Add(1) mm.latency.With("method", "update_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateThing(mfxDevID, opcuaNodeID) + return mm.svc.UpdateThing(ctx, mfxDevID, opcuaNodeID) } -func (mm *metricsMiddleware) RemoveThing(mfxDevID string) error { +func (mm *metricsMiddleware) RemoveThing(ctx context.Context, mfxDevID string) error { defer func(begin time.Time) { mm.counter.With("method", "remove_thing").Add(1) mm.latency.With("method", "remove_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.RemoveThing(mfxDevID) + return mm.svc.RemoveThing(ctx, mfxDevID) } -func (mm *metricsMiddleware) CreateChannel(mfxChanID, opcuaServerURI string) error { +func (mm *metricsMiddleware) CreateChannel(ctx context.Context, mfxChanID, opcuaServerURI string) error { defer func(begin time.Time) { mm.counter.With("method", "create_channel").Add(1) mm.latency.With("method", "create_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.CreateChannel(mfxChanID, opcuaServerURI) + return mm.svc.CreateChannel(ctx, mfxChanID, opcuaServerURI) } -func (mm *metricsMiddleware) UpdateChannel(mfxChanID, opcuaServerURI string) error { +func (mm *metricsMiddleware) UpdateChannel(ctx context.Context, mfxChanID, opcuaServerURI string) error { defer func(begin time.Time) { mm.counter.With("method", "update_channel").Add(1) mm.latency.With("method", "update_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.UpdateChannel(mfxChanID, opcuaServerURI) + return mm.svc.UpdateChannel(ctx, mfxChanID, opcuaServerURI) } -func (mm *metricsMiddleware) RemoveChannel(mfxChanID string) error { +func (mm *metricsMiddleware) RemoveChannel(ctx context.Context, mfxChanID string) error { defer func(begin time.Time) { mm.counter.With("method", "remove_channel").Add(1) mm.latency.With("method", "remove_channel").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.RemoveChannel(mfxChanID) + return mm.svc.RemoveChannel(ctx, mfxChanID) } -func (mm *metricsMiddleware) ConnectThing(mfxChanID, mfxThingID string) error { +func (mm *metricsMiddleware) ConnectThing(ctx context.Context, mfxChanID, mfxThingID string) error { defer func(begin time.Time) { mm.counter.With("method", "connect_thing").Add(1) mm.latency.With("method", "connect_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.ConnectThing(mfxChanID, mfxThingID) + return mm.svc.ConnectThing(ctx, mfxChanID, mfxThingID) } -func (mm *metricsMiddleware) DisconnectThing(mfxChanID, mfxThingID string) error { +func (mm *metricsMiddleware) DisconnectThing(ctx context.Context, mfxChanID, mfxThingID string) error { defer func(begin time.Time) { mm.counter.With("method", "disconnect_thing").Add(1) mm.latency.With("method", "disconnect_thing").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.DisconnectThing(mfxChanID, mfxThingID) + return mm.svc.DisconnectThing(ctx, mfxChanID, mfxThingID) } -func (mm *metricsMiddleware) Browse(serverURI, namespace, identifier string) ([]opcua.BrowsedNode, error) { +func (mm *metricsMiddleware) Browse(ctx context.Context, serverURI, namespace, identifier string) ([]opcua.BrowsedNode, error) { defer func(begin time.Time) { mm.counter.With("method", "browse").Add(1) mm.latency.With("method", "browse").Observe(time.Since(begin).Seconds()) }(time.Now()) - return mm.svc.Browse(serverURI, namespace, identifier) + return mm.svc.Browse(ctx, serverURI, namespace, identifier) } diff --git a/opcua/eventstore.go b/opcua/eventstore.go index e8880e561e..31d6dcdf89 100644 --- a/opcua/eventstore.go +++ b/opcua/eventstore.go @@ -3,8 +3,10 @@ package opcua +import "context" + // EventStore represents event source for things and channels provisioning. type EventStore interface { // Subscribes to a given subject and receives events. - Subscribe(string) error + Subscribe(context.Context, string) error } diff --git a/opcua/gopcua/subscribe.go b/opcua/gopcua/subscribe.go index 4c03f0cad4..7251d52f84 100644 --- a/opcua/gopcua/subscribe.go +++ b/opcua/gopcua/subscribe.go @@ -69,7 +69,7 @@ func NewSubscriber(ctx context.Context, publisher messaging.Publisher, thingsRM, } // Subscribe subscribes to the OPC-UA Server. -func (c client) Subscribe(cfg opcua.Config) error { +func (c client) Subscribe(ctx context.Context, cfg opcua.Config) error { opts := []opcuaGopcua.Option{ opcuaGopcua.SecurityMode(uaGopcua.MessageSecurityModeNone), } @@ -114,14 +114,14 @@ func (c client) Subscribe(cfg opcua.Config) error { } defer sub.Cancel() - if err := c.runHandler(sub, cfg.ServerURI, cfg.NodeID); err != nil { + if err := c.runHandler(ctx, sub, cfg.ServerURI, cfg.NodeID); err != nil { c.logger.Warn(fmt.Sprintf("Unsubscribed from OPC-UA node %s.%s: %s", cfg.ServerURI, cfg.NodeID, err)) } return nil } -func (c client) runHandler(sub *opcuaGopcua.Subscription, uri, node string) error { +func (c client) runHandler(ctx context.Context, sub *opcuaGopcua.Subscription, uri, node string) error { nodeID, err := uaGopcua.ParseNodeID(node) if err != nil { return errors.Wrap(errFailedParseNodeID, err) @@ -187,7 +187,7 @@ func (c client) runHandler(sub *opcuaGopcua.Subscription, uri, node string) erro msg.Data = 0 } - if err := c.publish(token, msg); err != nil { + if err := c.publish(ctx, token, msg); err != nil { switch err { case errNotFoundServerURI, errNotFoundNodeID, errNotFoundConn: return err @@ -205,22 +205,22 @@ func (c client) runHandler(sub *opcuaGopcua.Subscription, uri, node string) erro } // Publish forwards messages from the OPC-UA Server to Mainflux NATS broker -func (c client) publish(token string, m message) error { +func (c client) publish(ctx context.Context, token string, m message) error { // Get route-map of the OPC-UA ServerURI - chanID, err := c.channelsRM.Get(m.ServerURI) + chanID, err := c.channelsRM.Get(ctx, m.ServerURI) if err != nil { return errNotFoundServerURI } // Get route-map of the OPC-UA NodeID - thingID, err := c.thingsRM.Get(m.NodeID) + thingID, err := c.thingsRM.Get(ctx, m.NodeID) if err != nil { return errNotFoundNodeID } // Check connection between ServerURI and NodeID cKey := fmt.Sprintf("%s:%s", chanID, thingID) - if _, err := c.connectRM.Get(cKey); err != nil { + if _, err := c.connectRM.Get(ctx, cKey); err != nil { return fmt.Errorf("%s between channel %s and thing %s", errNotFoundConn, chanID, thingID) } diff --git a/opcua/redis/routemap.go b/opcua/redis/routemap.go index 15c5e01ee1..3dc7a8311c 100644 --- a/opcua/redis/routemap.go +++ b/opcua/redis/routemap.go @@ -4,9 +4,10 @@ package redis import ( + "context" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/opcua" ) @@ -25,23 +26,23 @@ func NewRouteMapRepository(client *redis.Client, prefix string) opcua.RouteMapRe } } -func (mr *routerMap) Save(mfxID, opcuaID string) error { +func (mr *routerMap) Save(ctx context.Context, mfxID, opcuaID string) error { tkey := fmt.Sprintf("%s:%s", mr.prefix, mfxID) - if err := mr.client.Set(tkey, opcuaID, 0).Err(); err != nil { + if err := mr.client.Set(ctx, tkey, opcuaID, 0).Err(); err != nil { return err } lkey := fmt.Sprintf("%s:%s", mr.prefix, opcuaID) - if err := mr.client.Set(lkey, mfxID, 0).Err(); err != nil { + if err := mr.client.Set(ctx, lkey, mfxID, 0).Err(); err != nil { return err } return nil } -func (mr *routerMap) Get(opcuaID string) (string, error) { +func (mr *routerMap) Get(ctx context.Context, opcuaID string) (string, error) { lKey := fmt.Sprintf("%s:%s", mr.prefix, opcuaID) - mval, err := mr.client.Get(lKey).Result() + mval, err := mr.client.Get(ctx, lKey).Result() if err != nil { return "", err } @@ -49,13 +50,13 @@ func (mr *routerMap) Get(opcuaID string) (string, error) { return mval, nil } -func (mr *routerMap) Remove(mfxID string) error { +func (mr *routerMap) Remove(ctx context.Context, mfxID string) error { mkey := fmt.Sprintf("%s:%s", mr.prefix, mfxID) - lval, err := mr.client.Get(mkey).Result() + lval, err := mr.client.Get(ctx, mkey).Result() if err != nil { return err } lkey := fmt.Sprintf("%s:%s", mr.prefix, lval) - return mr.client.Del(mkey, lkey).Err() + return mr.client.Del(ctx, mkey, lkey).Err() } diff --git a/opcua/redis/streams.go b/opcua/redis/streams.go index 9957c90ab7..1ed1fdfeed 100644 --- a/opcua/redis/streams.go +++ b/opcua/redis/streams.go @@ -4,11 +4,12 @@ package redis import ( + "context" "encoding/json" "errors" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/logger" "github.com/mainflux/mainflux/opcua" ) @@ -65,14 +66,14 @@ func NewEventStore(svc opcua.Service, client *redis.Client, consumer string, log } } -func (es eventStore) Subscribe(subject string) error { - err := es.client.XGroupCreateMkStream(stream, group, "$").Err() +func (es eventStore) Subscribe(ctx context.Context, subject string) error { + err := es.client.XGroupCreateMkStream(ctx, stream, group, "$").Err() if err != nil && err.Error() != exists { return err } for { - streams, err := es.client.XReadGroup(&redis.XReadGroupArgs{ + streams, err := es.client.XReadGroup(ctx, &redis.XReadGroupArgs{ Group: group, Consumer: es.consumer, Streams: []string{stream, ">"}, @@ -93,46 +94,46 @@ func (es eventStore) Subscribe(subject string) error { err = e break } - err = es.handleCreateThing(cte) + err = es.svc.CreateThing(ctx, cte.id, cte.opcuaNodeID) case thingUpdate: ute, e := decodeCreateThing(event) if e != nil { err = e break } - err = es.handleCreateThing(ute) + err = es.svc.CreateThing(ctx, ute.id, ute.opcuaNodeID) case thingRemove: rte := decodeRemoveThing(event) - err = es.handleRemoveThing(rte) + err = es.svc.RemoveThing(ctx, rte.id) case channelCreate: cce, e := decodeCreateChannel(event) if e != nil { err = e break } - err = es.handleCreateChannel(cce) + err = es.svc.CreateChannel(ctx, cce.id, cce.opcuaServerURI) case channelUpdate: uce, e := decodeCreateChannel(event) if e != nil { err = e break } - err = es.handleCreateChannel(uce) + err = es.svc.CreateChannel(ctx, uce.id, uce.opcuaServerURI) case channelRemove: rce := decodeRemoveChannel(event) - err = es.handleRemoveChannel(rce) + err = es.svc.RemoveChannel(ctx, rce.id) case thingConnect: rce := decodeConnectThing(event) - err = es.handleConnectThing(rce) + err = es.svc.ConnectThing(ctx, rce.chanID, rce.thingID) case thingDisconnect: rce := decodeDisconnectThing(event) - err = es.handleDisconnectThing(rce) + err = es.svc.DisconnectThing(ctx, rce.chanID, rce.thingID) } if err != nil && err != errMetadataType { es.logger.Warn(fmt.Sprintf("Failed to handle event sourcing: %s", err.Error())) break } - es.client.XAck(stream, group, msg.ID) + es.client.XAck(ctx, stream, group, msg.ID) } } } @@ -223,30 +224,6 @@ func decodeDisconnectThing(event map[string]interface{}) connectThingEvent { } } -func (es eventStore) handleCreateThing(cte createThingEvent) error { - return es.svc.CreateThing(cte.id, cte.opcuaNodeID) -} - -func (es eventStore) handleRemoveThing(rte removeThingEvent) error { - return es.svc.RemoveThing(rte.id) -} - -func (es eventStore) handleCreateChannel(cce createChannelEvent) error { - return es.svc.CreateChannel(cce.id, cce.opcuaServerURI) -} - -func (es eventStore) handleRemoveChannel(rce removeChannelEvent) error { - return es.svc.RemoveChannel(rce.id) -} - -func (es eventStore) handleConnectThing(rte connectThingEvent) error { - return es.svc.ConnectThing(rte.chanID, rte.thingID) -} - -func (es eventStore) handleDisconnectThing(rte connectThingEvent) error { - return es.svc.DisconnectThing(rte.chanID, rte.thingID) -} - func read(event map[string]interface{}, key, def string) string { val, ok := event[key].(string) if !ok { diff --git a/opcua/routemap.go b/opcua/routemap.go index b6fc73693a..a838134425 100644 --- a/opcua/routemap.go +++ b/opcua/routemap.go @@ -3,14 +3,16 @@ package opcua +import "context" + // RouteMapRepository store route-map between the OPC-UA Server and Mainflux type RouteMapRepository interface { // Save stores/routes pair OPC-UA Server & Mainflux. - Save(string, string) error + Save(context.Context, string, string) error // Get returns the stored Mainflux route-map for a given OPC-UA pair. - Get(string) (string, error) + Get(context.Context, string) (string, error) // Remove Remove route-map from cache. - Remove(string) error + Remove(context.Context, string) error } diff --git a/opcua/subscriber.go b/opcua/subscriber.go index 1e7d9da17e..d05b31d113 100644 --- a/opcua/subscriber.go +++ b/opcua/subscriber.go @@ -3,8 +3,10 @@ package opcua +import "context" + // Subscriber represents the OPC-UA Server client. type Subscriber interface { // Subscribes to given NodeID and receives events. - Subscribe(Config) error + Subscribe(context.Context, Config) error } diff --git a/pkg/auth/client.go b/pkg/auth/client.go index f125cd1d26..6ff85b15a3 100644 --- a/pkg/auth/client.go +++ b/pkg/auth/client.go @@ -6,14 +6,14 @@ package auth import ( "context" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux" ) // Client represents Auth cache. type Client interface { - Authorize(chanID, thingID string) error - Identify(thingKey string) (string, error) + Authorize(ctx context.Context, chanID, thingID string) error + Identify(ctx context.Context, thingKey string) (string, error) } const ( @@ -34,9 +34,9 @@ func New(redisClient *redis.Client, thingsClient mainflux.ThingsServiceClient) C } } -func (c client) Identify(thingKey string) (string, error) { +func (c client) Identify(ctx context.Context, thingKey string) (string, error) { tkey := keyPrefix + ":" + thingKey - thingID, err := c.redisClient.Get(tkey).Result() + thingID, err := c.redisClient.Get(ctx, tkey).Result() if err != nil { t := &mainflux.Token{ Value: string(thingKey), @@ -51,8 +51,8 @@ func (c client) Identify(thingKey string) (string, error) { return thingID, nil } -func (c client) Authorize(chanID, thingID string) error { - if c.redisClient.SIsMember(chanPrefix+":"+chanID, thingID).Val() { +func (c client) Authorize(ctx context.Context, chanID, thingID string) error { + if c.redisClient.SIsMember(ctx, chanPrefix+":"+chanID, thingID).Val() { return nil } @@ -60,6 +60,6 @@ func (c client) Authorize(chanID, thingID string) error { ThingID: thingID, ChanID: chanID, } - _, err := c.thingsClient.CanAccessByID(context.TODO(), ar) + _, err := c.thingsClient.CanAccessByID(ctx, ar) return err } diff --git a/things/redis/channels.go b/things/redis/channels.go index 6d42750b04..28ba1f9c99 100644 --- a/things/redis/channels.go +++ b/things/redis/channels.go @@ -7,7 +7,7 @@ import ( "context" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/pkg/errors" "github.com/mainflux/mainflux/things" ) @@ -25,30 +25,30 @@ func NewChannelCache(client *redis.Client) things.ChannelCache { return channelCache{client: client} } -func (cc channelCache) Connect(_ context.Context, chanID, thingID string) error { +func (cc channelCache) Connect(ctx context.Context, chanID, thingID string) error { cid, tid := kv(chanID, thingID) - if err := cc.client.SAdd(cid, tid).Err(); err != nil { + if err := cc.client.SAdd(ctx, cid, tid).Err(); err != nil { return errors.Wrap(things.ErrConnect, err) } return nil } -func (cc channelCache) HasThing(_ context.Context, chanID, thingID string) bool { +func (cc channelCache) HasThing(ctx context.Context, chanID, thingID string) bool { cid, tid := kv(chanID, thingID) - return cc.client.SIsMember(cid, tid).Val() + return cc.client.SIsMember(ctx, cid, tid).Val() } -func (cc channelCache) Disconnect(_ context.Context, chanID, thingID string) error { +func (cc channelCache) Disconnect(ctx context.Context, chanID, thingID string) error { cid, tid := kv(chanID, thingID) - if err := cc.client.SRem(cid, tid).Err(); err != nil { + if err := cc.client.SRem(ctx, cid, tid).Err(); err != nil { return errors.Wrap(things.ErrDisconnect, err) } return nil } -func (cc channelCache) Remove(_ context.Context, chanID string) error { +func (cc channelCache) Remove(ctx context.Context, chanID string) error { cid, _ := kv(chanID, "0") - if err := cc.client.Del(cid).Err(); err != nil { + if err := cc.client.Del(ctx, cid).Err(); err != nil { return errors.Wrap(things.ErrRemoveEntity, err) } return nil diff --git a/things/redis/setup_test.go b/things/redis/setup_test.go index 487aa2e6c4..08c1dc58e4 100644 --- a/things/redis/setup_test.go +++ b/things/redis/setup_test.go @@ -4,12 +4,13 @@ package redis_test import ( + "context" "fmt" "log" "os" "testing" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" dockertest "github.com/ory/dockertest/v3" ) @@ -37,7 +38,7 @@ func TestMain(m *testing.M) { DB: 0, }) - return redisClient.Ping().Err() + return redisClient.Ping(context.Background()).Err() }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } diff --git a/things/redis/streams.go b/things/redis/streams.go index 4b1d0c437f..7f35f0c008 100644 --- a/things/redis/streams.go +++ b/things/redis/streams.go @@ -6,7 +6,7 @@ package redis import ( "context" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/things" ) @@ -49,7 +49,7 @@ func (es eventStore) CreateThings(ctx context.Context, token string, ths ...thin MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() } return sths, nil @@ -70,7 +70,7 @@ func (es eventStore) UpdateThing(ctx context.Context, token string, thing things MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() return nil } @@ -107,7 +107,7 @@ func (es eventStore) RemoveThing(ctx context.Context, token, id string) error { MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() return nil } @@ -130,7 +130,7 @@ func (es eventStore) CreateChannels(ctx context.Context, token string, channels MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() } return schs, nil @@ -151,7 +151,7 @@ func (es eventStore) UpdateChannel(ctx context.Context, token string, channel th MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() return nil } @@ -181,7 +181,7 @@ func (es eventStore) RemoveChannel(ctx context.Context, token, id string) error MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() return nil } @@ -202,7 +202,7 @@ func (es eventStore) Connect(ctx context.Context, token string, chIDs, thIDs []s MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() } } @@ -223,7 +223,7 @@ func (es eventStore) Disconnect(ctx context.Context, token, chanID, thingID stri MaxLenApprox: streamLen, Values: event.Encode(), } - es.client.XAdd(record).Err() + es.client.XAdd(ctx, record).Err() return nil } diff --git a/things/redis/streams_test.go b/things/redis/streams_test.go index 28bf57f7df..98cc4287cd 100644 --- a/things/redis/streams_test.go +++ b/things/redis/streams_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - r "github.com/go-redis/redis" + r "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/pkg/errors" "github.com/mainflux/mainflux/pkg/uuid" "github.com/mainflux/mainflux/things" @@ -51,7 +51,7 @@ func newService(tokens map[string]string) things.Service { } func TestCreateThings(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) svc = redis.NewEventStoreMiddleware(svc, redisClient) @@ -93,7 +93,7 @@ func TestCreateThings(t *testing.T) { _, err := svc.CreateThings(context.Background(), tc.key, tc.ths...) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -111,7 +111,7 @@ func TestCreateThings(t *testing.T) { } func TestUpdateThing(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -151,7 +151,7 @@ func TestUpdateThing(t *testing.T) { for _, tc := range cases { err := svc.UpdateThing(context.Background(), tc.key, tc.thing) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -169,7 +169,7 @@ func TestUpdateThing(t *testing.T) { } func TestViewThing(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -180,12 +180,12 @@ func TestViewThing(t *testing.T) { essvc := redis.NewEventStoreMiddleware(svc, redisClient) esth, eserr := essvc.ViewThing(context.Background(), token, sth.ID) th, err := svc.ViewThing(context.Background(), token, sth.ID) - assert.Equal(t, th, esth, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", th, esth)) - assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", err, eserr)) + assert.Equal(t, th, esth, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", th, esth)) + assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", err, eserr)) } func TestListThings(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -195,12 +195,12 @@ func TestListThings(t *testing.T) { essvc := redis.NewEventStoreMiddleware(svc, redisClient) esths, eserr := essvc.ListThings(context.Background(), token, things.PageMetadata{Offset: 0, Limit: 10}) ths, err := svc.ListThings(context.Background(), token, things.PageMetadata{Offset: 0, Limit: 10}) - assert.Equal(t, ths, esths, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", ths, esths)) - assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", err, eserr)) + assert.Equal(t, ths, esths, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", ths, esths)) + assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", err, eserr)) } func TestListThingsByChannel(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -216,12 +216,12 @@ func TestListThingsByChannel(t *testing.T) { essvc := redis.NewEventStoreMiddleware(svc, redisClient) esths, eserr := essvc.ListThingsByChannel(context.Background(), token, sch.ID, things.PageMetadata{Offset: 0, Limit: 10}) thps, err := svc.ListThingsByChannel(context.Background(), token, sch.ID, things.PageMetadata{Offset: 0, Limit: 10}) - assert.Equal(t, thps, esths, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", thps, esths)) - assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", err, eserr)) + assert.Equal(t, thps, esths, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", thps, esths)) + assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", err, eserr)) } func TestRemoveThing(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -262,7 +262,7 @@ func TestRemoveThing(t *testing.T) { err := svc.RemoveThing(context.Background(), tc.key, tc.id) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -280,7 +280,7 @@ func TestRemoveThing(t *testing.T) { } func TestCreateChannels(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) svc = redis.NewEventStoreMiddleware(svc, redisClient) @@ -319,7 +319,7 @@ func TestCreateChannels(t *testing.T) { _, err := svc.CreateChannels(context.Background(), tc.key, tc.chs...) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -337,7 +337,7 @@ func TestCreateChannels(t *testing.T) { } func TestUpdateChannel(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create channel without sending event. @@ -387,7 +387,7 @@ func TestUpdateChannel(t *testing.T) { err := svc.UpdateChannel(context.Background(), tc.key, tc.channel) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -405,7 +405,7 @@ func TestUpdateChannel(t *testing.T) { } func TestViewChannel(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create channel without sending event. @@ -416,12 +416,12 @@ func TestViewChannel(t *testing.T) { essvc := redis.NewEventStoreMiddleware(svc, redisClient) esch, eserr := essvc.ViewChannel(context.Background(), token, sch.ID) ch, err := svc.ViewChannel(context.Background(), token, sch.ID) - assert.Equal(t, ch, esch, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", ch, esch)) - assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", err, eserr)) + assert.Equal(t, ch, esch, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", ch, esch)) + assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", err, eserr)) } func TestListChannels(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -431,12 +431,12 @@ func TestListChannels(t *testing.T) { essvc := redis.NewEventStoreMiddleware(svc, redisClient) eschs, eserr := essvc.ListChannels(context.Background(), token, things.PageMetadata{Offset: 0, Limit: 10}) chs, err := svc.ListChannels(context.Background(), token, things.PageMetadata{Offset: 0, Limit: 10}) - assert.Equal(t, chs, eschs, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", chs, eschs)) - assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", err, eserr)) + assert.Equal(t, chs, eschs, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", chs, eschs)) + assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", err, eserr)) } func TestListChannelsByThing(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing without sending event. @@ -452,12 +452,12 @@ func TestListChannelsByThing(t *testing.T) { essvc := redis.NewEventStoreMiddleware(svc, redisClient) eschs, eserr := essvc.ListChannelsByThing(context.Background(), token, sth.ID, things.PageMetadata{Offset: 0, Limit: 10}) chps, err := svc.ListChannelsByThing(context.Background(), token, sth.ID, things.PageMetadata{Offset: 0, Limit: 10}) - assert.Equal(t, chps, eschs, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", chps, eschs)) - assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behaviour: expected %v got %v", err, eserr)) + assert.Equal(t, chps, eschs, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", chps, eschs)) + assert.Equal(t, err, eserr, fmt.Sprintf("event sourcing changed service behavior: expected %v got %v", err, eserr)) } func TestRemoveChannel(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create channel without sending event. @@ -498,7 +498,7 @@ func TestRemoveChannel(t *testing.T) { err := svc.RemoveChannel(context.Background(), tc.key, tc.id) assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -516,7 +516,7 @@ func TestRemoveChannel(t *testing.T) { } func TestConnectEvent(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing and channel that will be connected. @@ -564,7 +564,7 @@ func TestConnectEvent(t *testing.T) { err := svc.Connect(context.Background(), tc.key, []string{tc.chanID}, []string{tc.thingID}) assert.Equal(t, tc.err, err, fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, @@ -582,7 +582,7 @@ func TestConnectEvent(t *testing.T) { } func TestDisconnectEvent(t *testing.T) { - _ = redisClient.FlushAll().Err() + _ = redisClient.FlushAll(context.Background()).Err() svc := newService(map[string]string{token: email}) // Create thing and channel that will be connected. @@ -632,7 +632,7 @@ func TestDisconnectEvent(t *testing.T) { err := svc.Disconnect(context.Background(), tc.key, tc.chanID, tc.thingID) assert.Equal(t, tc.err, err, fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err)) - streams := redisClient.XRead(&r.XReadArgs{ + streams := redisClient.XRead(context.Background(), &r.XReadArgs{ Streams: []string{streamID, lastID}, Count: 1, Block: time.Second, diff --git a/things/redis/things.go b/things/redis/things.go index 1d8db5f03c..eefa083869 100644 --- a/things/redis/things.go +++ b/things/redis/things.go @@ -7,7 +7,7 @@ import ( "context" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/pkg/errors" "github.com/mainflux/mainflux/things" ) @@ -30,22 +30,22 @@ func NewThingCache(client *redis.Client) things.ThingCache { } } -func (tc *thingCache) Save(_ context.Context, thingKey string, thingID string) error { +func (tc *thingCache) Save(ctx context.Context, thingKey string, thingID string) error { tkey := fmt.Sprintf("%s:%s", keyPrefix, thingKey) - if err := tc.client.Set(tkey, thingID, 0).Err(); err != nil { + if err := tc.client.Set(ctx, tkey, thingID, 0).Err(); err != nil { return errors.Wrap(things.ErrCreateEntity, err) } tid := fmt.Sprintf("%s:%s", idPrefix, thingID) - if err := tc.client.Set(tid, thingKey, 0).Err(); err != nil { + if err := tc.client.Set(ctx, tid, thingKey, 0).Err(); err != nil { return errors.Wrap(things.ErrCreateEntity, err) } return nil } -func (tc *thingCache) ID(_ context.Context, thingKey string) (string, error) { +func (tc *thingCache) ID(ctx context.Context, thingKey string) (string, error) { tkey := fmt.Sprintf("%s:%s", keyPrefix, thingKey) - thingID, err := tc.client.Get(tkey).Result() + thingID, err := tc.client.Get(ctx, tkey).Result() if err != nil { return "", errors.Wrap(things.ErrNotFound, err) } @@ -53,9 +53,9 @@ func (tc *thingCache) ID(_ context.Context, thingKey string) (string, error) { return thingID, nil } -func (tc *thingCache) Remove(_ context.Context, thingID string) error { +func (tc *thingCache) Remove(ctx context.Context, thingID string) error { tid := fmt.Sprintf("%s:%s", idPrefix, thingID) - key, err := tc.client.Get(tid).Result() + key, err := tc.client.Get(ctx, tid).Result() // Redis returns Nil Reply when key does not exist. if err == redis.Nil { return nil @@ -65,7 +65,7 @@ func (tc *thingCache) Remove(_ context.Context, thingID string) error { } tkey := fmt.Sprintf("%s:%s", keyPrefix, key) - if err := tc.client.Del(tkey, tid).Err(); err != nil { + if err := tc.client.Del(ctx, tkey, tid).Err(); err != nil { return errors.Wrap(things.ErrRemoveEntity, err) } return nil diff --git a/things/redis/things_test.go b/things/redis/things_test.go index 6176624f39..531c401db0 100644 --- a/things/redis/things_test.go +++ b/things/redis/things_test.go @@ -8,7 +8,7 @@ import ( "fmt" "testing" - r "github.com/go-redis/redis" + r "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/pkg/errors" "github.com/mainflux/mainflux/pkg/uuid" "github.com/mainflux/mainflux/things/redis" diff --git a/tools/mqtt-bench/bench.go b/tools/mqtt-bench/bench.go index d6d1ea1e5b..9c6cfdc5d9 100644 --- a/tools/mqtt-bench/bench.go +++ b/tools/mqtt-bench/bench.go @@ -14,7 +14,7 @@ import ( "strconv" "time" - "github.com/BurntSushi/toml" + "github.com/pelletier/go-toml" ) // Benchmark - main benchmarking function @@ -33,8 +33,13 @@ func Benchmark(cfg Config) { caByte, _ = ioutil.ReadAll(caFile) } + data, err := ioutil.ReadFile(cfg.Mf.ConnFile) + if err != nil { + log.Fatalf("Error loading connections file: %s", err) + } + mf := mainflux{} - if _, err := toml.DecodeFile(cfg.Mf.ConnFile, &mf); err != nil { + if err := toml.Unmarshal(data, &mf); err != nil { log.Fatalf("Cannot load Mainflux connections config %s \nUse tools/provision to create file", cfg.Mf.ConnFile) } diff --git a/twins/redis/setup_test.go b/twins/redis/setup_test.go index c335068f2b..20bdf1f0c2 100644 --- a/twins/redis/setup_test.go +++ b/twins/redis/setup_test.go @@ -4,12 +4,13 @@ package redis_test import ( + "context" "fmt" "log" "os" "testing" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" dockertest "github.com/ory/dockertest/v3" ) @@ -38,7 +39,7 @@ func TestMain(m *testing.M) { DB: 0, }) - return redisClient.Ping().Err() + return redisClient.Ping(context.Background()).Err() }); err != nil { log.Fatalf("Could not connect to docker: %s", err) } diff --git a/twins/redis/twins.go b/twins/redis/twins.go index 931915f0fe..6d13002fed 100644 --- a/twins/redis/twins.go +++ b/twins/redis/twins.go @@ -7,7 +7,7 @@ import ( "context" "fmt" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "github.com/mainflux/mainflux/pkg/errors" "github.com/mainflux/mainflux/twins" ) @@ -43,38 +43,38 @@ func NewTwinCache(client *redis.Client) twins.TwinCache { } } -func (tc *twinCache) Save(_ context.Context, twin twins.Twin) error { - return tc.save(twin) +func (tc *twinCache) Save(ctx context.Context, twin twins.Twin) error { + return tc.save(ctx, twin) } -func (tc *twinCache) Update(_ context.Context, twin twins.Twin) error { - if err := tc.remove(twin.ID); err != nil { +func (tc *twinCache) Update(ctx context.Context, twin twins.Twin) error { + if err := tc.remove(ctx, twin.ID); err != nil { return errors.Wrap(ErrRedisTwinUpdate, err) } - if err := tc.save(twin); err != nil { + if err := tc.save(ctx, twin); err != nil { return errors.Wrap(ErrRedisTwinUpdate, err) } return nil } -func (tc *twinCache) SaveIDs(_ context.Context, channel, subtopic string, ids []string) error { +func (tc *twinCache) SaveIDs(ctx context.Context, channel, subtopic string, ids []string) error { for _, id := range ids { - if err := tc.client.SAdd(attrKey(channel, subtopic), id).Err(); err != nil { + if err := tc.client.SAdd(ctx, attrKey(channel, subtopic), id).Err(); err != nil { return errors.Wrap(ErrRedisTwinSave, err) } - if err := tc.client.SAdd(twinKey(id), attrKey(channel, subtopic)).Err(); err != nil { + if err := tc.client.SAdd(ctx, twinKey(id), attrKey(channel, subtopic)).Err(); err != nil { return errors.Wrap(ErrRedisTwinSave, err) } } return nil } -func (tc *twinCache) IDs(_ context.Context, channel, subtopic string) ([]string, error) { - ids, err := tc.client.SMembers(attrKey(channel, subtopic)).Result() +func (tc *twinCache) IDs(ctx context.Context, channel, subtopic string) ([]string, error) { + ids, err := tc.client.SMembers(ctx, attrKey(channel, subtopic)).Result() if err != nil { return nil, errors.Wrap(ErrRedisTwinIDs, err) } - idsWildcard, err := tc.client.SMembers(attrKey(channel, twins.SubtopicWildcard)).Result() + idsWildcard, err := tc.client.SMembers(ctx, attrKey(channel, twins.SubtopicWildcard)).Result() if err != nil { return nil, errors.Wrap(ErrRedisTwinIDs, err) } @@ -82,37 +82,37 @@ func (tc *twinCache) IDs(_ context.Context, channel, subtopic string) ([]string, return ids, nil } -func (tc *twinCache) Remove(_ context.Context, twinID string) error { - return tc.remove(twinID) +func (tc *twinCache) Remove(ctx context.Context, twinID string) error { + return tc.remove(ctx, twinID) } -func (tc *twinCache) save(twin twins.Twin) error { +func (tc *twinCache) save(ctx context.Context, twin twins.Twin) error { if len(twin.Definitions) < 1 { return nil } attributes := twin.Definitions[len(twin.Definitions)-1].Attributes for _, attr := range attributes { - if err := tc.client.SAdd(attrKey(attr.Channel, attr.Subtopic), twin.ID).Err(); err != nil { + if err := tc.client.SAdd(ctx, attrKey(attr.Channel, attr.Subtopic), twin.ID).Err(); err != nil { return errors.Wrap(ErrRedisTwinSave, err) } - if err := tc.client.SAdd(twinKey(twin.ID), attrKey(attr.Channel, attr.Subtopic)).Err(); err != nil { + if err := tc.client.SAdd(ctx, twinKey(twin.ID), attrKey(attr.Channel, attr.Subtopic)).Err(); err != nil { return errors.Wrap(ErrRedisTwinSave, err) } } return nil } -func (tc *twinCache) remove(twinID string) error { +func (tc *twinCache) remove(ctx context.Context, twinID string) error { twinKey := twinKey(twinID) - attrKeys, err := tc.client.SMembers(twinKey).Result() + attrKeys, err := tc.client.SMembers(ctx, twinKey).Result() if err != nil { return errors.Wrap(ErrRedisTwinRemove, err) } - if err := tc.client.Del(twinKey).Err(); err != nil { + if err := tc.client.Del(ctx, twinKey).Err(); err != nil { return errors.Wrap(ErrRedisTwinRemove, err) } for _, attrKey := range attrKeys { - if err := tc.client.SRem(attrKey, twinID).Err(); err != nil { + if err := tc.client.SRem(ctx, attrKey, twinID).Err(); err != nil { return errors.Wrap(ErrRedisTwinRemove, err) } } diff --git a/twins/redis/twins_test.go b/twins/redis/twins_test.go index 0714a87bcd..2ea5aada12 100644 --- a/twins/redis/twins_test.go +++ b/twins/redis/twins_test.go @@ -21,7 +21,7 @@ var ( ) func TestTwinSave(t *testing.T) { - redisClient.FlushAll() + redisClient.FlushAll(context.Background()) twinCache := redis.NewTwinCache(redisClient) twin1 := mocks.CreateTwin(channels[0:2], subtopics[0:2]) @@ -69,7 +69,7 @@ func TestTwinSave(t *testing.T) { } func TestTwinSaveIDs(t *testing.T) { - redisClient.FlushAll() + redisClient.FlushAll(context.Background()) twinCache := redis.NewTwinCache(redisClient) twinIDs := []string{"7956f132-0b42-488d-9bd1-0f6dd9d77f98", "a2210c42-1eaf-41ad-b8c1-813317719ed9", "6e815c79-a159-41b0-9ff0-cfa14430e07e"} @@ -123,7 +123,7 @@ func TestTwinSaveIDs(t *testing.T) { } func TestTwinUpdate(t *testing.T) { - redisClient.FlushAll() + redisClient.FlushAll(context.Background()) twinCache := redis.NewTwinCache(redisClient) ctx := context.Background() @@ -174,7 +174,7 @@ func TestTwinUpdate(t *testing.T) { } func TestTwinIDs(t *testing.T) { - redisClient.FlushAll() + redisClient.FlushAll(context.Background()) twinCache := redis.NewTwinCache(redisClient) ctx := context.Background() @@ -244,7 +244,7 @@ func TestTwinIDs(t *testing.T) { } func TestTwinRemove(t *testing.T) { - redisClient.FlushAll() + redisClient.FlushAll(context.Background()) twinCache := redis.NewTwinCache(redisClient) ctx := context.Background() diff --git a/vendor/github.com/BurntSushi/toml/.gitignore b/vendor/github.com/BurntSushi/toml/.gitignore deleted file mode 100644 index 0cd3800377..0000000000 --- a/vendor/github.com/BurntSushi/toml/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -TAGS -tags -.*.swp -tomlcheck/tomlcheck -toml.test diff --git a/vendor/github.com/BurntSushi/toml/.travis.yml b/vendor/github.com/BurntSushi/toml/.travis.yml deleted file mode 100644 index 8b8afc4f0e..0000000000 --- a/vendor/github.com/BurntSushi/toml/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -go: - - 1.1 - - 1.2 - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - tip -install: - - go install ./... - - go get github.com/BurntSushi/toml-test -script: - - export PATH="$PATH:$HOME/gopath/bin" - - make test diff --git a/vendor/github.com/BurntSushi/toml/COMPATIBLE b/vendor/github.com/BurntSushi/toml/COMPATIBLE deleted file mode 100644 index 6efcfd0ce5..0000000000 --- a/vendor/github.com/BurntSushi/toml/COMPATIBLE +++ /dev/null @@ -1,3 +0,0 @@ -Compatible with TOML version -[v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md) - diff --git a/vendor/github.com/BurntSushi/toml/Makefile b/vendor/github.com/BurntSushi/toml/Makefile deleted file mode 100644 index 3600848d33..0000000000 --- a/vendor/github.com/BurntSushi/toml/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -install: - go install ./... - -test: install - go test -v - toml-test toml-test-decoder - toml-test -encoder toml-test-encoder - -fmt: - gofmt -w *.go */*.go - colcheck *.go */*.go - -tags: - find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS - -push: - git push origin master - git push github master - diff --git a/vendor/github.com/BurntSushi/toml/README.md b/vendor/github.com/BurntSushi/toml/README.md deleted file mode 100644 index 7c1b37ecc7..0000000000 --- a/vendor/github.com/BurntSushi/toml/README.md +++ /dev/null @@ -1,218 +0,0 @@ -## TOML parser and encoder for Go with reflection - -TOML stands for Tom's Obvious, Minimal Language. This Go package provides a -reflection interface similar to Go's standard library `json` and `xml` -packages. This package also supports the `encoding.TextUnmarshaler` and -`encoding.TextMarshaler` interfaces so that you can define custom data -representations. (There is an example of this below.) - -Spec: https://github.com/toml-lang/toml - -Compatible with TOML version -[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md) - -Documentation: https://godoc.org/github.com/BurntSushi/toml - -Installation: - -```bash -go get github.com/BurntSushi/toml -``` - -Try the toml validator: - -```bash -go get github.com/BurntSushi/toml/cmd/tomlv -tomlv some-toml-file.toml -``` - -[![Build Status](https://travis-ci.org/BurntSushi/toml.svg?branch=master)](https://travis-ci.org/BurntSushi/toml) [![GoDoc](https://godoc.org/github.com/BurntSushi/toml?status.svg)](https://godoc.org/github.com/BurntSushi/toml) - -### Testing - -This package passes all tests in -[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder -and the encoder. - -### Examples - -This package works similarly to how the Go standard library handles `XML` -and `JSON`. Namely, data is loaded into Go values via reflection. - -For the simplest example, consider some TOML file as just a list of keys -and values: - -```toml -Age = 25 -Cats = [ "Cauchy", "Plato" ] -Pi = 3.14 -Perfection = [ 6, 28, 496, 8128 ] -DOB = 1987-07-05T05:45:00Z -``` - -Which could be defined in Go as: - -```go -type Config struct { - Age int - Cats []string - Pi float64 - Perfection []int - DOB time.Time // requires `import time` -} -``` - -And then decoded with: - -```go -var conf Config -if _, err := toml.Decode(tomlData, &conf); err != nil { - // handle error -} -``` - -You can also use struct tags if your struct field name doesn't map to a TOML -key value directly: - -```toml -some_key_NAME = "wat" -``` - -```go -type TOML struct { - ObscureKey string `toml:"some_key_NAME"` -} -``` - -### Using the `encoding.TextUnmarshaler` interface - -Here's an example that automatically parses duration strings into -`time.Duration` values: - -```toml -[[song]] -name = "Thunder Road" -duration = "4m49s" - -[[song]] -name = "Stairway to Heaven" -duration = "8m03s" -``` - -Which can be decoded with: - -```go -type song struct { - Name string - Duration duration -} -type songs struct { - Song []song -} -var favorites songs -if _, err := toml.Decode(blob, &favorites); err != nil { - log.Fatal(err) -} - -for _, s := range favorites.Song { - fmt.Printf("%s (%s)\n", s.Name, s.Duration) -} -``` - -And you'll also need a `duration` type that satisfies the -`encoding.TextUnmarshaler` interface: - -```go -type duration struct { - time.Duration -} - -func (d *duration) UnmarshalText(text []byte) error { - var err error - d.Duration, err = time.ParseDuration(string(text)) - return err -} -``` - -### More complex usage - -Here's an example of how to load the example from the official spec page: - -```toml -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T07:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] -``` - -And the corresponding Go types are: - -```go -type tomlConfig struct { - Title string - Owner ownerInfo - DB database `toml:"database"` - Servers map[string]server - Clients clients -} - -type ownerInfo struct { - Name string - Org string `toml:"organization"` - Bio string - DOB time.Time -} - -type database struct { - Server string - Ports []int - ConnMax int `toml:"connection_max"` - Enabled bool -} - -type server struct { - IP string - DC string -} - -type clients struct { - Data [][]interface{} - Hosts []string -} -``` - -Note that a case insensitive match will be tried if an exact match can't be -found. - -A working example of the above can be found in `_examples/example.{go,toml}`. diff --git a/vendor/github.com/BurntSushi/toml/decode.go b/vendor/github.com/BurntSushi/toml/decode.go deleted file mode 100644 index b0fd51d5b6..0000000000 --- a/vendor/github.com/BurntSushi/toml/decode.go +++ /dev/null @@ -1,509 +0,0 @@ -package toml - -import ( - "fmt" - "io" - "io/ioutil" - "math" - "reflect" - "strings" - "time" -) - -func e(format string, args ...interface{}) error { - return fmt.Errorf("toml: "+format, args...) -} - -// Unmarshaler is the interface implemented by objects that can unmarshal a -// TOML description of themselves. -type Unmarshaler interface { - UnmarshalTOML(interface{}) error -} - -// Unmarshal decodes the contents of `p` in TOML format into a pointer `v`. -func Unmarshal(p []byte, v interface{}) error { - _, err := Decode(string(p), v) - return err -} - -// Primitive is a TOML value that hasn't been decoded into a Go value. -// When using the various `Decode*` functions, the type `Primitive` may -// be given to any value, and its decoding will be delayed. -// -// A `Primitive` value can be decoded using the `PrimitiveDecode` function. -// -// The underlying representation of a `Primitive` value is subject to change. -// Do not rely on it. -// -// N.B. Primitive values are still parsed, so using them will only avoid -// the overhead of reflection. They can be useful when you don't know the -// exact type of TOML data until run time. -type Primitive struct { - undecoded interface{} - context Key -} - -// DEPRECATED! -// -// Use MetaData.PrimitiveDecode instead. -func PrimitiveDecode(primValue Primitive, v interface{}) error { - md := MetaData{decoded: make(map[string]bool)} - return md.unify(primValue.undecoded, rvalue(v)) -} - -// PrimitiveDecode is just like the other `Decode*` functions, except it -// decodes a TOML value that has already been parsed. Valid primitive values -// can *only* be obtained from values filled by the decoder functions, -// including this method. (i.e., `v` may contain more `Primitive` -// values.) -// -// Meta data for primitive values is included in the meta data returned by -// the `Decode*` functions with one exception: keys returned by the Undecoded -// method will only reflect keys that were decoded. Namely, any keys hidden -// behind a Primitive will be considered undecoded. Executing this method will -// update the undecoded keys in the meta data. (See the example.) -func (md *MetaData) PrimitiveDecode(primValue Primitive, v interface{}) error { - md.context = primValue.context - defer func() { md.context = nil }() - return md.unify(primValue.undecoded, rvalue(v)) -} - -// Decode will decode the contents of `data` in TOML format into a pointer -// `v`. -// -// TOML hashes correspond to Go structs or maps. (Dealer's choice. They can be -// used interchangeably.) -// -// TOML arrays of tables correspond to either a slice of structs or a slice -// of maps. -// -// TOML datetimes correspond to Go `time.Time` values. -// -// All other TOML types (float, string, int, bool and array) correspond -// to the obvious Go types. -// -// An exception to the above rules is if a type implements the -// encoding.TextUnmarshaler interface. In this case, any primitive TOML value -// (floats, strings, integers, booleans and datetimes) will be converted to -// a byte string and given to the value's UnmarshalText method. See the -// Unmarshaler example for a demonstration with time duration strings. -// -// Key mapping -// -// TOML keys can map to either keys in a Go map or field names in a Go -// struct. The special `toml` struct tag may be used to map TOML keys to -// struct fields that don't match the key name exactly. (See the example.) -// A case insensitive match to struct names will be tried if an exact match -// can't be found. -// -// The mapping between TOML values and Go values is loose. That is, there -// may exist TOML values that cannot be placed into your representation, and -// there may be parts of your representation that do not correspond to -// TOML values. This loose mapping can be made stricter by using the IsDefined -// and/or Undecoded methods on the MetaData returned. -// -// This decoder will not handle cyclic types. If a cyclic type is passed, -// `Decode` will not terminate. -func Decode(data string, v interface{}) (MetaData, error) { - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr { - return MetaData{}, e("Decode of non-pointer %s", reflect.TypeOf(v)) - } - if rv.IsNil() { - return MetaData{}, e("Decode of nil %s", reflect.TypeOf(v)) - } - p, err := parse(data) - if err != nil { - return MetaData{}, err - } - md := MetaData{ - p.mapping, p.types, p.ordered, - make(map[string]bool, len(p.ordered)), nil, - } - return md, md.unify(p.mapping, indirect(rv)) -} - -// DecodeFile is just like Decode, except it will automatically read the -// contents of the file at `fpath` and decode it for you. -func DecodeFile(fpath string, v interface{}) (MetaData, error) { - bs, err := ioutil.ReadFile(fpath) - if err != nil { - return MetaData{}, err - } - return Decode(string(bs), v) -} - -// DecodeReader is just like Decode, except it will consume all bytes -// from the reader and decode it for you. -func DecodeReader(r io.Reader, v interface{}) (MetaData, error) { - bs, err := ioutil.ReadAll(r) - if err != nil { - return MetaData{}, err - } - return Decode(string(bs), v) -} - -// unify performs a sort of type unification based on the structure of `rv`, -// which is the client representation. -// -// Any type mismatch produces an error. Finding a type that we don't know -// how to handle produces an unsupported type error. -func (md *MetaData) unify(data interface{}, rv reflect.Value) error { - - // Special case. Look for a `Primitive` value. - if rv.Type() == reflect.TypeOf((*Primitive)(nil)).Elem() { - // Save the undecoded data and the key context into the primitive - // value. - context := make(Key, len(md.context)) - copy(context, md.context) - rv.Set(reflect.ValueOf(Primitive{ - undecoded: data, - context: context, - })) - return nil - } - - // Special case. Unmarshaler Interface support. - if rv.CanAddr() { - if v, ok := rv.Addr().Interface().(Unmarshaler); ok { - return v.UnmarshalTOML(data) - } - } - - // Special case. Handle time.Time values specifically. - // TODO: Remove this code when we decide to drop support for Go 1.1. - // This isn't necessary in Go 1.2 because time.Time satisfies the encoding - // interfaces. - if rv.Type().AssignableTo(rvalue(time.Time{}).Type()) { - return md.unifyDatetime(data, rv) - } - - // Special case. Look for a value satisfying the TextUnmarshaler interface. - if v, ok := rv.Interface().(TextUnmarshaler); ok { - return md.unifyText(data, v) - } - // BUG(burntsushi) - // The behavior here is incorrect whenever a Go type satisfies the - // encoding.TextUnmarshaler interface but also corresponds to a TOML - // hash or array. In particular, the unmarshaler should only be applied - // to primitive TOML values. But at this point, it will be applied to - // all kinds of values and produce an incorrect error whenever those values - // are hashes or arrays (including arrays of tables). - - k := rv.Kind() - - // laziness - if k >= reflect.Int && k <= reflect.Uint64 { - return md.unifyInt(data, rv) - } - switch k { - case reflect.Ptr: - elem := reflect.New(rv.Type().Elem()) - err := md.unify(data, reflect.Indirect(elem)) - if err != nil { - return err - } - rv.Set(elem) - return nil - case reflect.Struct: - return md.unifyStruct(data, rv) - case reflect.Map: - return md.unifyMap(data, rv) - case reflect.Array: - return md.unifyArray(data, rv) - case reflect.Slice: - return md.unifySlice(data, rv) - case reflect.String: - return md.unifyString(data, rv) - case reflect.Bool: - return md.unifyBool(data, rv) - case reflect.Interface: - // we only support empty interfaces. - if rv.NumMethod() > 0 { - return e("unsupported type %s", rv.Type()) - } - return md.unifyAnything(data, rv) - case reflect.Float32: - fallthrough - case reflect.Float64: - return md.unifyFloat64(data, rv) - } - return e("unsupported type %s", rv.Kind()) -} - -func (md *MetaData) unifyStruct(mapping interface{}, rv reflect.Value) error { - tmap, ok := mapping.(map[string]interface{}) - if !ok { - if mapping == nil { - return nil - } - return e("type mismatch for %s: expected table but found %T", - rv.Type().String(), mapping) - } - - for key, datum := range tmap { - var f *field - fields := cachedTypeFields(rv.Type()) - for i := range fields { - ff := &fields[i] - if ff.name == key { - f = ff - break - } - if f == nil && strings.EqualFold(ff.name, key) { - f = ff - } - } - if f != nil { - subv := rv - for _, i := range f.index { - subv = indirect(subv.Field(i)) - } - if isUnifiable(subv) { - md.decoded[md.context.add(key).String()] = true - md.context = append(md.context, key) - if err := md.unify(datum, subv); err != nil { - return err - } - md.context = md.context[0 : len(md.context)-1] - } else if f.name != "" { - // Bad user! No soup for you! - return e("cannot write unexported field %s.%s", - rv.Type().String(), f.name) - } - } - } - return nil -} - -func (md *MetaData) unifyMap(mapping interface{}, rv reflect.Value) error { - tmap, ok := mapping.(map[string]interface{}) - if !ok { - if tmap == nil { - return nil - } - return badtype("map", mapping) - } - if rv.IsNil() { - rv.Set(reflect.MakeMap(rv.Type())) - } - for k, v := range tmap { - md.decoded[md.context.add(k).String()] = true - md.context = append(md.context, k) - - rvkey := indirect(reflect.New(rv.Type().Key())) - rvval := reflect.Indirect(reflect.New(rv.Type().Elem())) - if err := md.unify(v, rvval); err != nil { - return err - } - md.context = md.context[0 : len(md.context)-1] - - rvkey.SetString(k) - rv.SetMapIndex(rvkey, rvval) - } - return nil -} - -func (md *MetaData) unifyArray(data interface{}, rv reflect.Value) error { - datav := reflect.ValueOf(data) - if datav.Kind() != reflect.Slice { - if !datav.IsValid() { - return nil - } - return badtype("slice", data) - } - sliceLen := datav.Len() - if sliceLen != rv.Len() { - return e("expected array length %d; got TOML array of length %d", - rv.Len(), sliceLen) - } - return md.unifySliceArray(datav, rv) -} - -func (md *MetaData) unifySlice(data interface{}, rv reflect.Value) error { - datav := reflect.ValueOf(data) - if datav.Kind() != reflect.Slice { - if !datav.IsValid() { - return nil - } - return badtype("slice", data) - } - n := datav.Len() - if rv.IsNil() || rv.Cap() < n { - rv.Set(reflect.MakeSlice(rv.Type(), n, n)) - } - rv.SetLen(n) - return md.unifySliceArray(datav, rv) -} - -func (md *MetaData) unifySliceArray(data, rv reflect.Value) error { - sliceLen := data.Len() - for i := 0; i < sliceLen; i++ { - v := data.Index(i).Interface() - sliceval := indirect(rv.Index(i)) - if err := md.unify(v, sliceval); err != nil { - return err - } - } - return nil -} - -func (md *MetaData) unifyDatetime(data interface{}, rv reflect.Value) error { - if _, ok := data.(time.Time); ok { - rv.Set(reflect.ValueOf(data)) - return nil - } - return badtype("time.Time", data) -} - -func (md *MetaData) unifyString(data interface{}, rv reflect.Value) error { - if s, ok := data.(string); ok { - rv.SetString(s) - return nil - } - return badtype("string", data) -} - -func (md *MetaData) unifyFloat64(data interface{}, rv reflect.Value) error { - if num, ok := data.(float64); ok { - switch rv.Kind() { - case reflect.Float32: - fallthrough - case reflect.Float64: - rv.SetFloat(num) - default: - panic("bug") - } - return nil - } - return badtype("float", data) -} - -func (md *MetaData) unifyInt(data interface{}, rv reflect.Value) error { - if num, ok := data.(int64); ok { - if rv.Kind() >= reflect.Int && rv.Kind() <= reflect.Int64 { - switch rv.Kind() { - case reflect.Int, reflect.Int64: - // No bounds checking necessary. - case reflect.Int8: - if num < math.MinInt8 || num > math.MaxInt8 { - return e("value %d is out of range for int8", num) - } - case reflect.Int16: - if num < math.MinInt16 || num > math.MaxInt16 { - return e("value %d is out of range for int16", num) - } - case reflect.Int32: - if num < math.MinInt32 || num > math.MaxInt32 { - return e("value %d is out of range for int32", num) - } - } - rv.SetInt(num) - } else if rv.Kind() >= reflect.Uint && rv.Kind() <= reflect.Uint64 { - unum := uint64(num) - switch rv.Kind() { - case reflect.Uint, reflect.Uint64: - // No bounds checking necessary. - case reflect.Uint8: - if num < 0 || unum > math.MaxUint8 { - return e("value %d is out of range for uint8", num) - } - case reflect.Uint16: - if num < 0 || unum > math.MaxUint16 { - return e("value %d is out of range for uint16", num) - } - case reflect.Uint32: - if num < 0 || unum > math.MaxUint32 { - return e("value %d is out of range for uint32", num) - } - } - rv.SetUint(unum) - } else { - panic("unreachable") - } - return nil - } - return badtype("integer", data) -} - -func (md *MetaData) unifyBool(data interface{}, rv reflect.Value) error { - if b, ok := data.(bool); ok { - rv.SetBool(b) - return nil - } - return badtype("boolean", data) -} - -func (md *MetaData) unifyAnything(data interface{}, rv reflect.Value) error { - rv.Set(reflect.ValueOf(data)) - return nil -} - -func (md *MetaData) unifyText(data interface{}, v TextUnmarshaler) error { - var s string - switch sdata := data.(type) { - case TextMarshaler: - text, err := sdata.MarshalText() - if err != nil { - return err - } - s = string(text) - case fmt.Stringer: - s = sdata.String() - case string: - s = sdata - case bool: - s = fmt.Sprintf("%v", sdata) - case int64: - s = fmt.Sprintf("%d", sdata) - case float64: - s = fmt.Sprintf("%f", sdata) - default: - return badtype("primitive (string-like)", data) - } - if err := v.UnmarshalText([]byte(s)); err != nil { - return err - } - return nil -} - -// rvalue returns a reflect.Value of `v`. All pointers are resolved. -func rvalue(v interface{}) reflect.Value { - return indirect(reflect.ValueOf(v)) -} - -// indirect returns the value pointed to by a pointer. -// Pointers are followed until the value is not a pointer. -// New values are allocated for each nil pointer. -// -// An exception to this rule is if the value satisfies an interface of -// interest to us (like encoding.TextUnmarshaler). -func indirect(v reflect.Value) reflect.Value { - if v.Kind() != reflect.Ptr { - if v.CanSet() { - pv := v.Addr() - if _, ok := pv.Interface().(TextUnmarshaler); ok { - return pv - } - } - return v - } - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - return indirect(reflect.Indirect(v)) -} - -func isUnifiable(rv reflect.Value) bool { - if rv.CanSet() { - return true - } - if _, ok := rv.Interface().(TextUnmarshaler); ok { - return true - } - return false -} - -func badtype(expected string, data interface{}) error { - return e("cannot load TOML value of type %T into a Go %s", data, expected) -} diff --git a/vendor/github.com/BurntSushi/toml/decode_meta.go b/vendor/github.com/BurntSushi/toml/decode_meta.go deleted file mode 100644 index b9914a6798..0000000000 --- a/vendor/github.com/BurntSushi/toml/decode_meta.go +++ /dev/null @@ -1,121 +0,0 @@ -package toml - -import "strings" - -// MetaData allows access to meta information about TOML data that may not -// be inferrable via reflection. In particular, whether a key has been defined -// and the TOML type of a key. -type MetaData struct { - mapping map[string]interface{} - types map[string]tomlType - keys []Key - decoded map[string]bool - context Key // Used only during decoding. -} - -// IsDefined returns true if the key given exists in the TOML data. The key -// should be specified hierarchially. e.g., -// -// // access the TOML key 'a.b.c' -// IsDefined("a", "b", "c") -// -// IsDefined will return false if an empty key given. Keys are case sensitive. -func (md *MetaData) IsDefined(key ...string) bool { - if len(key) == 0 { - return false - } - - var hash map[string]interface{} - var ok bool - var hashOrVal interface{} = md.mapping - for _, k := range key { - if hash, ok = hashOrVal.(map[string]interface{}); !ok { - return false - } - if hashOrVal, ok = hash[k]; !ok { - return false - } - } - return true -} - -// Type returns a string representation of the type of the key specified. -// -// Type will return the empty string if given an empty key or a key that -// does not exist. Keys are case sensitive. -func (md *MetaData) Type(key ...string) string { - fullkey := strings.Join(key, ".") - if typ, ok := md.types[fullkey]; ok { - return typ.typeString() - } - return "" -} - -// Key is the type of any TOML key, including key groups. Use (MetaData).Keys -// to get values of this type. -type Key []string - -func (k Key) String() string { - return strings.Join(k, ".") -} - -func (k Key) maybeQuotedAll() string { - var ss []string - for i := range k { - ss = append(ss, k.maybeQuoted(i)) - } - return strings.Join(ss, ".") -} - -func (k Key) maybeQuoted(i int) string { - quote := false - for _, c := range k[i] { - if !isBareKeyChar(c) { - quote = true - break - } - } - if quote { - return "\"" + strings.Replace(k[i], "\"", "\\\"", -1) + "\"" - } - return k[i] -} - -func (k Key) add(piece string) Key { - newKey := make(Key, len(k)+1) - copy(newKey, k) - newKey[len(k)] = piece - return newKey -} - -// Keys returns a slice of every key in the TOML data, including key groups. -// Each key is itself a slice, where the first element is the top of the -// hierarchy and the last is the most specific. -// -// The list will have the same order as the keys appeared in the TOML data. -// -// All keys returned are non-empty. -func (md *MetaData) Keys() []Key { - return md.keys -} - -// Undecoded returns all keys that have not been decoded in the order in which -// they appear in the original TOML document. -// -// This includes keys that haven't been decoded because of a Primitive value. -// Once the Primitive value is decoded, the keys will be considered decoded. -// -// Also note that decoding into an empty interface will result in no decoding, -// and so no keys will be considered decoded. -// -// In this sense, the Undecoded keys correspond to keys in the TOML document -// that do not have a concrete type in your representation. -func (md *MetaData) Undecoded() []Key { - undecoded := make([]Key, 0, len(md.keys)) - for _, key := range md.keys { - if !md.decoded[key.String()] { - undecoded = append(undecoded, key) - } - } - return undecoded -} diff --git a/vendor/github.com/BurntSushi/toml/doc.go b/vendor/github.com/BurntSushi/toml/doc.go deleted file mode 100644 index b371f396ed..0000000000 --- a/vendor/github.com/BurntSushi/toml/doc.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Package toml provides facilities for decoding and encoding TOML configuration -files via reflection. There is also support for delaying decoding with -the Primitive type, and querying the set of keys in a TOML document with the -MetaData type. - -The specification implemented: https://github.com/toml-lang/toml - -The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify -whether a file is a valid TOML document. It can also be used to print the -type of each key in a TOML document. - -Testing - -There are two important types of tests used for this package. The first is -contained inside '*_test.go' files and uses the standard Go unit testing -framework. These tests are primarily devoted to holistically testing the -decoder and encoder. - -The second type of testing is used to verify the implementation's adherence -to the TOML specification. These tests have been factored into their own -project: https://github.com/BurntSushi/toml-test - -The reason the tests are in a separate project is so that they can be used by -any implementation of TOML. Namely, it is language agnostic. -*/ -package toml diff --git a/vendor/github.com/BurntSushi/toml/encode.go b/vendor/github.com/BurntSushi/toml/encode.go deleted file mode 100644 index d905c21a24..0000000000 --- a/vendor/github.com/BurntSushi/toml/encode.go +++ /dev/null @@ -1,568 +0,0 @@ -package toml - -import ( - "bufio" - "errors" - "fmt" - "io" - "reflect" - "sort" - "strconv" - "strings" - "time" -) - -type tomlEncodeError struct{ error } - -var ( - errArrayMixedElementTypes = errors.New( - "toml: cannot encode array with mixed element types") - errArrayNilElement = errors.New( - "toml: cannot encode array with nil element") - errNonString = errors.New( - "toml: cannot encode a map with non-string key type") - errAnonNonStruct = errors.New( - "toml: cannot encode an anonymous field that is not a struct") - errArrayNoTable = errors.New( - "toml: TOML array element cannot contain a table") - errNoKey = errors.New( - "toml: top-level values must be Go maps or structs") - errAnything = errors.New("") // used in testing -) - -var quotedReplacer = strings.NewReplacer( - "\t", "\\t", - "\n", "\\n", - "\r", "\\r", - "\"", "\\\"", - "\\", "\\\\", -) - -// Encoder controls the encoding of Go values to a TOML document to some -// io.Writer. -// -// The indentation level can be controlled with the Indent field. -type Encoder struct { - // A single indentation level. By default it is two spaces. - Indent string - - // hasWritten is whether we have written any output to w yet. - hasWritten bool - w *bufio.Writer -} - -// NewEncoder returns a TOML encoder that encodes Go values to the io.Writer -// given. By default, a single indentation level is 2 spaces. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - w: bufio.NewWriter(w), - Indent: " ", - } -} - -// Encode writes a TOML representation of the Go value to the underlying -// io.Writer. If the value given cannot be encoded to a valid TOML document, -// then an error is returned. -// -// The mapping between Go values and TOML values should be precisely the same -// as for the Decode* functions. Similarly, the TextMarshaler interface is -// supported by encoding the resulting bytes as strings. (If you want to write -// arbitrary binary data then you will need to use something like base64 since -// TOML does not have any binary types.) -// -// When encoding TOML hashes (i.e., Go maps or structs), keys without any -// sub-hashes are encoded first. -// -// If a Go map is encoded, then its keys are sorted alphabetically for -// deterministic output. More control over this behavior may be provided if -// there is demand for it. -// -// Encoding Go values without a corresponding TOML representation---like map -// types with non-string keys---will cause an error to be returned. Similarly -// for mixed arrays/slices, arrays/slices with nil elements, embedded -// non-struct types and nested slices containing maps or structs. -// (e.g., [][]map[string]string is not allowed but []map[string]string is OK -// and so is []map[string][]string.) -func (enc *Encoder) Encode(v interface{}) error { - rv := eindirect(reflect.ValueOf(v)) - if err := enc.safeEncode(Key([]string{}), rv); err != nil { - return err - } - return enc.w.Flush() -} - -func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) { - defer func() { - if r := recover(); r != nil { - if terr, ok := r.(tomlEncodeError); ok { - err = terr.error - return - } - panic(r) - } - }() - enc.encode(key, rv) - return nil -} - -func (enc *Encoder) encode(key Key, rv reflect.Value) { - // Special case. Time needs to be in ISO8601 format. - // Special case. If we can marshal the type to text, then we used that. - // Basically, this prevents the encoder for handling these types as - // generic structs (or whatever the underlying type of a TextMarshaler is). - switch rv.Interface().(type) { - case time.Time, TextMarshaler: - enc.keyEqElement(key, rv) - return - } - - k := rv.Kind() - switch k { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, - reflect.Uint64, - reflect.Float32, reflect.Float64, reflect.String, reflect.Bool: - enc.keyEqElement(key, rv) - case reflect.Array, reflect.Slice: - if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) { - enc.eArrayOfTables(key, rv) - } else { - enc.keyEqElement(key, rv) - } - case reflect.Interface: - if rv.IsNil() { - return - } - enc.encode(key, rv.Elem()) - case reflect.Map: - if rv.IsNil() { - return - } - enc.eTable(key, rv) - case reflect.Ptr: - if rv.IsNil() { - return - } - enc.encode(key, rv.Elem()) - case reflect.Struct: - enc.eTable(key, rv) - default: - panic(e("unsupported type for key '%s': %s", key, k)) - } -} - -// eElement encodes any value that can be an array element (primitives and -// arrays). -func (enc *Encoder) eElement(rv reflect.Value) { - switch v := rv.Interface().(type) { - case time.Time: - // Special case time.Time as a primitive. Has to come before - // TextMarshaler below because time.Time implements - // encoding.TextMarshaler, but we need to always use UTC. - enc.wf(v.UTC().Format("2006-01-02T15:04:05Z")) - return - case TextMarshaler: - // Special case. Use text marshaler if it's available for this value. - if s, err := v.MarshalText(); err != nil { - encPanic(err) - } else { - enc.writeQuoted(string(s)) - } - return - } - switch rv.Kind() { - case reflect.Bool: - enc.wf(strconv.FormatBool(rv.Bool())) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64: - enc.wf(strconv.FormatInt(rv.Int(), 10)) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64: - enc.wf(strconv.FormatUint(rv.Uint(), 10)) - case reflect.Float32: - enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 32))) - case reflect.Float64: - enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 64))) - case reflect.Array, reflect.Slice: - enc.eArrayOrSliceElement(rv) - case reflect.Interface: - enc.eElement(rv.Elem()) - case reflect.String: - enc.writeQuoted(rv.String()) - default: - panic(e("unexpected primitive type: %s", rv.Kind())) - } -} - -// By the TOML spec, all floats must have a decimal with at least one -// number on either side. -func floatAddDecimal(fstr string) string { - if !strings.Contains(fstr, ".") { - return fstr + ".0" - } - return fstr -} - -func (enc *Encoder) writeQuoted(s string) { - enc.wf("\"%s\"", quotedReplacer.Replace(s)) -} - -func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) { - length := rv.Len() - enc.wf("[") - for i := 0; i < length; i++ { - elem := rv.Index(i) - enc.eElement(elem) - if i != length-1 { - enc.wf(", ") - } - } - enc.wf("]") -} - -func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) { - if len(key) == 0 { - encPanic(errNoKey) - } - for i := 0; i < rv.Len(); i++ { - trv := rv.Index(i) - if isNil(trv) { - continue - } - panicIfInvalidKey(key) - enc.newline() - enc.wf("%s[[%s]]", enc.indentStr(key), key.maybeQuotedAll()) - enc.newline() - enc.eMapOrStruct(key, trv) - } -} - -func (enc *Encoder) eTable(key Key, rv reflect.Value) { - panicIfInvalidKey(key) - if len(key) == 1 { - // Output an extra newline between top-level tables. - // (The newline isn't written if nothing else has been written though.) - enc.newline() - } - if len(key) > 0 { - enc.wf("%s[%s]", enc.indentStr(key), key.maybeQuotedAll()) - enc.newline() - } - enc.eMapOrStruct(key, rv) -} - -func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value) { - switch rv := eindirect(rv); rv.Kind() { - case reflect.Map: - enc.eMap(key, rv) - case reflect.Struct: - enc.eStruct(key, rv) - default: - panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String()) - } -} - -func (enc *Encoder) eMap(key Key, rv reflect.Value) { - rt := rv.Type() - if rt.Key().Kind() != reflect.String { - encPanic(errNonString) - } - - // Sort keys so that we have deterministic output. And write keys directly - // underneath this key first, before writing sub-structs or sub-maps. - var mapKeysDirect, mapKeysSub []string - for _, mapKey := range rv.MapKeys() { - k := mapKey.String() - if typeIsHash(tomlTypeOfGo(rv.MapIndex(mapKey))) { - mapKeysSub = append(mapKeysSub, k) - } else { - mapKeysDirect = append(mapKeysDirect, k) - } - } - - var writeMapKeys = func(mapKeys []string) { - sort.Strings(mapKeys) - for _, mapKey := range mapKeys { - mrv := rv.MapIndex(reflect.ValueOf(mapKey)) - if isNil(mrv) { - // Don't write anything for nil fields. - continue - } - enc.encode(key.add(mapKey), mrv) - } - } - writeMapKeys(mapKeysDirect) - writeMapKeys(mapKeysSub) -} - -func (enc *Encoder) eStruct(key Key, rv reflect.Value) { - // Write keys for fields directly under this key first, because if we write - // a field that creates a new table, then all keys under it will be in that - // table (not the one we're writing here). - rt := rv.Type() - var fieldsDirect, fieldsSub [][]int - var addFields func(rt reflect.Type, rv reflect.Value, start []int) - addFields = func(rt reflect.Type, rv reflect.Value, start []int) { - for i := 0; i < rt.NumField(); i++ { - f := rt.Field(i) - // skip unexported fields - if f.PkgPath != "" && !f.Anonymous { - continue - } - frv := rv.Field(i) - if f.Anonymous { - t := f.Type - switch t.Kind() { - case reflect.Struct: - // Treat anonymous struct fields with - // tag names as though they are not - // anonymous, like encoding/json does. - if getOptions(f.Tag).name == "" { - addFields(t, frv, f.Index) - continue - } - case reflect.Ptr: - if t.Elem().Kind() == reflect.Struct && - getOptions(f.Tag).name == "" { - if !frv.IsNil() { - addFields(t.Elem(), frv.Elem(), f.Index) - } - continue - } - // Fall through to the normal field encoding logic below - // for non-struct anonymous fields. - } - } - - if typeIsHash(tomlTypeOfGo(frv)) { - fieldsSub = append(fieldsSub, append(start, f.Index...)) - } else { - fieldsDirect = append(fieldsDirect, append(start, f.Index...)) - } - } - } - addFields(rt, rv, nil) - - var writeFields = func(fields [][]int) { - for _, fieldIndex := range fields { - sft := rt.FieldByIndex(fieldIndex) - sf := rv.FieldByIndex(fieldIndex) - if isNil(sf) { - // Don't write anything for nil fields. - continue - } - - opts := getOptions(sft.Tag) - if opts.skip { - continue - } - keyName := sft.Name - if opts.name != "" { - keyName = opts.name - } - if opts.omitempty && isEmpty(sf) { - continue - } - if opts.omitzero && isZero(sf) { - continue - } - - enc.encode(key.add(keyName), sf) - } - } - writeFields(fieldsDirect) - writeFields(fieldsSub) -} - -// tomlTypeName returns the TOML type name of the Go value's type. It is -// used to determine whether the types of array elements are mixed (which is -// forbidden). If the Go value is nil, then it is illegal for it to be an array -// element, and valueIsNil is returned as true. - -// Returns the TOML type of a Go value. The type may be `nil`, which means -// no concrete TOML type could be found. -func tomlTypeOfGo(rv reflect.Value) tomlType { - if isNil(rv) || !rv.IsValid() { - return nil - } - switch rv.Kind() { - case reflect.Bool: - return tomlBool - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, - reflect.Uint64: - return tomlInteger - case reflect.Float32, reflect.Float64: - return tomlFloat - case reflect.Array, reflect.Slice: - if typeEqual(tomlHash, tomlArrayType(rv)) { - return tomlArrayHash - } - return tomlArray - case reflect.Ptr, reflect.Interface: - return tomlTypeOfGo(rv.Elem()) - case reflect.String: - return tomlString - case reflect.Map: - return tomlHash - case reflect.Struct: - switch rv.Interface().(type) { - case time.Time: - return tomlDatetime - case TextMarshaler: - return tomlString - default: - return tomlHash - } - default: - panic("unexpected reflect.Kind: " + rv.Kind().String()) - } -} - -// tomlArrayType returns the element type of a TOML array. The type returned -// may be nil if it cannot be determined (e.g., a nil slice or a zero length -// slize). This function may also panic if it finds a type that cannot be -// expressed in TOML (such as nil elements, heterogeneous arrays or directly -// nested arrays of tables). -func tomlArrayType(rv reflect.Value) tomlType { - if isNil(rv) || !rv.IsValid() || rv.Len() == 0 { - return nil - } - firstType := tomlTypeOfGo(rv.Index(0)) - if firstType == nil { - encPanic(errArrayNilElement) - } - - rvlen := rv.Len() - for i := 1; i < rvlen; i++ { - elem := rv.Index(i) - switch elemType := tomlTypeOfGo(elem); { - case elemType == nil: - encPanic(errArrayNilElement) - case !typeEqual(firstType, elemType): - encPanic(errArrayMixedElementTypes) - } - } - // If we have a nested array, then we must make sure that the nested - // array contains ONLY primitives. - // This checks arbitrarily nested arrays. - if typeEqual(firstType, tomlArray) || typeEqual(firstType, tomlArrayHash) { - nest := tomlArrayType(eindirect(rv.Index(0))) - if typeEqual(nest, tomlHash) || typeEqual(nest, tomlArrayHash) { - encPanic(errArrayNoTable) - } - } - return firstType -} - -type tagOptions struct { - skip bool // "-" - name string - omitempty bool - omitzero bool -} - -func getOptions(tag reflect.StructTag) tagOptions { - t := tag.Get("toml") - if t == "-" { - return tagOptions{skip: true} - } - var opts tagOptions - parts := strings.Split(t, ",") - opts.name = parts[0] - for _, s := range parts[1:] { - switch s { - case "omitempty": - opts.omitempty = true - case "omitzero": - opts.omitzero = true - } - } - return opts -} - -func isZero(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return rv.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return rv.Uint() == 0 - case reflect.Float32, reflect.Float64: - return rv.Float() == 0.0 - } - return false -} - -func isEmpty(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Array, reflect.Slice, reflect.Map, reflect.String: - return rv.Len() == 0 - case reflect.Bool: - return !rv.Bool() - } - return false -} - -func (enc *Encoder) newline() { - if enc.hasWritten { - enc.wf("\n") - } -} - -func (enc *Encoder) keyEqElement(key Key, val reflect.Value) { - if len(key) == 0 { - encPanic(errNoKey) - } - panicIfInvalidKey(key) - enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1)) - enc.eElement(val) - enc.newline() -} - -func (enc *Encoder) wf(format string, v ...interface{}) { - if _, err := fmt.Fprintf(enc.w, format, v...); err != nil { - encPanic(err) - } - enc.hasWritten = true -} - -func (enc *Encoder) indentStr(key Key) string { - return strings.Repeat(enc.Indent, len(key)-1) -} - -func encPanic(err error) { - panic(tomlEncodeError{err}) -} - -func eindirect(v reflect.Value) reflect.Value { - switch v.Kind() { - case reflect.Ptr, reflect.Interface: - return eindirect(v.Elem()) - default: - return v - } -} - -func isNil(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - return rv.IsNil() - default: - return false - } -} - -func panicIfInvalidKey(key Key) { - for _, k := range key { - if len(k) == 0 { - encPanic(e("Key '%s' is not a valid table name. Key names "+ - "cannot be empty.", key.maybeQuotedAll())) - } - } -} - -func isValidKeyName(s string) bool { - return len(s) != 0 -} diff --git a/vendor/github.com/BurntSushi/toml/encoding_types.go b/vendor/github.com/BurntSushi/toml/encoding_types.go deleted file mode 100644 index d36e1dd600..0000000000 --- a/vendor/github.com/BurntSushi/toml/encoding_types.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build go1.2 - -package toml - -// In order to support Go 1.1, we define our own TextMarshaler and -// TextUnmarshaler types. For Go 1.2+, we just alias them with the -// standard library interfaces. - -import ( - "encoding" -) - -// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here -// so that Go 1.1 can be supported. -type TextMarshaler encoding.TextMarshaler - -// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined -// here so that Go 1.1 can be supported. -type TextUnmarshaler encoding.TextUnmarshaler diff --git a/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go b/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go deleted file mode 100644 index e8d503d046..0000000000 --- a/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build !go1.2 - -package toml - -// These interfaces were introduced in Go 1.2, so we add them manually when -// compiling for Go 1.1. - -// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here -// so that Go 1.1 can be supported. -type TextMarshaler interface { - MarshalText() (text []byte, err error) -} - -// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined -// here so that Go 1.1 can be supported. -type TextUnmarshaler interface { - UnmarshalText(text []byte) error -} diff --git a/vendor/github.com/BurntSushi/toml/lex.go b/vendor/github.com/BurntSushi/toml/lex.go deleted file mode 100644 index e0a742a887..0000000000 --- a/vendor/github.com/BurntSushi/toml/lex.go +++ /dev/null @@ -1,953 +0,0 @@ -package toml - -import ( - "fmt" - "strings" - "unicode" - "unicode/utf8" -) - -type itemType int - -const ( - itemError itemType = iota - itemNIL // used in the parser to indicate no type - itemEOF - itemText - itemString - itemRawString - itemMultilineString - itemRawMultilineString - itemBool - itemInteger - itemFloat - itemDatetime - itemArray // the start of an array - itemArrayEnd - itemTableStart - itemTableEnd - itemArrayTableStart - itemArrayTableEnd - itemKeyStart - itemCommentStart - itemInlineTableStart - itemInlineTableEnd -) - -const ( - eof = 0 - comma = ',' - tableStart = '[' - tableEnd = ']' - arrayTableStart = '[' - arrayTableEnd = ']' - tableSep = '.' - keySep = '=' - arrayStart = '[' - arrayEnd = ']' - commentStart = '#' - stringStart = '"' - stringEnd = '"' - rawStringStart = '\'' - rawStringEnd = '\'' - inlineTableStart = '{' - inlineTableEnd = '}' -) - -type stateFn func(lx *lexer) stateFn - -type lexer struct { - input string - start int - pos int - line int - state stateFn - items chan item - - // Allow for backing up up to three runes. - // This is necessary because TOML contains 3-rune tokens (""" and '''). - prevWidths [3]int - nprev int // how many of prevWidths are in use - // If we emit an eof, we can still back up, but it is not OK to call - // next again. - atEOF bool - - // A stack of state functions used to maintain context. - // The idea is to reuse parts of the state machine in various places. - // For example, values can appear at the top level or within arbitrarily - // nested arrays. The last state on the stack is used after a value has - // been lexed. Similarly for comments. - stack []stateFn -} - -type item struct { - typ itemType - val string - line int -} - -func (lx *lexer) nextItem() item { - for { - select { - case item := <-lx.items: - return item - default: - lx.state = lx.state(lx) - } - } -} - -func lex(input string) *lexer { - lx := &lexer{ - input: input, - state: lexTop, - line: 1, - items: make(chan item, 10), - stack: make([]stateFn, 0, 10), - } - return lx -} - -func (lx *lexer) push(state stateFn) { - lx.stack = append(lx.stack, state) -} - -func (lx *lexer) pop() stateFn { - if len(lx.stack) == 0 { - return lx.errorf("BUG in lexer: no states to pop") - } - last := lx.stack[len(lx.stack)-1] - lx.stack = lx.stack[0 : len(lx.stack)-1] - return last -} - -func (lx *lexer) current() string { - return lx.input[lx.start:lx.pos] -} - -func (lx *lexer) emit(typ itemType) { - lx.items <- item{typ, lx.current(), lx.line} - lx.start = lx.pos -} - -func (lx *lexer) emitTrim(typ itemType) { - lx.items <- item{typ, strings.TrimSpace(lx.current()), lx.line} - lx.start = lx.pos -} - -func (lx *lexer) next() (r rune) { - if lx.atEOF { - panic("next called after EOF") - } - if lx.pos >= len(lx.input) { - lx.atEOF = true - return eof - } - - if lx.input[lx.pos] == '\n' { - lx.line++ - } - lx.prevWidths[2] = lx.prevWidths[1] - lx.prevWidths[1] = lx.prevWidths[0] - if lx.nprev < 3 { - lx.nprev++ - } - r, w := utf8.DecodeRuneInString(lx.input[lx.pos:]) - lx.prevWidths[0] = w - lx.pos += w - return r -} - -// ignore skips over the pending input before this point. -func (lx *lexer) ignore() { - lx.start = lx.pos -} - -// backup steps back one rune. Can be called only twice between calls to next. -func (lx *lexer) backup() { - if lx.atEOF { - lx.atEOF = false - return - } - if lx.nprev < 1 { - panic("backed up too far") - } - w := lx.prevWidths[0] - lx.prevWidths[0] = lx.prevWidths[1] - lx.prevWidths[1] = lx.prevWidths[2] - lx.nprev-- - lx.pos -= w - if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' { - lx.line-- - } -} - -// accept consumes the next rune if it's equal to `valid`. -func (lx *lexer) accept(valid rune) bool { - if lx.next() == valid { - return true - } - lx.backup() - return false -} - -// peek returns but does not consume the next rune in the input. -func (lx *lexer) peek() rune { - r := lx.next() - lx.backup() - return r -} - -// skip ignores all input that matches the given predicate. -func (lx *lexer) skip(pred func(rune) bool) { - for { - r := lx.next() - if pred(r) { - continue - } - lx.backup() - lx.ignore() - return - } -} - -// errorf stops all lexing by emitting an error and returning `nil`. -// Note that any value that is a character is escaped if it's a special -// character (newlines, tabs, etc.). -func (lx *lexer) errorf(format string, values ...interface{}) stateFn { - lx.items <- item{ - itemError, - fmt.Sprintf(format, values...), - lx.line, - } - return nil -} - -// lexTop consumes elements at the top level of TOML data. -func lexTop(lx *lexer) stateFn { - r := lx.next() - if isWhitespace(r) || isNL(r) { - return lexSkip(lx, lexTop) - } - switch r { - case commentStart: - lx.push(lexTop) - return lexCommentStart - case tableStart: - return lexTableStart - case eof: - if lx.pos > lx.start { - return lx.errorf("unexpected EOF") - } - lx.emit(itemEOF) - return nil - } - - // At this point, the only valid item can be a key, so we back up - // and let the key lexer do the rest. - lx.backup() - lx.push(lexTopEnd) - return lexKeyStart -} - -// lexTopEnd is entered whenever a top-level item has been consumed. (A value -// or a table.) It must see only whitespace, and will turn back to lexTop -// upon a newline. If it sees EOF, it will quit the lexer successfully. -func lexTopEnd(lx *lexer) stateFn { - r := lx.next() - switch { - case r == commentStart: - // a comment will read to a newline for us. - lx.push(lexTop) - return lexCommentStart - case isWhitespace(r): - return lexTopEnd - case isNL(r): - lx.ignore() - return lexTop - case r == eof: - lx.emit(itemEOF) - return nil - } - return lx.errorf("expected a top-level item to end with a newline, "+ - "comment, or EOF, but got %q instead", r) -} - -// lexTable lexes the beginning of a table. Namely, it makes sure that -// it starts with a character other than '.' and ']'. -// It assumes that '[' has already been consumed. -// It also handles the case that this is an item in an array of tables. -// e.g., '[[name]]'. -func lexTableStart(lx *lexer) stateFn { - if lx.peek() == arrayTableStart { - lx.next() - lx.emit(itemArrayTableStart) - lx.push(lexArrayTableEnd) - } else { - lx.emit(itemTableStart) - lx.push(lexTableEnd) - } - return lexTableNameStart -} - -func lexTableEnd(lx *lexer) stateFn { - lx.emit(itemTableEnd) - return lexTopEnd -} - -func lexArrayTableEnd(lx *lexer) stateFn { - if r := lx.next(); r != arrayTableEnd { - return lx.errorf("expected end of table array name delimiter %q, "+ - "but got %q instead", arrayTableEnd, r) - } - lx.emit(itemArrayTableEnd) - return lexTopEnd -} - -func lexTableNameStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == tableEnd || r == eof: - return lx.errorf("unexpected end of table name " + - "(table names cannot be empty)") - case r == tableSep: - return lx.errorf("unexpected table separator " + - "(table names cannot be empty)") - case r == stringStart || r == rawStringStart: - lx.ignore() - lx.push(lexTableNameEnd) - return lexValue // reuse string lexing - default: - return lexBareTableName - } -} - -// lexBareTableName lexes the name of a table. It assumes that at least one -// valid character for the table has already been read. -func lexBareTableName(lx *lexer) stateFn { - r := lx.next() - if isBareKeyChar(r) { - return lexBareTableName - } - lx.backup() - lx.emit(itemText) - return lexTableNameEnd -} - -// lexTableNameEnd reads the end of a piece of a table name, optionally -// consuming whitespace. -func lexTableNameEnd(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.next(); { - case isWhitespace(r): - return lexTableNameEnd - case r == tableSep: - lx.ignore() - return lexTableNameStart - case r == tableEnd: - return lx.pop() - default: - return lx.errorf("expected '.' or ']' to end table name, "+ - "but got %q instead", r) - } -} - -// lexKeyStart consumes a key name up until the first non-whitespace character. -// lexKeyStart will ignore whitespace. -func lexKeyStart(lx *lexer) stateFn { - r := lx.peek() - switch { - case r == keySep: - return lx.errorf("unexpected key separator %q", keySep) - case isWhitespace(r) || isNL(r): - lx.next() - return lexSkip(lx, lexKeyStart) - case r == stringStart || r == rawStringStart: - lx.ignore() - lx.emit(itemKeyStart) - lx.push(lexKeyEnd) - return lexValue // reuse string lexing - default: - lx.ignore() - lx.emit(itemKeyStart) - return lexBareKey - } -} - -// lexBareKey consumes the text of a bare key. Assumes that the first character -// (which is not whitespace) has not yet been consumed. -func lexBareKey(lx *lexer) stateFn { - switch r := lx.next(); { - case isBareKeyChar(r): - return lexBareKey - case isWhitespace(r): - lx.backup() - lx.emit(itemText) - return lexKeyEnd - case r == keySep: - lx.backup() - lx.emit(itemText) - return lexKeyEnd - default: - return lx.errorf("bare keys cannot contain %q", r) - } -} - -// lexKeyEnd consumes the end of a key and trims whitespace (up to the key -// separator). -func lexKeyEnd(lx *lexer) stateFn { - switch r := lx.next(); { - case r == keySep: - return lexSkip(lx, lexValue) - case isWhitespace(r): - return lexSkip(lx, lexKeyEnd) - default: - return lx.errorf("expected key separator %q, but got %q instead", - keySep, r) - } -} - -// lexValue starts the consumption of a value anywhere a value is expected. -// lexValue will ignore whitespace. -// After a value is lexed, the last state on the next is popped and returned. -func lexValue(lx *lexer) stateFn { - // We allow whitespace to precede a value, but NOT newlines. - // In array syntax, the array states are responsible for ignoring newlines. - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexValue) - case isDigit(r): - lx.backup() // avoid an extra state and use the same as above - return lexNumberOrDateStart - } - switch r { - case arrayStart: - lx.ignore() - lx.emit(itemArray) - return lexArrayValue - case inlineTableStart: - lx.ignore() - lx.emit(itemInlineTableStart) - return lexInlineTableValue - case stringStart: - if lx.accept(stringStart) { - if lx.accept(stringStart) { - lx.ignore() // Ignore """ - return lexMultilineString - } - lx.backup() - } - lx.ignore() // ignore the '"' - return lexString - case rawStringStart: - if lx.accept(rawStringStart) { - if lx.accept(rawStringStart) { - lx.ignore() // Ignore """ - return lexMultilineRawString - } - lx.backup() - } - lx.ignore() // ignore the "'" - return lexRawString - case '+', '-': - return lexNumberStart - case '.': // special error case, be kind to users - return lx.errorf("floats must start with a digit, not '.'") - } - if unicode.IsLetter(r) { - // Be permissive here; lexBool will give a nice error if the - // user wrote something like - // x = foo - // (i.e. not 'true' or 'false' but is something else word-like.) - lx.backup() - return lexBool - } - return lx.errorf("expected value but found %q instead", r) -} - -// lexArrayValue consumes one value in an array. It assumes that '[' or ',' -// have already been consumed. All whitespace and newlines are ignored. -func lexArrayValue(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r) || isNL(r): - return lexSkip(lx, lexArrayValue) - case r == commentStart: - lx.push(lexArrayValue) - return lexCommentStart - case r == comma: - return lx.errorf("unexpected comma") - case r == arrayEnd: - // NOTE(caleb): The spec isn't clear about whether you can have - // a trailing comma or not, so we'll allow it. - return lexArrayEnd - } - - lx.backup() - lx.push(lexArrayValueEnd) - return lexValue -} - -// lexArrayValueEnd consumes everything between the end of an array value and -// the next value (or the end of the array): it ignores whitespace and newlines -// and expects either a ',' or a ']'. -func lexArrayValueEnd(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r) || isNL(r): - return lexSkip(lx, lexArrayValueEnd) - case r == commentStart: - lx.push(lexArrayValueEnd) - return lexCommentStart - case r == comma: - lx.ignore() - return lexArrayValue // move on to the next value - case r == arrayEnd: - return lexArrayEnd - } - return lx.errorf( - "expected a comma or array terminator %q, but got %q instead", - arrayEnd, r, - ) -} - -// lexArrayEnd finishes the lexing of an array. -// It assumes that a ']' has just been consumed. -func lexArrayEnd(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemArrayEnd) - return lx.pop() -} - -// lexInlineTableValue consumes one key/value pair in an inline table. -// It assumes that '{' or ',' have already been consumed. Whitespace is ignored. -func lexInlineTableValue(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexInlineTableValue) - case isNL(r): - return lx.errorf("newlines not allowed within inline tables") - case r == commentStart: - lx.push(lexInlineTableValue) - return lexCommentStart - case r == comma: - return lx.errorf("unexpected comma") - case r == inlineTableEnd: - return lexInlineTableEnd - } - lx.backup() - lx.push(lexInlineTableValueEnd) - return lexKeyStart -} - -// lexInlineTableValueEnd consumes everything between the end of an inline table -// key/value pair and the next pair (or the end of the table): -// it ignores whitespace and expects either a ',' or a '}'. -func lexInlineTableValueEnd(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexInlineTableValueEnd) - case isNL(r): - return lx.errorf("newlines not allowed within inline tables") - case r == commentStart: - lx.push(lexInlineTableValueEnd) - return lexCommentStart - case r == comma: - lx.ignore() - return lexInlineTableValue - case r == inlineTableEnd: - return lexInlineTableEnd - } - return lx.errorf("expected a comma or an inline table terminator %q, "+ - "but got %q instead", inlineTableEnd, r) -} - -// lexInlineTableEnd finishes the lexing of an inline table. -// It assumes that a '}' has just been consumed. -func lexInlineTableEnd(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemInlineTableEnd) - return lx.pop() -} - -// lexString consumes the inner contents of a string. It assumes that the -// beginning '"' has already been consumed and ignored. -func lexString(lx *lexer) stateFn { - r := lx.next() - switch { - case r == eof: - return lx.errorf("unexpected EOF") - case isNL(r): - return lx.errorf("strings cannot contain newlines") - case r == '\\': - lx.push(lexString) - return lexStringEscape - case r == stringEnd: - lx.backup() - lx.emit(itemString) - lx.next() - lx.ignore() - return lx.pop() - } - return lexString -} - -// lexMultilineString consumes the inner contents of a string. It assumes that -// the beginning '"""' has already been consumed and ignored. -func lexMultilineString(lx *lexer) stateFn { - switch lx.next() { - case eof: - return lx.errorf("unexpected EOF") - case '\\': - return lexMultilineStringEscape - case stringEnd: - if lx.accept(stringEnd) { - if lx.accept(stringEnd) { - lx.backup() - lx.backup() - lx.backup() - lx.emit(itemMultilineString) - lx.next() - lx.next() - lx.next() - lx.ignore() - return lx.pop() - } - lx.backup() - } - } - return lexMultilineString -} - -// lexRawString consumes a raw string. Nothing can be escaped in such a string. -// It assumes that the beginning "'" has already been consumed and ignored. -func lexRawString(lx *lexer) stateFn { - r := lx.next() - switch { - case r == eof: - return lx.errorf("unexpected EOF") - case isNL(r): - return lx.errorf("strings cannot contain newlines") - case r == rawStringEnd: - lx.backup() - lx.emit(itemRawString) - lx.next() - lx.ignore() - return lx.pop() - } - return lexRawString -} - -// lexMultilineRawString consumes a raw string. Nothing can be escaped in such -// a string. It assumes that the beginning "'''" has already been consumed and -// ignored. -func lexMultilineRawString(lx *lexer) stateFn { - switch lx.next() { - case eof: - return lx.errorf("unexpected EOF") - case rawStringEnd: - if lx.accept(rawStringEnd) { - if lx.accept(rawStringEnd) { - lx.backup() - lx.backup() - lx.backup() - lx.emit(itemRawMultilineString) - lx.next() - lx.next() - lx.next() - lx.ignore() - return lx.pop() - } - lx.backup() - } - } - return lexMultilineRawString -} - -// lexMultilineStringEscape consumes an escaped character. It assumes that the -// preceding '\\' has already been consumed. -func lexMultilineStringEscape(lx *lexer) stateFn { - // Handle the special case first: - if isNL(lx.next()) { - return lexMultilineString - } - lx.backup() - lx.push(lexMultilineString) - return lexStringEscape(lx) -} - -func lexStringEscape(lx *lexer) stateFn { - r := lx.next() - switch r { - case 'b': - fallthrough - case 't': - fallthrough - case 'n': - fallthrough - case 'f': - fallthrough - case 'r': - fallthrough - case '"': - fallthrough - case '\\': - return lx.pop() - case 'u': - return lexShortUnicodeEscape - case 'U': - return lexLongUnicodeEscape - } - return lx.errorf("invalid escape character %q; only the following "+ - "escape characters are allowed: "+ - `\b, \t, \n, \f, \r, \", \\, \uXXXX, and \UXXXXXXXX`, r) -} - -func lexShortUnicodeEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 4; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf(`expected four hexadecimal digits after '\u', `+ - "but got %q instead", lx.current()) - } - } - return lx.pop() -} - -func lexLongUnicodeEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 8; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf(`expected eight hexadecimal digits after '\U', `+ - "but got %q instead", lx.current()) - } - } - return lx.pop() -} - -// lexNumberOrDateStart consumes either an integer, a float, or datetime. -func lexNumberOrDateStart(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexNumberOrDate - } - switch r { - case '_': - return lexNumber - case 'e', 'E': - return lexFloat - case '.': - return lx.errorf("floats must start with a digit, not '.'") - } - return lx.errorf("expected a digit but got %q", r) -} - -// lexNumberOrDate consumes either an integer, float or datetime. -func lexNumberOrDate(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexNumberOrDate - } - switch r { - case '-': - return lexDatetime - case '_': - return lexNumber - case '.', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDatetime consumes a Datetime, to a first approximation. -// The parser validates that it matches one of the accepted formats. -func lexDatetime(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexDatetime - } - switch r { - case '-', 'T', ':', '.', 'Z', '+': - return lexDatetime - } - - lx.backup() - lx.emit(itemDatetime) - return lx.pop() -} - -// lexNumberStart consumes either an integer or a float. It assumes that a sign -// has already been read, but that *no* digits have been consumed. -// lexNumberStart will move to the appropriate integer or float states. -func lexNumberStart(lx *lexer) stateFn { - // We MUST see a digit. Even floats have to start with a digit. - r := lx.next() - if !isDigit(r) { - if r == '.' { - return lx.errorf("floats must start with a digit, not '.'") - } - return lx.errorf("expected a digit but got %q", r) - } - return lexNumber -} - -// lexNumber consumes an integer or a float after seeing the first digit. -func lexNumber(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexNumber - } - switch r { - case '_': - return lexNumber - case '.', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexFloat consumes the elements of a float. It allows any sequence of -// float-like characters, so floats emitted by the lexer are only a first -// approximation and must be validated by the parser. -func lexFloat(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexFloat - } - switch r { - case '_', '.', '-', '+', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemFloat) - return lx.pop() -} - -// lexBool consumes a bool string: 'true' or 'false. -func lexBool(lx *lexer) stateFn { - var rs []rune - for { - r := lx.next() - if !unicode.IsLetter(r) { - lx.backup() - break - } - rs = append(rs, r) - } - s := string(rs) - switch s { - case "true", "false": - lx.emit(itemBool) - return lx.pop() - } - return lx.errorf("expected value but found %q instead", s) -} - -// lexCommentStart begins the lexing of a comment. It will emit -// itemCommentStart and consume no characters, passing control to lexComment. -func lexCommentStart(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemCommentStart) - return lexComment -} - -// lexComment lexes an entire comment. It assumes that '#' has been consumed. -// It will consume *up to* the first newline character, and pass control -// back to the last state on the stack. -func lexComment(lx *lexer) stateFn { - r := lx.peek() - if isNL(r) || r == eof { - lx.emit(itemText) - return lx.pop() - } - lx.next() - return lexComment -} - -// lexSkip ignores all slurped input and moves on to the next state. -func lexSkip(lx *lexer, nextState stateFn) stateFn { - return func(lx *lexer) stateFn { - lx.ignore() - return nextState - } -} - -// isWhitespace returns true if `r` is a whitespace character according -// to the spec. -func isWhitespace(r rune) bool { - return r == '\t' || r == ' ' -} - -func isNL(r rune) bool { - return r == '\n' || r == '\r' -} - -func isDigit(r rune) bool { - return r >= '0' && r <= '9' -} - -func isHexadecimal(r rune) bool { - return (r >= '0' && r <= '9') || - (r >= 'a' && r <= 'f') || - (r >= 'A' && r <= 'F') -} - -func isBareKeyChar(r rune) bool { - return (r >= 'A' && r <= 'Z') || - (r >= 'a' && r <= 'z') || - (r >= '0' && r <= '9') || - r == '_' || - r == '-' -} - -func (itype itemType) String() string { - switch itype { - case itemError: - return "Error" - case itemNIL: - return "NIL" - case itemEOF: - return "EOF" - case itemText: - return "Text" - case itemString, itemRawString, itemMultilineString, itemRawMultilineString: - return "String" - case itemBool: - return "Bool" - case itemInteger: - return "Integer" - case itemFloat: - return "Float" - case itemDatetime: - return "DateTime" - case itemTableStart: - return "TableStart" - case itemTableEnd: - return "TableEnd" - case itemKeyStart: - return "KeyStart" - case itemArray: - return "Array" - case itemArrayEnd: - return "ArrayEnd" - case itemCommentStart: - return "CommentStart" - } - panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype))) -} - -func (item item) String() string { - return fmt.Sprintf("(%s, %s)", item.typ.String(), item.val) -} diff --git a/vendor/github.com/BurntSushi/toml/parse.go b/vendor/github.com/BurntSushi/toml/parse.go deleted file mode 100644 index 50869ef926..0000000000 --- a/vendor/github.com/BurntSushi/toml/parse.go +++ /dev/null @@ -1,592 +0,0 @@ -package toml - -import ( - "fmt" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -type parser struct { - mapping map[string]interface{} - types map[string]tomlType - lx *lexer - - // A list of keys in the order that they appear in the TOML data. - ordered []Key - - // the full key for the current hash in scope - context Key - - // the base key name for everything except hashes - currentKey string - - // rough approximation of line number - approxLine int - - // A map of 'key.group.names' to whether they were created implicitly. - implicits map[string]bool -} - -type parseError string - -func (pe parseError) Error() string { - return string(pe) -} - -func parse(data string) (p *parser, err error) { - defer func() { - if r := recover(); r != nil { - var ok bool - if err, ok = r.(parseError); ok { - return - } - panic(r) - } - }() - - p = &parser{ - mapping: make(map[string]interface{}), - types: make(map[string]tomlType), - lx: lex(data), - ordered: make([]Key, 0), - implicits: make(map[string]bool), - } - for { - item := p.next() - if item.typ == itemEOF { - break - } - p.topLevel(item) - } - - return p, nil -} - -func (p *parser) panicf(format string, v ...interface{}) { - msg := fmt.Sprintf("Near line %d (last key parsed '%s'): %s", - p.approxLine, p.current(), fmt.Sprintf(format, v...)) - panic(parseError(msg)) -} - -func (p *parser) next() item { - it := p.lx.nextItem() - if it.typ == itemError { - p.panicf("%s", it.val) - } - return it -} - -func (p *parser) bug(format string, v ...interface{}) { - panic(fmt.Sprintf("BUG: "+format+"\n\n", v...)) -} - -func (p *parser) expect(typ itemType) item { - it := p.next() - p.assertEqual(typ, it.typ) - return it -} - -func (p *parser) assertEqual(expected, got itemType) { - if expected != got { - p.bug("Expected '%s' but got '%s'.", expected, got) - } -} - -func (p *parser) topLevel(item item) { - switch item.typ { - case itemCommentStart: - p.approxLine = item.line - p.expect(itemText) - case itemTableStart: - kg := p.next() - p.approxLine = kg.line - - var key Key - for ; kg.typ != itemTableEnd && kg.typ != itemEOF; kg = p.next() { - key = append(key, p.keyString(kg)) - } - p.assertEqual(itemTableEnd, kg.typ) - - p.establishContext(key, false) - p.setType("", tomlHash) - p.ordered = append(p.ordered, key) - case itemArrayTableStart: - kg := p.next() - p.approxLine = kg.line - - var key Key - for ; kg.typ != itemArrayTableEnd && kg.typ != itemEOF; kg = p.next() { - key = append(key, p.keyString(kg)) - } - p.assertEqual(itemArrayTableEnd, kg.typ) - - p.establishContext(key, true) - p.setType("", tomlArrayHash) - p.ordered = append(p.ordered, key) - case itemKeyStart: - kname := p.next() - p.approxLine = kname.line - p.currentKey = p.keyString(kname) - - val, typ := p.value(p.next()) - p.setValue(p.currentKey, val) - p.setType(p.currentKey, typ) - p.ordered = append(p.ordered, p.context.add(p.currentKey)) - p.currentKey = "" - default: - p.bug("Unexpected type at top level: %s", item.typ) - } -} - -// Gets a string for a key (or part of a key in a table name). -func (p *parser) keyString(it item) string { - switch it.typ { - case itemText: - return it.val - case itemString, itemMultilineString, - itemRawString, itemRawMultilineString: - s, _ := p.value(it) - return s.(string) - default: - p.bug("Unexpected key type: %s", it.typ) - panic("unreachable") - } -} - -// value translates an expected value from the lexer into a Go value wrapped -// as an empty interface. -func (p *parser) value(it item) (interface{}, tomlType) { - switch it.typ { - case itemString: - return p.replaceEscapes(it.val), p.typeOfPrimitive(it) - case itemMultilineString: - trimmed := stripFirstNewline(stripEscapedWhitespace(it.val)) - return p.replaceEscapes(trimmed), p.typeOfPrimitive(it) - case itemRawString: - return it.val, p.typeOfPrimitive(it) - case itemRawMultilineString: - return stripFirstNewline(it.val), p.typeOfPrimitive(it) - case itemBool: - switch it.val { - case "true": - return true, p.typeOfPrimitive(it) - case "false": - return false, p.typeOfPrimitive(it) - } - p.bug("Expected boolean value, but got '%s'.", it.val) - case itemInteger: - if !numUnderscoresOK(it.val) { - p.panicf("Invalid integer %q: underscores must be surrounded by digits", - it.val) - } - val := strings.Replace(it.val, "_", "", -1) - num, err := strconv.ParseInt(val, 10, 64) - if err != nil { - // Distinguish integer values. Normally, it'd be a bug if the lexer - // provides an invalid integer, but it's possible that the number is - // out of range of valid values (which the lexer cannot determine). - // So mark the former as a bug but the latter as a legitimate user - // error. - if e, ok := err.(*strconv.NumError); ok && - e.Err == strconv.ErrRange { - - p.panicf("Integer '%s' is out of the range of 64-bit "+ - "signed integers.", it.val) - } else { - p.bug("Expected integer value, but got '%s'.", it.val) - } - } - return num, p.typeOfPrimitive(it) - case itemFloat: - parts := strings.FieldsFunc(it.val, func(r rune) bool { - switch r { - case '.', 'e', 'E': - return true - } - return false - }) - for _, part := range parts { - if !numUnderscoresOK(part) { - p.panicf("Invalid float %q: underscores must be "+ - "surrounded by digits", it.val) - } - } - if !numPeriodsOK(it.val) { - // As a special case, numbers like '123.' or '1.e2', - // which are valid as far as Go/strconv are concerned, - // must be rejected because TOML says that a fractional - // part consists of '.' followed by 1+ digits. - p.panicf("Invalid float %q: '.' must be followed "+ - "by one or more digits", it.val) - } - val := strings.Replace(it.val, "_", "", -1) - num, err := strconv.ParseFloat(val, 64) - if err != nil { - if e, ok := err.(*strconv.NumError); ok && - e.Err == strconv.ErrRange { - - p.panicf("Float '%s' is out of the range of 64-bit "+ - "IEEE-754 floating-point numbers.", it.val) - } else { - p.panicf("Invalid float value: %q", it.val) - } - } - return num, p.typeOfPrimitive(it) - case itemDatetime: - var t time.Time - var ok bool - var err error - for _, format := range []string{ - "2006-01-02T15:04:05Z07:00", - "2006-01-02T15:04:05", - "2006-01-02", - } { - t, err = time.ParseInLocation(format, it.val, time.Local) - if err == nil { - ok = true - break - } - } - if !ok { - p.panicf("Invalid TOML Datetime: %q.", it.val) - } - return t, p.typeOfPrimitive(it) - case itemArray: - array := make([]interface{}, 0) - types := make([]tomlType, 0) - - for it = p.next(); it.typ != itemArrayEnd; it = p.next() { - if it.typ == itemCommentStart { - p.expect(itemText) - continue - } - - val, typ := p.value(it) - array = append(array, val) - types = append(types, typ) - } - return array, p.typeOfArray(types) - case itemInlineTableStart: - var ( - hash = make(map[string]interface{}) - outerContext = p.context - outerKey = p.currentKey - ) - - p.context = append(p.context, p.currentKey) - p.currentKey = "" - for it := p.next(); it.typ != itemInlineTableEnd; it = p.next() { - if it.typ != itemKeyStart { - p.bug("Expected key start but instead found %q, around line %d", - it.val, p.approxLine) - } - if it.typ == itemCommentStart { - p.expect(itemText) - continue - } - - // retrieve key - k := p.next() - p.approxLine = k.line - kname := p.keyString(k) - - // retrieve value - p.currentKey = kname - val, typ := p.value(p.next()) - // make sure we keep metadata up to date - p.setType(kname, typ) - p.ordered = append(p.ordered, p.context.add(p.currentKey)) - hash[kname] = val - } - p.context = outerContext - p.currentKey = outerKey - return hash, tomlHash - } - p.bug("Unexpected value type: %s", it.typ) - panic("unreachable") -} - -// numUnderscoresOK checks whether each underscore in s is surrounded by -// characters that are not underscores. -func numUnderscoresOK(s string) bool { - accept := false - for _, r := range s { - if r == '_' { - if !accept { - return false - } - accept = false - continue - } - accept = true - } - return accept -} - -// numPeriodsOK checks whether every period in s is followed by a digit. -func numPeriodsOK(s string) bool { - period := false - for _, r := range s { - if period && !isDigit(r) { - return false - } - period = r == '.' - } - return !period -} - -// establishContext sets the current context of the parser, -// where the context is either a hash or an array of hashes. Which one is -// set depends on the value of the `array` parameter. -// -// Establishing the context also makes sure that the key isn't a duplicate, and -// will create implicit hashes automatically. -func (p *parser) establishContext(key Key, array bool) { - var ok bool - - // Always start at the top level and drill down for our context. - hashContext := p.mapping - keyContext := make(Key, 0) - - // We only need implicit hashes for key[0:-1] - for _, k := range key[0 : len(key)-1] { - _, ok = hashContext[k] - keyContext = append(keyContext, k) - - // No key? Make an implicit hash and move on. - if !ok { - p.addImplicit(keyContext) - hashContext[k] = make(map[string]interface{}) - } - - // If the hash context is actually an array of tables, then set - // the hash context to the last element in that array. - // - // Otherwise, it better be a table, since this MUST be a key group (by - // virtue of it not being the last element in a key). - switch t := hashContext[k].(type) { - case []map[string]interface{}: - hashContext = t[len(t)-1] - case map[string]interface{}: - hashContext = t - default: - p.panicf("Key '%s' was already created as a hash.", keyContext) - } - } - - p.context = keyContext - if array { - // If this is the first element for this array, then allocate a new - // list of tables for it. - k := key[len(key)-1] - if _, ok := hashContext[k]; !ok { - hashContext[k] = make([]map[string]interface{}, 0, 5) - } - - // Add a new table. But make sure the key hasn't already been used - // for something else. - if hash, ok := hashContext[k].([]map[string]interface{}); ok { - hashContext[k] = append(hash, make(map[string]interface{})) - } else { - p.panicf("Key '%s' was already created and cannot be used as "+ - "an array.", keyContext) - } - } else { - p.setValue(key[len(key)-1], make(map[string]interface{})) - } - p.context = append(p.context, key[len(key)-1]) -} - -// setValue sets the given key to the given value in the current context. -// It will make sure that the key hasn't already been defined, account for -// implicit key groups. -func (p *parser) setValue(key string, value interface{}) { - var tmpHash interface{} - var ok bool - - hash := p.mapping - keyContext := make(Key, 0) - for _, k := range p.context { - keyContext = append(keyContext, k) - if tmpHash, ok = hash[k]; !ok { - p.bug("Context for key '%s' has not been established.", keyContext) - } - switch t := tmpHash.(type) { - case []map[string]interface{}: - // The context is a table of hashes. Pick the most recent table - // defined as the current hash. - hash = t[len(t)-1] - case map[string]interface{}: - hash = t - default: - p.bug("Expected hash to have type 'map[string]interface{}', but "+ - "it has '%T' instead.", tmpHash) - } - } - keyContext = append(keyContext, key) - - if _, ok := hash[key]; ok { - // Typically, if the given key has already been set, then we have - // to raise an error since duplicate keys are disallowed. However, - // it's possible that a key was previously defined implicitly. In this - // case, it is allowed to be redefined concretely. (See the - // `tests/valid/implicit-and-explicit-after.toml` test in `toml-test`.) - // - // But we have to make sure to stop marking it as an implicit. (So that - // another redefinition provokes an error.) - // - // Note that since it has already been defined (as a hash), we don't - // want to overwrite it. So our business is done. - if p.isImplicit(keyContext) { - p.removeImplicit(keyContext) - return - } - - // Otherwise, we have a concrete key trying to override a previous - // key, which is *always* wrong. - p.panicf("Key '%s' has already been defined.", keyContext) - } - hash[key] = value -} - -// setType sets the type of a particular value at a given key. -// It should be called immediately AFTER setValue. -// -// Note that if `key` is empty, then the type given will be applied to the -// current context (which is either a table or an array of tables). -func (p *parser) setType(key string, typ tomlType) { - keyContext := make(Key, 0, len(p.context)+1) - for _, k := range p.context { - keyContext = append(keyContext, k) - } - if len(key) > 0 { // allow type setting for hashes - keyContext = append(keyContext, key) - } - p.types[keyContext.String()] = typ -} - -// addImplicit sets the given Key as having been created implicitly. -func (p *parser) addImplicit(key Key) { - p.implicits[key.String()] = true -} - -// removeImplicit stops tagging the given key as having been implicitly -// created. -func (p *parser) removeImplicit(key Key) { - p.implicits[key.String()] = false -} - -// isImplicit returns true if the key group pointed to by the key was created -// implicitly. -func (p *parser) isImplicit(key Key) bool { - return p.implicits[key.String()] -} - -// current returns the full key name of the current context. -func (p *parser) current() string { - if len(p.currentKey) == 0 { - return p.context.String() - } - if len(p.context) == 0 { - return p.currentKey - } - return fmt.Sprintf("%s.%s", p.context, p.currentKey) -} - -func stripFirstNewline(s string) string { - if len(s) == 0 || s[0] != '\n' { - return s - } - return s[1:] -} - -func stripEscapedWhitespace(s string) string { - esc := strings.Split(s, "\\\n") - if len(esc) > 1 { - for i := 1; i < len(esc); i++ { - esc[i] = strings.TrimLeftFunc(esc[i], unicode.IsSpace) - } - } - return strings.Join(esc, "") -} - -func (p *parser) replaceEscapes(str string) string { - var replaced []rune - s := []byte(str) - r := 0 - for r < len(s) { - if s[r] != '\\' { - c, size := utf8.DecodeRune(s[r:]) - r += size - replaced = append(replaced, c) - continue - } - r += 1 - if r >= len(s) { - p.bug("Escape sequence at end of string.") - return "" - } - switch s[r] { - default: - p.bug("Expected valid escape code after \\, but got %q.", s[r]) - return "" - case 'b': - replaced = append(replaced, rune(0x0008)) - r += 1 - case 't': - replaced = append(replaced, rune(0x0009)) - r += 1 - case 'n': - replaced = append(replaced, rune(0x000A)) - r += 1 - case 'f': - replaced = append(replaced, rune(0x000C)) - r += 1 - case 'r': - replaced = append(replaced, rune(0x000D)) - r += 1 - case '"': - replaced = append(replaced, rune(0x0022)) - r += 1 - case '\\': - replaced = append(replaced, rune(0x005C)) - r += 1 - case 'u': - // At this point, we know we have a Unicode escape of the form - // `uXXXX` at [r, r+5). (Because the lexer guarantees this - // for us.) - escaped := p.asciiEscapeToUnicode(s[r+1 : r+5]) - replaced = append(replaced, escaped) - r += 5 - case 'U': - // At this point, we know we have a Unicode escape of the form - // `uXXXX` at [r, r+9). (Because the lexer guarantees this - // for us.) - escaped := p.asciiEscapeToUnicode(s[r+1 : r+9]) - replaced = append(replaced, escaped) - r += 9 - } - } - return string(replaced) -} - -func (p *parser) asciiEscapeToUnicode(bs []byte) rune { - s := string(bs) - hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32) - if err != nil { - p.bug("Could not parse '%s' as a hexadecimal number, but the "+ - "lexer claims it's OK: %s", s, err) - } - if !utf8.ValidRune(rune(hex)) { - p.panicf("Escaped character '\\u%s' is not valid UTF-8.", s) - } - return rune(hex) -} - -func isStringType(ty itemType) bool { - return ty == itemString || ty == itemMultilineString || - ty == itemRawString || ty == itemRawMultilineString -} diff --git a/vendor/github.com/BurntSushi/toml/session.vim b/vendor/github.com/BurntSushi/toml/session.vim deleted file mode 100644 index 562164be06..0000000000 --- a/vendor/github.com/BurntSushi/toml/session.vim +++ /dev/null @@ -1 +0,0 @@ -au BufWritePost *.go silent!make tags > /dev/null 2>&1 diff --git a/vendor/github.com/BurntSushi/toml/type_check.go b/vendor/github.com/BurntSushi/toml/type_check.go deleted file mode 100644 index c73f8afc1a..0000000000 --- a/vendor/github.com/BurntSushi/toml/type_check.go +++ /dev/null @@ -1,91 +0,0 @@ -package toml - -// tomlType represents any Go type that corresponds to a TOML type. -// While the first draft of the TOML spec has a simplistic type system that -// probably doesn't need this level of sophistication, we seem to be militating -// toward adding real composite types. -type tomlType interface { - typeString() string -} - -// typeEqual accepts any two types and returns true if they are equal. -func typeEqual(t1, t2 tomlType) bool { - if t1 == nil || t2 == nil { - return false - } - return t1.typeString() == t2.typeString() -} - -func typeIsHash(t tomlType) bool { - return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash) -} - -type tomlBaseType string - -func (btype tomlBaseType) typeString() string { - return string(btype) -} - -func (btype tomlBaseType) String() string { - return btype.typeString() -} - -var ( - tomlInteger tomlBaseType = "Integer" - tomlFloat tomlBaseType = "Float" - tomlDatetime tomlBaseType = "Datetime" - tomlString tomlBaseType = "String" - tomlBool tomlBaseType = "Bool" - tomlArray tomlBaseType = "Array" - tomlHash tomlBaseType = "Hash" - tomlArrayHash tomlBaseType = "ArrayHash" -) - -// typeOfPrimitive returns a tomlType of any primitive value in TOML. -// Primitive values are: Integer, Float, Datetime, String and Bool. -// -// Passing a lexer item other than the following will cause a BUG message -// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime. -func (p *parser) typeOfPrimitive(lexItem item) tomlType { - switch lexItem.typ { - case itemInteger: - return tomlInteger - case itemFloat: - return tomlFloat - case itemDatetime: - return tomlDatetime - case itemString: - return tomlString - case itemMultilineString: - return tomlString - case itemRawString: - return tomlString - case itemRawMultilineString: - return tomlString - case itemBool: - return tomlBool - } - p.bug("Cannot infer primitive type of lex item '%s'.", lexItem) - panic("unreachable") -} - -// typeOfArray returns a tomlType for an array given a list of types of its -// values. -// -// In the current spec, if an array is homogeneous, then its type is always -// "Array". If the array is not homogeneous, an error is generated. -func (p *parser) typeOfArray(types []tomlType) tomlType { - // Empty arrays are cool. - if len(types) == 0 { - return tomlArray - } - - theType := types[0] - for _, t := range types[1:] { - if !typeEqual(theType, t) { - p.panicf("Array contains values of type '%s' and '%s', but "+ - "arrays must be homogeneous.", theType, t) - } - } - return tomlArray -} diff --git a/vendor/github.com/BurntSushi/toml/type_fields.go b/vendor/github.com/BurntSushi/toml/type_fields.go deleted file mode 100644 index 608997c22f..0000000000 --- a/vendor/github.com/BurntSushi/toml/type_fields.go +++ /dev/null @@ -1,242 +0,0 @@ -package toml - -// Struct field handling is adapted from code in encoding/json: -// -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the Go distribution. - -import ( - "reflect" - "sort" - "sync" -) - -// A field represents a single field found in a struct. -type field struct { - name string // the name of the field (`toml` tag included) - tag bool // whether field has a `toml` tag - index []int // represents the depth of an anonymous field - typ reflect.Type // the type of the field -} - -// byName sorts field by name, breaking ties with depth, -// then breaking ties with "name came from toml tag", then -// breaking ties with index sequence. -type byName []field - -func (x byName) Len() int { return len(x) } - -func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byName) Less(i, j int) bool { - if x[i].name != x[j].name { - return x[i].name < x[j].name - } - if len(x[i].index) != len(x[j].index) { - return len(x[i].index) < len(x[j].index) - } - if x[i].tag != x[j].tag { - return x[i].tag - } - return byIndex(x).Less(i, j) -} - -// byIndex sorts field by index sequence. -type byIndex []field - -func (x byIndex) Len() int { return len(x) } - -func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byIndex) Less(i, j int) bool { - for k, xik := range x[i].index { - if k >= len(x[j].index) { - return false - } - if xik != x[j].index[k] { - return xik < x[j].index[k] - } - } - return len(x[i].index) < len(x[j].index) -} - -// typeFields returns a list of fields that TOML should recognize for the given -// type. The algorithm is breadth-first search over the set of structs to -// include - the top struct and then any reachable anonymous structs. -func typeFields(t reflect.Type) []field { - // Anonymous fields to explore at the current level and the next. - current := []field{} - next := []field{{typ: t}} - - // Count of queued names for current level and the next. - count := map[reflect.Type]int{} - nextCount := map[reflect.Type]int{} - - // Types already visited at an earlier level. - visited := map[reflect.Type]bool{} - - // Fields found. - var fields []field - - for len(next) > 0 { - current, next = next, current[:0] - count, nextCount = nextCount, map[reflect.Type]int{} - - for _, f := range current { - if visited[f.typ] { - continue - } - visited[f.typ] = true - - // Scan f.typ for fields to include. - for i := 0; i < f.typ.NumField(); i++ { - sf := f.typ.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { // unexported - continue - } - opts := getOptions(sf.Tag) - if opts.skip { - continue - } - index := make([]int, len(f.index)+1) - copy(index, f.index) - index[len(f.index)] = i - - ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { - // Follow pointer. - ft = ft.Elem() - } - - // Record found field and index sequence. - if opts.name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { - tagged := opts.name != "" - name := opts.name - if name == "" { - name = sf.Name - } - fields = append(fields, field{name, tagged, index, ft}) - if count[f.typ] > 1 { - // If there were multiple instances, add a second, - // so that the annihilation code will see a duplicate. - // It only cares about the distinction between 1 or 2, - // so don't bother generating any more copies. - fields = append(fields, fields[len(fields)-1]) - } - continue - } - - // Record new anonymous struct to explore in next round. - nextCount[ft]++ - if nextCount[ft] == 1 { - f := field{name: ft.Name(), index: index, typ: ft} - next = append(next, f) - } - } - } - } - - sort.Sort(byName(fields)) - - // Delete all fields that are hidden by the Go rules for embedded fields, - // except that fields with TOML tags are promoted. - - // The fields are sorted in primary order of name, secondary order - // of field index length. Loop over names; for each name, delete - // hidden fields by choosing the one dominant field that survives. - out := fields[:0] - for advance, i := 0, 0; i < len(fields); i += advance { - // One iteration per name. - // Find the sequence of fields with the name of this first field. - fi := fields[i] - name := fi.name - for advance = 1; i+advance < len(fields); advance++ { - fj := fields[i+advance] - if fj.name != name { - break - } - } - if advance == 1 { // Only one field with this name - out = append(out, fi) - continue - } - dominant, ok := dominantField(fields[i : i+advance]) - if ok { - out = append(out, dominant) - } - } - - fields = out - sort.Sort(byIndex(fields)) - - return fields -} - -// dominantField looks through the fields, all of which are known to -// have the same name, to find the single field that dominates the -// others using Go's embedding rules, modified by the presence of -// TOML tags. If there are multiple top-level fields, the boolean -// will be false: This condition is an error in Go and we skip all -// the fields. -func dominantField(fields []field) (field, bool) { - // The fields are sorted in increasing index-length order. The winner - // must therefore be one with the shortest index length. Drop all - // longer entries, which is easy: just truncate the slice. - length := len(fields[0].index) - tagged := -1 // Index of first tagged field. - for i, f := range fields { - if len(f.index) > length { - fields = fields[:i] - break - } - if f.tag { - if tagged >= 0 { - // Multiple tagged fields at the same level: conflict. - // Return no field. - return field{}, false - } - tagged = i - } - } - if tagged >= 0 { - return fields[tagged], true - } - // All remaining fields have the same length. If there's more than one, - // we have a conflict (two fields named "X" at the same level) and we - // return no field. - if len(fields) > 1 { - return field{}, false - } - return fields[0], true -} - -var fieldCache struct { - sync.RWMutex - m map[reflect.Type][]field -} - -// cachedTypeFields is like typeFields but uses a cache to avoid repeated work. -func cachedTypeFields(t reflect.Type) []field { - fieldCache.RLock() - f := fieldCache.m[t] - fieldCache.RUnlock() - if f != nil { - return f - } - - // Compute fields without lock. - // Might duplicate effort but won't hold other computations back. - f = typeFields(t) - if f == nil { - f = []field{} - } - - fieldCache.Lock() - if fieldCache.m == nil { - fieldCache.m = map[reflect.Type][]field{} - } - fieldCache.m[t] = f - fieldCache.Unlock() - return f -} diff --git a/vendor/github.com/cenkalti/backoff/v3/.travis.yml b/vendor/github.com/cenkalti/backoff/v3/.travis.yml deleted file mode 100644 index 47a6a46ec2..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: - - 1.7 - - 1.x - - tip -before_install: - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover -script: - - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/cenkalti/backoff/v3/LICENSE b/vendor/github.com/cenkalti/backoff/v3/LICENSE deleted file mode 100644 index 89b8179965..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Cenk Altı - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/cenkalti/backoff/v3/README.md b/vendor/github.com/cenkalti/backoff/v3/README.md deleted file mode 100644 index 55ebc98fc2..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls] - -This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client]. - -[Exponential backoff][exponential backoff wiki] -is an algorithm that uses feedback to multiplicatively decrease the rate of some process, -in order to gradually find an acceptable rate. -The retries exponentially increase and stop increasing when a certain threshold is met. - -## Usage - -See https://godoc.org/github.com/cenkalti/backoff#pkg-examples - -## Contributing - -* I would like to keep this library as small as possible. -* Please don't send a PR without opening an issue and discussing it first. -* If proposed change is not a common use case, I will probably not accept it. - -[godoc]: https://godoc.org/github.com/cenkalti/backoff -[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png -[travis]: https://travis-ci.org/cenkalti/backoff -[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master -[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master -[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master - -[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java -[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff - -[advanced example]: https://godoc.org/github.com/cenkalti/backoff#example_ diff --git a/vendor/github.com/cenkalti/backoff/v3/backoff.go b/vendor/github.com/cenkalti/backoff/v3/backoff.go deleted file mode 100644 index 3676ee405d..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/backoff.go +++ /dev/null @@ -1,66 +0,0 @@ -// Package backoff implements backoff algorithms for retrying operations. -// -// Use Retry function for retrying operations that may fail. -// If Retry does not meet your needs, -// copy/paste the function into your project and modify as you wish. -// -// There is also Ticker type similar to time.Ticker. -// You can use it if you need to work with channels. -// -// See Examples section below for usage examples. -package backoff - -import "time" - -// BackOff is a backoff policy for retrying an operation. -type BackOff interface { - // NextBackOff returns the duration to wait before retrying the operation, - // or backoff. Stop to indicate that no more retries should be made. - // - // Example usage: - // - // duration := backoff.NextBackOff(); - // if (duration == backoff.Stop) { - // // Do not retry operation. - // } else { - // // Sleep for duration and retry operation. - // } - // - NextBackOff() time.Duration - - // Reset to initial state. - Reset() -} - -// Stop indicates that no more retries should be made for use in NextBackOff(). -const Stop time.Duration = -1 - -// ZeroBackOff is a fixed backoff policy whose backoff time is always zero, -// meaning that the operation is retried immediately without waiting, indefinitely. -type ZeroBackOff struct{} - -func (b *ZeroBackOff) Reset() {} - -func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 } - -// StopBackOff is a fixed backoff policy that always returns backoff.Stop for -// NextBackOff(), meaning that the operation should never be retried. -type StopBackOff struct{} - -func (b *StopBackOff) Reset() {} - -func (b *StopBackOff) NextBackOff() time.Duration { return Stop } - -// ConstantBackOff is a backoff policy that always returns the same backoff delay. -// This is in contrast to an exponential backoff policy, -// which returns a delay that grows longer as you call NextBackOff() over and over again. -type ConstantBackOff struct { - Interval time.Duration -} - -func (b *ConstantBackOff) Reset() {} -func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval } - -func NewConstantBackOff(d time.Duration) *ConstantBackOff { - return &ConstantBackOff{Interval: d} -} diff --git a/vendor/github.com/cenkalti/backoff/v3/context.go b/vendor/github.com/cenkalti/backoff/v3/context.go deleted file mode 100644 index 7706faa2b6..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/context.go +++ /dev/null @@ -1,63 +0,0 @@ -package backoff - -import ( - "context" - "time" -) - -// BackOffContext is a backoff policy that stops retrying after the context -// is canceled. -type BackOffContext interface { - BackOff - Context() context.Context -} - -type backOffContext struct { - BackOff - ctx context.Context -} - -// WithContext returns a BackOffContext with context ctx -// -// ctx must not be nil -func WithContext(b BackOff, ctx context.Context) BackOffContext { - if ctx == nil { - panic("nil context") - } - - if b, ok := b.(*backOffContext); ok { - return &backOffContext{ - BackOff: b.BackOff, - ctx: ctx, - } - } - - return &backOffContext{ - BackOff: b, - ctx: ctx, - } -} - -func ensureContext(b BackOff) BackOffContext { - if cb, ok := b.(BackOffContext); ok { - return cb - } - return WithContext(b, context.Background()) -} - -func (b *backOffContext) Context() context.Context { - return b.ctx -} - -func (b *backOffContext) NextBackOff() time.Duration { - select { - case <-b.ctx.Done(): - return Stop - default: - } - next := b.BackOff.NextBackOff() - if deadline, ok := b.ctx.Deadline(); ok && deadline.Sub(time.Now()) < next { - return Stop - } - return next -} diff --git a/vendor/github.com/cenkalti/backoff/v3/exponential.go b/vendor/github.com/cenkalti/backoff/v3/exponential.go deleted file mode 100644 index a031a65979..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/exponential.go +++ /dev/null @@ -1,153 +0,0 @@ -package backoff - -import ( - "math/rand" - "time" -) - -/* -ExponentialBackOff is a backoff implementation that increases the backoff -period for each retry attempt using a randomization function that grows exponentially. - -NextBackOff() is calculated using the following formula: - - randomized interval = - RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor]) - -In other words NextBackOff() will range between the randomization factor -percentage below and above the retry interval. - -For example, given the following parameters: - - RetryInterval = 2 - RandomizationFactor = 0.5 - Multiplier = 2 - -the actual backoff period used in the next retry attempt will range between 1 and 3 seconds, -multiplied by the exponential, that is, between 2 and 6 seconds. - -Note: MaxInterval caps the RetryInterval and not the randomized interval. - -If the time elapsed since an ExponentialBackOff instance is created goes past the -MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop. - -The elapsed time can be reset by calling Reset(). - -Example: Given the following default arguments, for 10 tries the sequence will be, -and assuming we go over the MaxElapsedTime on the 10th try: - - Request # RetryInterval (seconds) Randomized Interval (seconds) - - 1 0.5 [0.25, 0.75] - 2 0.75 [0.375, 1.125] - 3 1.125 [0.562, 1.687] - 4 1.687 [0.8435, 2.53] - 5 2.53 [1.265, 3.795] - 6 3.795 [1.897, 5.692] - 7 5.692 [2.846, 8.538] - 8 8.538 [4.269, 12.807] - 9 12.807 [6.403, 19.210] - 10 19.210 backoff.Stop - -Note: Implementation is not thread-safe. -*/ -type ExponentialBackOff struct { - InitialInterval time.Duration - RandomizationFactor float64 - Multiplier float64 - MaxInterval time.Duration - // After MaxElapsedTime the ExponentialBackOff stops. - // It never stops if MaxElapsedTime == 0. - MaxElapsedTime time.Duration - Clock Clock - - currentInterval time.Duration - startTime time.Time -} - -// Clock is an interface that returns current time for BackOff. -type Clock interface { - Now() time.Time -} - -// Default values for ExponentialBackOff. -const ( - DefaultInitialInterval = 500 * time.Millisecond - DefaultRandomizationFactor = 0.5 - DefaultMultiplier = 1.5 - DefaultMaxInterval = 60 * time.Second - DefaultMaxElapsedTime = 15 * time.Minute -) - -// NewExponentialBackOff creates an instance of ExponentialBackOff using default values. -func NewExponentialBackOff() *ExponentialBackOff { - b := &ExponentialBackOff{ - InitialInterval: DefaultInitialInterval, - RandomizationFactor: DefaultRandomizationFactor, - Multiplier: DefaultMultiplier, - MaxInterval: DefaultMaxInterval, - MaxElapsedTime: DefaultMaxElapsedTime, - Clock: SystemClock, - } - b.Reset() - return b -} - -type systemClock struct{} - -func (t systemClock) Now() time.Time { - return time.Now() -} - -// SystemClock implements Clock interface that uses time.Now(). -var SystemClock = systemClock{} - -// Reset the interval back to the initial retry interval and restarts the timer. -func (b *ExponentialBackOff) Reset() { - b.currentInterval = b.InitialInterval - b.startTime = b.Clock.Now() -} - -// NextBackOff calculates the next backoff interval using the formula: -// Randomized interval = RetryInterval +/- (RandomizationFactor * RetryInterval) -func (b *ExponentialBackOff) NextBackOff() time.Duration { - // Make sure we have not gone over the maximum elapsed time. - if b.MaxElapsedTime != 0 && b.GetElapsedTime() > b.MaxElapsedTime { - return Stop - } - defer b.incrementCurrentInterval() - return getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval) -} - -// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance -// is created and is reset when Reset() is called. -// -// The elapsed time is computed using time.Now().UnixNano(). It is -// safe to call even while the backoff policy is used by a running -// ticker. -func (b *ExponentialBackOff) GetElapsedTime() time.Duration { - return b.Clock.Now().Sub(b.startTime) -} - -// Increments the current interval by multiplying it with the multiplier. -func (b *ExponentialBackOff) incrementCurrentInterval() { - // Check for overflow, if overflow is detected set the current interval to the max interval. - if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier { - b.currentInterval = b.MaxInterval - } else { - b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier) - } -} - -// Returns a random value from the following interval: -// [randomizationFactor * currentInterval, randomizationFactor * currentInterval]. -func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration { - var delta = randomizationFactor * float64(currentInterval) - var minInterval = float64(currentInterval) - delta - var maxInterval = float64(currentInterval) + delta - - // Get a random value from the range [minInterval, maxInterval]. - // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then - // we want a 33% chance for selecting either 1, 2 or 3. - return time.Duration(minInterval + (random * (maxInterval - minInterval + 1))) -} diff --git a/vendor/github.com/cenkalti/backoff/v3/go.mod b/vendor/github.com/cenkalti/backoff/v3/go.mod deleted file mode 100644 index 479e62adaf..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/cenkalti/backoff/v3 - -go 1.12 diff --git a/vendor/github.com/cenkalti/backoff/v3/retry.go b/vendor/github.com/cenkalti/backoff/v3/retry.go deleted file mode 100644 index e936a506f8..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/retry.go +++ /dev/null @@ -1,82 +0,0 @@ -package backoff - -import "time" - -// An Operation is executing by Retry() or RetryNotify(). -// The operation will be retried using a backoff policy if it returns an error. -type Operation func() error - -// Notify is a notify-on-error function. It receives an operation error and -// backoff delay if the operation failed (with an error). -// -// NOTE that if the backoff policy stated to stop retrying, -// the notify function isn't called. -type Notify func(error, time.Duration) - -// Retry the operation o until it does not return error or BackOff stops. -// o is guaranteed to be run at least once. -// -// If o returns a *PermanentError, the operation is not retried, and the -// wrapped error is returned. -// -// Retry sleeps the goroutine for the duration returned by BackOff after a -// failed operation returns. -func Retry(o Operation, b BackOff) error { return RetryNotify(o, b, nil) } - -// RetryNotify calls notify function with the error and wait duration -// for each failed attempt before sleep. -func RetryNotify(operation Operation, b BackOff, notify Notify) error { - var err error - var next time.Duration - var t *time.Timer - - cb := ensureContext(b) - - b.Reset() - for { - if err = operation(); err == nil { - return nil - } - - if permanent, ok := err.(*PermanentError); ok { - return permanent.Err - } - - if next = cb.NextBackOff(); next == Stop { - return err - } - - if notify != nil { - notify(err, next) - } - - if t == nil { - t = time.NewTimer(next) - defer t.Stop() - } else { - t.Reset(next) - } - - select { - case <-cb.Context().Done(): - return err - case <-t.C: - } - } -} - -// PermanentError signals that the operation should not be retried. -type PermanentError struct { - Err error -} - -func (e *PermanentError) Error() string { - return e.Err.Error() -} - -// Permanent wraps the given err in a *PermanentError. -func Permanent(err error) *PermanentError { - return &PermanentError{ - Err: err, - } -} diff --git a/vendor/github.com/cenkalti/backoff/v3/ticker.go b/vendor/github.com/cenkalti/backoff/v3/ticker.go deleted file mode 100644 index e41084b0ef..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/ticker.go +++ /dev/null @@ -1,82 +0,0 @@ -package backoff - -import ( - "sync" - "time" -) - -// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff. -// -// Ticks will continue to arrive when the previous operation is still running, -// so operations that take a while to fail could run in quick succession. -type Ticker struct { - C <-chan time.Time - c chan time.Time - b BackOffContext - stop chan struct{} - stopOnce sync.Once -} - -// NewTicker returns a new Ticker containing a channel that will send -// the time at times specified by the BackOff argument. Ticker is -// guaranteed to tick at least once. The channel is closed when Stop -// method is called or BackOff stops. It is not safe to manipulate the -// provided backoff policy (notably calling NextBackOff or Reset) -// while the ticker is running. -func NewTicker(b BackOff) *Ticker { - c := make(chan time.Time) - t := &Ticker{ - C: c, - c: c, - b: ensureContext(b), - stop: make(chan struct{}), - } - t.b.Reset() - go t.run() - return t -} - -// Stop turns off a ticker. After Stop, no more ticks will be sent. -func (t *Ticker) Stop() { - t.stopOnce.Do(func() { close(t.stop) }) -} - -func (t *Ticker) run() { - c := t.c - defer close(c) - - // Ticker is guaranteed to tick at least once. - afterC := t.send(time.Now()) - - for { - if afterC == nil { - return - } - - select { - case tick := <-afterC: - afterC = t.send(tick) - case <-t.stop: - t.c = nil // Prevent future ticks from being sent to the channel. - return - case <-t.b.Context().Done(): - return - } - } -} - -func (t *Ticker) send(tick time.Time) <-chan time.Time { - select { - case t.c <- tick: - case <-t.stop: - return nil - } - - next := t.b.NextBackOff() - if next == Stop { - t.Stop() - return nil - } - - return time.After(next) -} diff --git a/vendor/github.com/cenkalti/backoff/v3/tries.go b/vendor/github.com/cenkalti/backoff/v3/tries.go deleted file mode 100644 index cfeefd9b76..0000000000 --- a/vendor/github.com/cenkalti/backoff/v3/tries.go +++ /dev/null @@ -1,35 +0,0 @@ -package backoff - -import "time" - -/* -WithMaxRetries creates a wrapper around another BackOff, which will -return Stop if NextBackOff() has been called too many times since -the last time Reset() was called - -Note: Implementation is not thread-safe. -*/ -func WithMaxRetries(b BackOff, max uint64) BackOff { - return &backOffTries{delegate: b, maxTries: max} -} - -type backOffTries struct { - delegate BackOff - maxTries uint64 - numTries uint64 -} - -func (b *backOffTries) NextBackOff() time.Duration { - if b.maxTries > 0 { - if b.maxTries <= b.numTries { - return Stop - } - b.numTries++ - } - return b.delegate.NextBackOff() -} - -func (b *backOffTries) Reset() { - b.numTries = 0 - b.delegate.Reset() -} diff --git a/vendor/github.com/BurntSushi/toml/COPYING b/vendor/github.com/dgryski/go-rendezvous/LICENSE similarity index 94% rename from vendor/github.com/BurntSushi/toml/COPYING rename to vendor/github.com/dgryski/go-rendezvous/LICENSE index 01b5743200..22080f736a 100644 --- a/vendor/github.com/BurntSushi/toml/COPYING +++ b/vendor/github.com/dgryski/go-rendezvous/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 TOML authors +Copyright (c) 2017-2020 Damian Gryski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/github.com/dgryski/go-rendezvous/rdv.go b/vendor/github.com/dgryski/go-rendezvous/rdv.go new file mode 100644 index 0000000000..7a6f8203c6 --- /dev/null +++ b/vendor/github.com/dgryski/go-rendezvous/rdv.go @@ -0,0 +1,79 @@ +package rendezvous + +type Rendezvous struct { + nodes map[string]int + nstr []string + nhash []uint64 + hash Hasher +} + +type Hasher func(s string) uint64 + +func New(nodes []string, hash Hasher) *Rendezvous { + r := &Rendezvous{ + nodes: make(map[string]int, len(nodes)), + nstr: make([]string, len(nodes)), + nhash: make([]uint64, len(nodes)), + hash: hash, + } + + for i, n := range nodes { + r.nodes[n] = i + r.nstr[i] = n + r.nhash[i] = hash(n) + } + + return r +} + +func (r *Rendezvous) Lookup(k string) string { + // short-circuit if we're empty + if len(r.nodes) == 0 { + return "" + } + + khash := r.hash(k) + + var midx int + var mhash = xorshiftMult64(khash ^ r.nhash[0]) + + for i, nhash := range r.nhash[1:] { + if h := xorshiftMult64(khash ^ nhash); h > mhash { + midx = i + 1 + mhash = h + } + } + + return r.nstr[midx] +} + +func (r *Rendezvous) Add(node string) { + r.nodes[node] = len(r.nstr) + r.nstr = append(r.nstr, node) + r.nhash = append(r.nhash, r.hash(node)) +} + +func (r *Rendezvous) Remove(node string) { + // find index of node to remove + nidx := r.nodes[node] + + // remove from the slices + l := len(r.nstr) + r.nstr[nidx] = r.nstr[l] + r.nstr = r.nstr[:l] + + r.nhash[nidx] = r.nhash[l] + r.nhash = r.nhash[:l] + + // update the map + delete(r.nodes, node) + moved := r.nstr[nidx] + r.nodes[moved] = nidx +} + +func xorshiftMult64(x uint64) uint64 { + x ^= x >> 12 // a + x ^= x << 25 // b + x ^= x >> 27 // c + return x * 2685821657736338717 +} diff --git a/vendor/github.com/docker/docker/AUTHORS b/vendor/github.com/docker/docker/AUTHORS index 246e2a33f5..dffacff112 100644 --- a/vendor/github.com/docker/docker/AUTHORS +++ b/vendor/github.com/docker/docker/AUTHORS @@ -4,22 +4,32 @@ Aanand Prasad Aaron Davidson Aaron Feng +Aaron Hnatiw Aaron Huslage +Aaron L. Xu Aaron Lehmann Aaron Welch +Aaron.L.Xu Abel Muiño Abhijeet Kasurde +Abhinandan Prativadi Abhinav Ajgaonkar Abhishek Chanda +Abhishek Sharma Abin Shahab Adam Avilla +Adam Dobrawy +Adam Eijdenberg Adam Kunk Adam Miller Adam Mills +Adam Pointer Adam Singer Adam Walz +Addam Hardy Aditi Rajagopal Aditya +Adnan Khan Adolfo Ochagavía Adria Casas Adrian Moisey @@ -31,81 +41,112 @@ Ahmed Kamal Ahmet Alp Balkan Aidan Feldman Aidan Hobson Sayers -AJ Bowen +AJ Bowen Ajey Charantimath ajneu -Akihiro Suda +Akash Gupta +Akhil Mohan +Akihiro Matsushima +Akihiro Suda +Akim Demaille +Akira Koyasu +Akshay Karle Al Tobey alambike +Alan Hoyle Alan Scherger Alan Thompson Albert Callarisa Albert Zhang +Albin Kerouanton +Alejandro González Hevia Aleksa Sarai Aleksandrs Fadins Alena Prokharchyk -Alessandro Boch +Alessandro Boch Alessio Biancalana Alex Chan +Alex Chen Alex Coventry Alex Crawford Alex Ellis Alex Gaynor +Alex Goodman Alex Olshansky Alex Samorukov Alex Warhawk Alexander Artemenko Alexander Boyd Alexander Larsson +Alexander Midlash Alexander Morozov Alexander Shopov Alexandre Beslic +Alexandre Garnier Alexandre González +Alexandre Jomin Alexandru Sfirlogea +Alexei Margasov Alexey Guskov Alexey Kotlyarov Alexey Shamrin Alexis THOMAS +Alfred Landrum Ali Dehghani +Alicia Lauerman +Alihan Demir Allen Madsen -Allen Sun +Allen Sun almoehi Alvaro Saurin +Alvin Deng Alvin Richards amangoel Amen Belayneh +Amir Goldstein Amit Bakshi Amit Krishnan Amit Shukla +Amr Gawish Amy Lindburg Anand Patil AnandkumarPatel Anatoly Borodin +Anca Iordache Anchal Agrawal +Anda Xu Anders Janmyr Andre Dublin <81dublin@gmail.com> Andre Granovsky +Andrea Denisse Gómez Andrea Luzzardi Andrea Turli +Andreas Elvers Andreas Köhler Andreas Savvides Andreas Tiefenthaler Andrei Gherzan +Andrei Vagin Andrew C. Bodine Andrew Clay Shafer Andrew Duckworth Andrew France Andrew Gerrand Andrew Guenther +Andrew He +Andrew Hsu Andrew Kuklewicz Andrew Macgregor Andrew Macpherson Andrew Martin +Andrew McDonnell Andrew Munsell +Andrew Pennebaker Andrew Po -Andrew Weiss +Andrew Weiss Andrew Williams Andrews Medina +Andrey Kolomentsev Andrey Petrov Andrey Stolbovsky André Martins @@ -120,12 +161,16 @@ Andy Wilson Anes Hasicic Anil Belur Anil Madhavapeddy +Ankit Jain Ankush Agarwal Anonmily +Anran Qiao +Anshul Pundir Anthon van der Neut Anthony Baire Anthony Bishopric Anthony Dahanne +Anthony Sottile Anton Löfgren Anton Nikitin Anton Polonskiy @@ -136,16 +181,21 @@ Antony Messerli Anuj Bahuguna Anusha Ragunathan apocas +Arash Deshmeh ArikaChen +Arko Dasgupta Arnaud Lefebvre Arnaud Porterie +Arnaud Rebillout Arthur Barr Arthur Gautier Artur Meyster Arun Gupta +Asad Saeeduddin Asbjørn Enge averagehuman Avi Das +Avi Kivity Avi Miller Avi Vaid ayoshitake @@ -156,38 +206,53 @@ Barry Allard Bartłomiej Piotrowski Bastiaan Bakker bdevloed +Ben Bonnefoy Ben Firshman Ben Golub +Ben Gould Ben Hall Ben Sargent Ben Severson Ben Toews Ben Wiklund Benjamin Atkin +Benjamin Baker +Benjamin Boudreau +Benjamin Yolken +Benny Ng Benoit Chesneau Bernerd Schaefer +Bernhard M. Wiedemann Bert Goethals +Bertrand Roussel +Bevisy Zhang Bharath Thiruveedula Bhiraj Butala +Bhumika Bayani Bilal Amarni -Bill W -bin liu +Bill Wang +Bily Zhang +Bin Liu +Bingshen Wang Blake Geno Boaz Shuster bobby abbott -boucher +Boqin Qin +Boris Pruessmann +Boshi Lian Bouke Haarsma Boyd Hemphill boynux Bradley Cicenas Bradley Wright Brandon Liu -Brandon Philips +Brandon Philips Brandon Rhodes Brendan Dixon Brent Salisbury Brett Higgins Brett Kochendorfer +Brett Randall Brian (bex) Exelbierd Brian Bland Brian DeHamer @@ -196,20 +261,22 @@ Brian Flad Brian Goff Brian McCallister Brian Olsen +Brian Schwind Brian Shumate Brian Torres-Gil Brian Trump Brice Jaglin Briehan Lombaard +Brielle Broder Bruno Bigras Bruno Binet Bruno Gazzera Bruno Renié +Bruno Tavares Bryan Bess Bryan Boreham Bryan Matsuo Bryan Murphy -buddhamagnet Burke Libbey Byung Kang Caleb Spare @@ -222,16 +289,22 @@ Cao Weiwei Carl Henrik Lunde Carl Loa Odin Carl X. Su +Carlo Mion Carlos Alexandro Becker +Carlos de Paula Carlos Sanchez Carol Fager-Higgins Cary Casey Bisson +Catalin Pirvu +Ce Gao Cedric Davies Cezar Sa Espinola Chad Swenson Chance Zibolski -Chander G +Chander Govindarajan +Chanhun Jeong +Chao Wang Charles Chan Charles Hooper Charles Law @@ -239,61 +312,89 @@ Charles Lindsay Charles Merriam Charles Sarrazin Charles Smith +Charlie Drage Charlie Lewis Chase Bolt ChaYoung You Chen Chao +Chen Chuanliang Chen Hanxiao -cheney90 +Chen Min +Chen Mingjie +Chen Qiu +Cheng-mean Liu +Chengfei Shang +Chengguang Xu +chenyuzhu +Chetan Birajdar Chewey Chia-liang Kao chli Cholerae Hu Chris Alfonso Chris Armstrong +Chris Dias Chris Dituri Chris Fordham +Chris Gavin +Chris Gibson Chris Khoo +Chris McKinnel Chris McKinnel +Chris Price Chris Seto Chris Snow Chris St. Pierre Chris Stivers Chris Swan +Chris Telfer Chris Wahl Chris Weyl -chrismckinnel +Chris White Christian Berendt +Christian Brauner Christian Böhme +Christian Muehlhaeuser Christian Persson Christian Rotzoll Christian Simon Christian Stefanescu -ChristoperBiscardi Christophe Mehay Christophe Troestler +Christophe Vidal +Christopher Biscardi +Christopher Crone Christopher Currie Christopher Jones Christopher Latham Christopher Rigor -Christy Perez +Christy Norman Chun Chen Ciro S. Costa Clayton Coleman Clinton Kitson +Cody Roseborough Coenraad Loubser Colin Dunklau +Colin Hebert +Colin Panisset Colin Rice Colin Walters Collin Guarino Colm Hally companycy +Corbin Coleman +Corey Farrell Cory Forsyth cressie176 CrimsonGlory +Cristian Ariza Cristian Staretu cristiano balducci +Cristina Yenyxe Gonzalez Garcia Cruceru Calin-Cristian +CUI Wei +Cyprian Gracz Cyril F Daan van Berkel Daehyeok Mun @@ -313,14 +414,20 @@ Dan Keder Dan Levy Dan McPherson Dan Stine -Dan Walsh Dan Williams +Dani Hodovic +Dani Louca Daniel Antlinger +Daniel Black +Daniel Dao Daniel Exner Daniel Farrell Daniel Garcia Daniel Gasienica +Daniel Grunwell +Daniel Helfand Daniel Hiltgen +Daniel J Walsh Daniel Menet Daniel Mizyrycki Daniel Nephin @@ -328,23 +435,29 @@ Daniel Norberg Daniel Nordberg Daniel Robinson Daniel S +Daniel Sweet Daniel Von Fange +Daniel Watkins Daniel X Moore Daniel YC Lin Daniel Zhang -Daniel, Dao Quang Minh Danny Berger +Danny Milosavljevic Danny Yates +Danyal Khaliq Darren Coxall Darren Shepherd Darren Stahl +Dattatraya Kumbhar Davanum Srinivas Dave Barboza +Dave Goodchild Dave Henderson Dave MacDonald Dave Tucker David Anderson David Calavera +David Chung David Corking David Cramer David Currie @@ -352,30 +465,40 @@ David Davis David Dooling David Gageot David Gebler +David Glasser David Lawrence David Lechner David M. Karr David Mackey David Mat David Mcanulty +David McKay +David P Hilton David Pelaez David R. Jenni David Röthlisberger -David Sheets +David Sheets David Sissitka David Trott +David Wang <00107082@163.com> +David Williamson David Xia David Young Davide Ceretti Dawn Chen dbdd dcylabs -decadent +Debayan De +Deborah Gertrude Digges deed02392 +Deep Debroy Deng Guangxing Deni Bertovic +Denis Defreyne Denis Gladkikh Denis Ollier +Dennis Chen +Dennis Chen Dennis Docter Derek Derek @@ -384,15 +507,21 @@ Derek McGowan Deric Crago Deshi Xiao devmeyster +Devon Estes Devvyn Murphy Dharmit Shah +Dhawal Yogesh Bhanushali +Diego Romero +Diego Siqueira Dieter Reuter Dillon Dixon Dima Stopel Dimitri John Ledkov +Dimitris Mandalidis Dimitris Rozakis Dimitry Andric Dinesh Subhraveti +Ding Fei Diogo Monica DiuDiugirl Djibril Koné @@ -401,10 +530,16 @@ Dmitri Logvinenko Dmitri Shuralyov Dmitry Demeshchuk Dmitry Gusev +Dmitry Kononenko +Dmitry Sharshakov +Dmitry Shyshkin Dmitry Smirnov Dmitry V. Krivenok Dmitry Vorobev Dolph Mathews +Dominic Tubach +Dominic Yin +Dominik Dingel Dominik Finkbeiner Dominik Honnef Don Kirkby @@ -412,15 +547,18 @@ Don Kjer Don Spaulding Donald Huang Dong Chen +Donghwa Kim Donovan Jones Doron Podoleanu Doug Davis Doug MacEachern Doug Tangren +Douglas Curtis Dr Nic Williams dragon788 Dražen Lučanin -Drew Erny +Drew Erny +Drew Hubl Dustin Sallings Ed Costello Edmund Wagner @@ -428,85 +566,114 @@ Eiichi Tsukata Eike Herzbach Eivin Giske Skaaren Eivind Uggedal -Elan Ruusamäe +Elan Ruusamäe +Elango Sivanandam +Elena Morozova +Eli Uriegas +Elias Faxö Elias Probst Elijah Zupancic eluck Elvir Kuric +Emil Davtyan Emil Hernvall Emily Maier Emily Rose Emir Ozer Enguerran Eohyung Lee +epeterso Eric Barch +Eric Curtin +Eric G. Noriega Eric Hanchrow Eric Lee Eric Myhre Eric Paris Eric Rafaloff -Eric Rosenberg +Eric Rosenberg Eric Sage -Eric Windisch +Eric Soderstrom Eric Yang Eric-Olivier Lamey +Erica Windisch Erik Bray Erik Dubbelboer Erik Hollensbe Erik Inge Bolsø Erik Kristensen +Erik St. Martin Erik Weathers Erno Hopearuoho Erwin van der Koogh -Euan +Ethan Bell +Ethan Mosbaugh +Euan Kemp +Eugen Krizo Eugene Yakubovich -eugenkrizo -evalle Evan Allrich Evan Carmi Evan Hazlett Evan Krall Evan Phoenix Evan Wies +Evelyn Xu Everett Toews +Evgeniy Makhrov +Evgeny Shmarnev Evgeny Vereshchagin Ewa Czechowska Eystein Måløy Stenberg ezbercih +Ezra Silvera +Fabian Kramm +Fabian Lauer +Fabian Raetz Fabiano Rosas Fabio Falci +Fabio Kung Fabio Rapposelli Fabio Rehm Fabrizio Regini Fabrizio Soppelsa Faiz Khan falmp +Fangming Fang Fangyuan Gao <21551127@zju.edu.cn> +fanjiyun Fareed Dudhia Fathi Boudra Federico Gimenez +Felipe Oliveira +Felipe Ruhland +Felix Abecassis Felix Geisendörfer -Felix Hupfeld +Felix Hupfeld Felix Rabe -Felix Ruess +Felix Ruess Felix Schindler +Feng Yan +Fengtu Wang Ferenc Szabo Fernando Fero Volar Ferran Rodenas Filipe Brandenburger Filipe Oliveira -fl0yd Flavio Castelli -FLGMwt +Flavio Crisciani Florian Florian Klein Florian Maier +Florian Noeding +Florian Schmaus Florian Weingarten Florin Asavoaie +Florin Patan fonglh -fortinux +Foysal Iqbal Francesc Campoy +Francesco Mari Francis Chuang Francisco Carriedo Francisco Souza @@ -514,34 +681,47 @@ Frank Groeneveld Frank Herrmann Frank Macreery Frank Rosquin +frankyang Fred Lifton Frederick F. Kautz IV Frederik Loeffert Frederik Nordahl Jul Sabroe Freek Kalter -frosforever -fy2462 +Frieder Bluemle +Fu JinLin Félix Baylac-Jacqué Félix Cantournet Gabe Rosenhouse Gabor Nagy +Gabriel Linder Gabriel Monroy -GabrielNicolasAvellaneda +Gabriel Nicolas Avellaneda +Gaetan de Villele Galen Sampson +Gang Qiao Gareth Rushgrove Garrett Barboza +Gary Schaetz Gaurav -gautam, prasanna +Gaurav Singh +Gaël PORTAY +Genki Takiuchi GennadySpb Geoffrey Bachelet +Geon Kim +George Kontridze George MacRorie George Xie Georgi Hristozov Gereon Frey German DZ Gert van Valkenhoef +Gerwim Feiken +Ghislain Bourgeois +Giampaolo Mancini Gianluca Borello Gildas Cuisinier +Giovan Isa Musthofa gissehel Giuseppe Mazzotta Gleb Fotengauer-Malinovskiy @@ -549,43 +729,67 @@ Gleb M Borisov Glyn Normington GoBella Goffert van Gool +Goldwyn Rodrigues +Gopikannan Venugopalsamy Gosuke Miyashita -Gou Rao +Gou Rao Govinda Fichtner +Grant Millar Grant Reaber Graydon Hoare Greg Fausak +Greg Pflaum +Greg Stephens Greg Thornton -grossws -grunny -gs11 +Grzegorz Jaśkiewicz Guilhem Lettron Guilherme Salgado Guillaume Dufour Guillaume J. Charmes guoxiuyan +Guri Gurjeet Singh Guruprasad +Gustav Sinder gwx296173 Günter Zöchbauer +Haichao Yang +haikuoliu +Hakan Özler +Hamish Hutchings +Hannes Ljungberg Hans Kristian Flaatten Hans Rødtang Hao Shu Wei Hao Zhang <21521210@zju.edu.cn> Harald Albers +Harald Niesche Harley Laue Harold Cooper +Harrison Turton Harry Zhang +Harshal Patil +Harshal Patil He Simei +He Xiaoxi +He Xin heartlock <21521209@zju.edu.cn> Hector Castro +Helen Xie Henning Sprang +Hiroshi Hatake +Hiroyuki Sasagawa Hobofan Hollie Teal Hong Xu +Hongbin Lu +Hongxu Jia +Honza Pokorny +Hsing-Hui Hsu hsinko <21551195@zju.edu.cn> Hu Keping Hu Tao +HuanHuan Ye Huanzhong Zhang Huayi Zhang Hugo Duncan @@ -594,38 +798,55 @@ Hunter Blanks huqun Huu Nguyen hyeongkyu.lee -hyp3rdino -Hyzhou <1187766782@qq.com> +Hyzhou Zhy +Iago López Galeiras Ian Babrou Ian Bishop Ian Bull Ian Calvert +Ian Campbell +Ian Chen Ian Lee Ian Main +Ian Philpot Ian Truslove Iavael Icaro Seara +Ignacio Capurro Igor Dolzhikov +Igor Karpovich +Iliana Weller Ilkka Laukkanen Ilya Dmitrichenko Ilya Gusev -ILYA Khlopotov +Ilya Khlopotov imre Fitos inglesp Ingo Gottwald +Innovimax Isaac Dupree Isabel Jimenez +Isaiah Grace Isao Jonas +Iskander Sharipov Ivan Babrou Ivan Fraixedes Ivan Grcic +Ivan Markin J Bruni J. Nunn Jack Danger Canty +Jack Laxson Jacob Atzen Jacob Edelman +Jacob Tomlinson +Jacob Vallejo +Jacob Wen +Jaime Cepeda +Jaivish Kothari Jake Champlin Jake Moshenko +Jake Sanders jakedt James Allen James Carey @@ -636,10 +857,13 @@ James Kyburz James Kyle James Lal James Mills +James Nesbitt James Nugent James Turnbull -Jamie Hannaford +James Watkins-Harvey +Jamie Hannaford Jamshid Afshar +Jan Chren Jan Keromnes Jan Koprowski Jan Pazdziora @@ -654,6 +878,7 @@ Jared Hocutt Jaroslaw Zabiello jaseg Jasmine Hegman +Jason A. Donenfeld Jason Divock Jason Giedymin Jason Green @@ -670,11 +895,16 @@ jaxgeller Jay Jay Jay Kamat +Jean Rouge Jean-Baptiste Barth Jean-Baptiste Dalido +Jean-Christophe Berthon Jean-Paul Calderone +Jean-Pierre Huynh Jean-Tiare Le Bigot +Jeeva S. Chelladhurai Jeff Anderson +Jeff Hajewski Jeff Johnston Jeff Lindsay Jeff Mickey @@ -686,32 +916,43 @@ Jeffrey Bolle Jeffrey Morgan Jeffrey van Gogh Jenny Gebske +Jeremy Chambers Jeremy Grosser Jeremy Price Jeremy Qian Jeremy Unruh +Jeremy Yallop +Jeroen Franse Jeroen Jacobs Jesse Dearing Jesse Dubay -Jessica Frazelle +Jessica Frazelle Jezeniel Zapanta -jgeiger Jhon Honce Ji.Zhilong +Jian Liao Jian Zhang -jianbosun +Jiang Jinyang +Jie Luo +Jie Ma +Jihyun Hwang Jilles Oldenbeuving Jim Alateras +Jim Ehrismann +Jim Galasyn +Jim Minter Jim Perrin Jimmy Cuadra Jimmy Puckett -jimmyxian +Jimmy Song Jinsoo Park +Jintao Zhang +Jiri Appl Jiri Popelka +Jiuyue Ma Jiří Župka -jjy -jmzwcn Joao Fernandes +Joao Trindade Joe Beda Joe Doliner Joe Ferguson @@ -722,6 +963,7 @@ Joel Friedly Joel Handwell Joel Hansson Joel Wurtz +Joey Geiger Joey Geiger Joey Gibson Joffrey F @@ -733,18 +975,29 @@ John Costa John Feminella John Gardiner Myers John Gossman -John Howard (VM) +John Harris +John Howard +John Laswell +John Maguire +John Mulhausen John OBrien III John Starks +John Stephens John Tims +John V. Martinez John Warwick John Willis -johnharris85 +Jon Johnson +Jon Surrell Jon Wedaman +Jonas Dohse +Jonas Heinrich Jonas Pfenniger +Jonathan A. Schweder Jonathan A. Sternberg Jonathan Boulle Jonathan Camp +Jonathan Choy Jonathan Dowland Jonathan Lebon Jonathan Lomas @@ -753,47 +1006,64 @@ Jonathan Mueller Jonathan Pares Jonathan Rudenberg Jonathan Stoppani +Jonh Wendell +Joni Sar Joost Cassee -Jordan Jordan Arentsen +Jordan Jennings Jordan Sissel -Jose Diaz-Gonzalez +Jorge Marin +Jorit Kleine-Möllhoff +Jose Diaz-Gonzalez Joseph Anthony Pasquale Holsten Joseph Hager Joseph Kern +Joseph Rothrock Josh Josh Bodah +Josh Bonczkowski Josh Chorlton +Josh Eveleth Josh Hawn Josh Horwitz Josh Poimboeuf +Josh Soref +Josh Wilson Josiah Kiehl José Tomás Albornoz +Joyce Jang JP -jrabbit Julian Taylor Julien Barbier Julien Bisconti Julien Bordellier Julien Dubois +Julien Kassar +Julien Maitrehenry Julien Pervillé +Julien Pivotto +Julio Guerra Julio Montes Jun-Ru Chang Jussi Nummelin Justas Brazauskas +Justen Martin Justin Cormack Justin Force +Justin Menga Justin Plock Justin Simonelis Justin Terry Justyn Temme Jyrki Puttonen -Jérôme Petazzoni +Jérémy Leherpeur +Jérôme Petazzoni Jörg Thalheim +K. Heller Kai Blin -Kai Qiang Wu(Kennan) +Kai Qiang Wu (Kennan) Kamil Domański -kamjar gerami +Kamjar Gerami Kanstantsin Shautsou Kara Alexandra Karan Lyons @@ -801,88 +1071,112 @@ Kareem Khazem kargakis Karl Grzeszczak Karol Duleba +Karthik Karanth +Karthik Nayak +Kasper Fabæch Brandt +Kate Heddleston Katie McLaughlin Kato Kazuyoshi Katrina Owen Kawsar Saiyeed +Kay Yan kayrus +Kazuhiro Sera +Ke Li Ke Xu +Kei Ohmura Keith Hudgins Keli Hu Ken Cochrane Ken Herner Ken ICHIKAWA +Ken Reese Kenfe-Mickaël Laventure Kenjiro Nakayama Kent Johnson +Kenta Tada Kevin "qwazerty" Houdebert Kevin Burke Kevin Clark +Kevin Feyrer Kevin J. Lynagh Kevin Jing Qiu +Kevin Kern Kevin Menard +Kevin Meredith Kevin P. Kucharczyk +Kevin Parsons Kevin Richardson Kevin Shi Kevin Wallace Kevin Yap -kevinmeredith Keyvan Fatehi kies Kim BKC Carlbacker Kim Eik Kimbro Staken -Kir Kolyshkin +Kir Kolyshkin Kiran Gangadharan -Kirill Kolyshkin Kirill SIbirev knappe Kohei Tsuruta Koichi Shiraishi Konrad Kleine +Konstantin Gribov Konstantin L Konstantin Pelykh +Krasi Georgiev Krasimir Georgiev Kris-Mikael Krister Kristian Haugene Kristina Zabunova -krrg +Krystian Wojcicki Kun Zhang -Kunal Kushwaha +Kunal Kushwaha +Kunal Tyagi Kyle Conroy Kyle Linden +Kyle Wuolle kyu Lachlan Coote Lai Jiangshan Lajos Papp Lakshan Perera Lalatendu Mohanty -lalyos Lance Chen Lance Kinley Lars Butler Lars Kellogg-Stedman Lars R. Damerow +Lars-Magnus Skog Laszlo Meszaros +Laura Frank Laurent Erignoux Laurie Voss Leandro Siqueira Lee Chao <932819864@qq.com> Lee, Meng-Han leeplay +Lei Gong Lei Jitang Len Weincier Lennie +Leo Gallucci Leszek Kowalski Levi Blackstone Levi Gross +Lewis Daly Lewis Marshall Lewis Peckover +Li Yi Liam Macgillavry Liana Lo Liang Mingqiang Liang-Chi Hsieh -liaoqingwei +Liao Qingwei +Lifubang +Lihua Tang +Lily Guo limsy Lin Lu LingFaKe @@ -891,50 +1185,67 @@ Liran Tal Liron Levin Liu Bo Liu Hua +liwenqi lixiaobing10051267 +Liz Zhang LIZAO LI +Lizzie Dixon <_@lizzie.io> Lloyd Dewolf Lokesh Mandvekar longliqiang88 <394564827@qq.com> Lorenz Leutgeb -Lorenzo Fontana +Lorenzo Fontana +Lotus Fenn +Louis Delossantos Louis Opter +Luca Favatella Luca Marturana Luca Orlandi Luca-Bogdan Grigorescu Lucas Chan Lucas Chi +Lucas Molas +Lucas Silvestre Luciano Mores Luis Martínez de Bartolomé Izquierdo +Luiz Svoboda +Lukas Heeren Lukas Waslowski lukaspustina Lukasz Zajaczkowski -lukemarsden +Luke Marsden +Lyn Lynda O'Leary Lénaïc Huard +Ma Müller Ma Shimiao Mabin +Madhan Raj Mookkandy Madhav Puri Madhu Venugopal -Mageee <21521230.zju.edu.cn> +Mageee Mahesh Tiyyagura malnick Malte Janduda -manchoz Manfred Touron Manfred Zabarauskas +Manjunath A Kumatagi Mansi Nahar -mansinahar Manuel Meurer +Manuel Rüger Manuel Woelker mapk0y Marc Abramowitz Marc Kuo Marc Tamsky +Marcel Edmund Franke +Marcelo Horacio Fortino Marcelo Salazar Marco Hennings +Marcus Cobden Marcus Farkas Marcus Linke +Marcus Martins Marcus Ramberg Marek Goldmann Marian Marinov @@ -944,24 +1255,35 @@ Marius Gundersen Marius Sturm Marius Voila Mark Allen +Mark Jeromin Mark McGranaghan Mark McKinstry +Mark Milstein +Mark Oates +Mark Parker Mark West +Markan Patel Marko Mikulicic Marko Tibold Markus Fix +Markus Kortlang Martijn Dwars Martijn van Oosterhout Martin Honermeyer Martin Kelly Martin Mosegaard Amdisen +Martin Muzatko Martin Redmond Mary Anthony Masahito Zembutsu +Masato Ohba +Masayuki Morita Mason Malone Mateusz Sulima Mathias Monnerville +Mathieu Champlon Mathieu Le Marec - Pasquet +Mathieu Parent Matt Apperson Matt Bachmann Matt Bentley @@ -970,25 +1292,32 @@ Matt Hoyle Matt McCormick Matt Moore Matt Richardson +Matt Rickard Matt Robenolt +Matt Schurenko +Matt Williams Matthew Heon +Matthew Lapworth Matthew Mayer +Matthew Mosesohn Matthew Mueller Matthew Riley Matthias Klumpp Matthias Kühnle Matthias Rampke Matthieu Hauglustaine -mattymo -mattyw +Mattias Jernberg Mauricio Garavaglia mauriyouth +Max Harmathy Max Shytikov Maxim Fedchyshyn Maxim Ivanov Maxim Kulkin Maxim Treskin Maxime Petazzoni +Maximiliano Maccanti +Maxwell Meaglith Ma meejah Megan Kostick @@ -1008,66 +1337,80 @@ Michael Friis Michael Gorsuch Michael Grauer Michael Holzheu -Michael Hudson-Doyle +Michael Hudson-Doyle Michael Huettermann +Michael Irwin Michael Käufl Michael Neale +Michael Nussbaum Michael Prokop Michael Scharf +Michael Spetsiotis Michael Stapelberg Michael Steinert Michael Thies Michael West +Michael Zhao Michal Fojtik Michal Gebauer Michal Jemala -Michal Minar +Michal Minář Michal Wieczorek Michaël Pailloncy Michał Czeraszkiewicz -Michiel@unhosted -Mickaël FORTUNATO +Michał Gryko +Michiel de Jong +Mickaël Fortunato +Mickaël Remars Miguel Angel Fernández Miguel Morales Mihai Borobocea Mihuleacc Sergiu Mike Brown +Mike Bush +Mike Casas Mike Chelen Mike Danese Mike Dillon Mike Dougherty +Mike Estes Mike Gaffney Mike Goelzer Mike Leone +Mike Lundy Mike MacCana Mike Naberezny Mike Snitzer mikelinjie <294893458@qq.com> Mikhail Sobolev +Miklos Szegedi +Milind Chawre Miloslav Trmač mingqing Mingzhen Feng Misty Stanley-Jones Mitch Capper +Mizuki Urushida mlarcher Mohammad Banikazemi +Mohammad Nasirifar Mohammed Aaqib Ansari Mohit Soni +Moorthy RS Morgan Bauer Morgante Pell Morgy93 Morten Siebuhr Morton Fox Moysés Borges -mqliang +mrfly Mrunal Patel -msabansal -mschurenko -muge +Muayyad Alsadi Mustafa Akın Muthukumar R Máximo Cuadros Médi-Rémi Hashim +Nace Oroz Nahum Shalman Nakul Pathak Nalin Dahyabhai @@ -1075,6 +1418,7 @@ Nan Monnand Deng Naoki Orii Natalie Parker Natanael Copa +Natasha Jarus Nate Brennand Nate Eagleson Nate Jones @@ -1083,66 +1427,84 @@ Nathan Kleyn Nathan LeClaire Nathan McCauley Nathan Williams +Naveed Jamil Neal McBurnett +Neil Horman Neil Peterson Nelson Chen Neyazul Haque Nghia Tran Niall O'Higgins Nicholas E. Rabenau -nick +Nick Adcock Nick DeCoursin Nick Irvine +Nick Neisen Nick Parker Nick Payne +Nick Russo Nick Stenning Nick Stinemates +NickrenREN Nicola Kabar -Nicolas Borboën -Nicolas De loof +Nicolas Borboën +Nicolas De Loof Nicolas Dudebout Nicolas Goy Nicolas Kaiser +Nicolas Sterchele +Nicolas V Castet Nicolás Hock Isaza Nigel Poulton +Nik Nyby +Nikhil Chawla NikolaMandic -nikolas +Nikolas Garofil +Nikolay Edigaryev +Nikolay Milovanov Nirmal Mehta Nishant Totla NIWA Hideyuki +Noah Meyerhans +Noah Treuhaft +NobodyOnSE noducks Nolan Darilek +Noriki Nakamura nponeccop Nuutti Kotivuori nzwsch O.S. Tezer objectified -OddBloke -odk- +Odin Ugedal Oguz Bilgic Oh Jinkyun Ohad Schneider ohmystack Ole Reifschneider Oliver Neal +Oliver Reason Olivier Gambier Olle Jonsson +Olli Janatuinen +Olly Pomeroy +Omri Shiv Oriol Francès -orkaa Oskar Niburski Otto Kekäläinen -oyld -ozlerhakan -paetling -pandrew -panticz +Ouyang Liduo +Ovidio Mallo +Panagiotis Moustafellos Paolo G. Giarrusso +Pascal +Pascal Bach Pascal Borreli Pascal Hartig Patrick Böänziger Patrick Devine Patrick Hemmer Patrick Stapleton +Patrik Cyvoct pattichen Paul paul @@ -1152,6 +1514,7 @@ Paul Bowsher Paul Furtado Paul Hammond Paul Jimenez +Paul Kehrer Paul Lietar Paul Liljenberg Paul Morie @@ -1159,24 +1522,31 @@ Paul Nasrat Paul Weaver Paulo Ribeiro Pavel Lobashov +Pavel Matěja +Pavel Pletenev Pavel Pospisil Pavel Sutyrin -Pavel Tikhomirov +Pavel Tikhomirov Pavlos Ratis Pavol Vargovcik +Pawel Konczalski Peeyush Gupta Peggy Li Pei Su +Peng Tao Penghan Wang +Per Weijnitz perhapszzy@sina.com -pestophagous Peter Bourgon Peter Braden -Peter Choi -Peter Dave Hello +Peter Bücker +Peter Choi +Peter Dave Hello Peter Edge Peter Ericson Peter Esbensen +Peter Jaffe +Peter Kang Peter Malmgren Peter Salvatore Peter Volpe @@ -1185,10 +1555,13 @@ Petr Švihlík Phil Phil Estes Phil Spitler +Philip Alexander Etling Philip Monroe +Philipp Gillé Philipp Wahala Philipp Weissensteiner Phillip Alexander +phineas pidster Piergiuliano Bossi Pierre @@ -1201,22 +1574,28 @@ pixelistik Porjo Poul Kjeldager Sørensen Pradeep Chhetri +Pradip Dhara Prasanna Gautam +Pratik Karki Prayag Verma +Priya Wadhwa +Projjol Banerji Przemek Hejman +Pure White pysqz -qg <1373319223@qq.com> -qhuang Qiang Huang -qq690388648 <690388648@qq.com> +Qinglan Peng +qudongfang Quentin Brossard Quentin Perez Quentin Tayssier r0n22 +Radostin Stoyanov Rafal Jeczalik Rafe Colton Raghavendra K T Raghuram Devarakonda +Raja Sami Rajat Pandit Rajdeep Dua Ralf Sippl @@ -1225,15 +1604,19 @@ Ralph Bean Ramkumar Ramachandra Ramon Brooker Ramon van Alteren -Ray Tsang +RaviTeja Pothana +Ray Tsang ReadmeCritic Recursive Madman +Reficul Regan McCooey Remi Rampin +Remy Suen Renato Riccieri Santos Zannon -resouer -rgstephens +Renaud Gaubert Rhys Hiltner +Ri Xu +Ricardo N Feliciano Rich Moyse Rich Seymour Richard @@ -1251,17 +1634,22 @@ Riku Voipio Riley Guerin Ritesh H Shukla Riyaz Faizullabhoy +Rob Gulewich Rob Vesse Robert Bachmann Robert Bittle Robert Obryk +Robert Schneider Robert Stern -Robert Terhaar +Robert Terhaar Robert Wallis +Robert Wang Roberto G. Hashioka +Roberto Muñoz Fernández Robin Naundorf Robin Schneider Robin Speekenbrink +Robin Thoni robpc Rodolfo Carvalho Rodrigo Vaz @@ -1269,15 +1657,21 @@ Roel Van Nyen Roger Peppe Rohit Jnagal Rohit Kadam +Rohit Kapur +Rojin George Roland Huß Roland Kammerer Roland Moriz Roma Sokolov +Roman Dudin +Roman Mazur Roman Strashkin Ron Smits Ron Williams +Rong Gao +Rong Zhang +Rongxiang Song root -root root root root @@ -1285,23 +1679,33 @@ Rory Hunter Rory McCune Ross Boucher Rovanion Luckey +Royce Remer Rozhnov Alexandr -rsmoorthy Rudolph Gottesheim +Rui Cao Rui Lopes +Ruilin Li Runshen Zhu +Russ Magee +Ryan Abrams Ryan Anderson Ryan Aslett Ryan Belgrave Ryan Detzel Ryan Fowler +Ryan Liu Ryan McLaughlin Ryan O'Donnell Ryan Seto +Ryan Simmen +Ryan Stelly Ryan Thomas Ryan Trauntvein Ryan Wallner +Ryan Zhang +ryancooper7 RyanDeng +Ryo Nakao Rémy Greinhofer s. rannou s00318865 @@ -1309,7 +1713,8 @@ Sabin Basyal Sachin Joshi Sagar Hani Sainath Grandhi -sakeven +Sakeven Jiang +Salahuddin Khan Sally O'Malley Sam Abed Sam Alba @@ -1318,21 +1723,25 @@ Sam J Sharpe Sam Neirinck Sam Reis Sam Rijs +Sam Whited Sambuddha Basu Sami Wagiaalla Samuel Andaya Samuel Dion-Girardeau Samuel Karp Samuel PHAN +Sandeep Bansal Sankar சங்கர் Sanket Saurav Santhosh Manohar sapphiredev +Sargun Dhillon +Sascha Andres +Sascha Grunert +SataQiu Satnam Singh -satoru Satoshi Amemiya Satoshi Tagomori -scaleoutsean Scott Bessler Scott Collier Scott Johnston @@ -1341,8 +1750,11 @@ Scott Walls sdreyesg Sean Christopherson Sean Cronin +Sean Lee +Sean McIntyre Sean OMeara Sean P. Kane +Sean Rodman Sebastiaan van Steenis Sebastiaan van Stijn Senthil Kumar Selvaraj @@ -1352,36 +1764,50 @@ Seongyeol Lim Serge Hallyn Sergey Alekseev Sergey Evstifeev +Sergii Kabashniuk +Sergio Lopez Serhat Gülçiçek +SeungUkLee Sevki Hasirci Shane Canon Shane da Silva +Shaun Kaasten shaunol Shawn Landden Shawn Siefkas shawnhe +Shayne Wang Shekhar Gulati Sheng Yang Shengbo Song Shev Yan Shih-Yuan Lee Shijiang Wei +Shijun Qin Shishir Mahajan Shoubhik Bose Shourya Sarcar +Shu-Wai Chow shuai-z Shukui Yang Shuwei Hao Sian Lerk Lau +Sidhartha Mani sidharthamani Silas Sewell +Silvan Jegen +Simão Reis Simei He +Simon Barendse Simon Eskildsen +Simon Ferquel Simon Leinen +Simon Menke Simon Taranto +Simon Vikstrom Sindhu S Sjoerd Langkemper -skaasten +skanehira Solganik Alexander Solomon Hykes Song Gao @@ -1392,47 +1818,64 @@ Spencer Smith Sridatta Thatipamala Sridhar Ratnakumar Srini Brahmaroutu -srinsriv +Srinivasan Srivatsan +Staf Wagemakers +Stanislav Bondarenko +Stanislav Levin Steeve Morin Stefan Berger Stefan J. Wernli Stefan Praszalowicz -Stefan Scherer +Stefan S. +Stefan Scherer Stefan Staudenmeyer Stefan Weil +Stephan Spindler +Stephen Benjamin Stephen Crosby -Stephen Day +Stephen Day Stephen Drake Stephen Rust +Steve Desmond +Steve Dougherty Steve Durrheimer Steve Francia Steve Koch Steven Burgess Steven Erenst +Steven Hartland Steven Iveson Steven Merrill Steven Richards Steven Taylor +Stig Larsson Subhajit Ghosh Sujith Haridasan +Sun Gengze <690388648@qq.com> +Sun Jianbo +Sune Keller +Sunny Gogoi Suryakumar Sudar Sven Dowideit Swapnil Daingade Sylvain Baubeau Sylvain Bellemare Sébastien +Sébastien HOUZÉ Sébastien Luttringer Sébastien Stormacq +Tabakhase Tadej Janež TAGOMORI Satoshi tang0th -Tangi COLIN +Tangi Colin Tatsuki Sugiura Tatsushi Inagaki +Taylan Isikdemir Taylor Jones -tbonza Ted M. Young Tehmasp Chaudhri +Tejaswini Duggaraju Tejesh Mehta terryding77 <550147740@qq.com> tgic @@ -1447,7 +1890,7 @@ Thomas Gazagnaire Thomas Grainger Thomas Hansen Thomas Leonard -Thomas LEVEIL +Thomas Léveil Thomas Orozco Thomas Riccardi Thomas Schroeter @@ -1455,21 +1898,27 @@ Thomas Sjögren Thomas Swift Thomas Tanaka Thomas Texier +Ti Zhou Tianon Gravi Tianyi Wang Tibor Vass Tiffany Jernigan Tiffany Low +Till Wegmüller +Tim +Tim Bart Tim Bosse Tim Dettrick Tim Düsterhus Tim Hockin +Tim Potter Tim Ruffles Tim Smith Tim Terhorst Tim Wang Tim Waugh Tim Wraight +Tim Zju <21651152@zju.edu.cn> timfeirg Timothy Hobbs tjwebb123 @@ -1486,11 +1935,14 @@ Todd Lunter Todd Whiteman Toli Kuznets Tom Barlow +Tom Booth Tom Denham Tom Fotherby Tom Howe Tom Hulihan Tom Maaswinkel +Tom Sweeney +Tom Wilkie Tom X. Tobin Tomas Tomecek Tomasz Kopczynski @@ -1498,31 +1950,38 @@ Tomasz Lipinski Tomasz Nurkiewicz Tommaso Visconti Tomáš Hrčka -Tonis Tiigi Tonny Xu +Tony Abboud Tony Daws Tony Miller toogley Torstein Husebø -tpng +Tõnis Tiigi +Trace Andreason tracylihui <793912329@qq.com> +Trapier Marshall Travis Cline Travis Thieman Trent Ogren Trevor Trevor Pounds -trishnaguha +Trevor Sullivan +Trishna Guha Tristan Carel Troy Denton +Tycho Andersen Tyler Brock +Tyler Brown Tzu-Jung Lee -Tõnis Tiigi +uhayate Ulysse Carion -unknown +Umesh Yadav +Utz Bacher vagrant Vaidas Jablonskis +vanderliang +Velko Ivanov Veres Lajos -vgeta Victor Algaze Victor Coisne Victor Costan @@ -1533,19 +1992,21 @@ Victor Palma Victor Vieux Victoria Bialas Vijaya Kumar K +Vikram bir Singh Viktor Stanchev Viktor Vojnovski VinayRaghavanKS Vincent Batts -Vincent Bernat Vincent Bernat -Vincent Demeester +Vincent Boulineau +Vincent Demeester Vincent Giersch Vincent Mayers Vincent Woo Vinod Kulkarni Vishal Doshi Vishnu Kannan +Vitaly Ostrosablin Vitor Monteiro Vivek Agarwal Vivek Dasgupta @@ -1556,24 +2017,44 @@ Vladimir Pouzanov Vladimir Rutsky Vladimir Varankin VladimirAus +Vlastimil Zeman Vojtech Vitek (V-Teq) waitingkuo Walter Leibbrandt Walter Stanish -WANG Chao +Wang Chao +Wang Guoliang +Wang Jie +Wang Long +Wang Ping Wang Xing +Wang Yuexiao +Wang Yumu <37442693@qq.com> +wanghuaiqing Ward Vandewege WarheadsSE +Wassim Dhif Wayne Chang +Wayne Song +Weerasak Chongnguluam +Wei Fu +Wei Wu Wei-Ting Kuo +weipeng weiyan Weiyang Zhu Wen Cheng Ma Wendel Fleming +Wenjun Tang Wenkai Yin +wenlxie +Wentao Zhang Wenxuan Zhao Wenyu You <21551128@zju.edu.cn> +Wenzhi Liang Wes Morgan +Wewang Xiaorenfine +Wiktor Kwapisiewicz Will Dietz Will Rouesnel Will Weaver @@ -1581,49 +2062,77 @@ willhf William Delanoue William Henry William Hubbs +William Martin William Riancho William Thurston +Wilson Júnior +Wing-Kam Wong WiseTrem -wlan0 Wolfgang Powisch -wonderflow Wonjun Kim xamyzhao +Xian Chaobo +Xianglin Gao Xianlu Bird +Xiao YongBiao XiaoBing Jiang +Xiaodong Liu +Xiaodong Zhang +Xiaoxi He Xiaoxu Chen +Xiaoyu Zhang +xichengliudui <1693291525@qq.com> xiekeyang +Ximo Guanter Gonzálbez +Xinbo Weng +Xinfeng Liu Xinzi Zhou Xiuming Chen -xlgao-zju +Xuecong Liao xuzhaokui +Yadnyawalkya Tale Yahya YAMADA Tsuyoshi +Yamasaki Masahide Yan Feng Yang Bai -yangshukui +Yang Pengfei +yangchenliang Yanqiang Miao +Yao Zaiyong +Yash Murty +Yassine Tijani Yasunori Mahata +Yazhong Liu Yestin Sun Yi EungJun Yibai Zhang Yihang Ho -Ying Li +Ying Li Yohei Ueda Yong Tang +Yongxin Li Yongzhi Pan -yorkie +Yosef Fertel +You-Sheng Yang (楊有勝) +youcai Youcef YEKHLEF +Yu Changchun +Yu Chengxia +Yu Peng +Yu-Ju Hong Yuan Sun -yuchangchun -yuchengxia -yuexiao-wang -YuPengZTE +Yuanhong Peng +Yue Zhang +Yuhao Fang +Yuichiro Kaneko +Yunxiang Huang Yurii Rashkovskii -yuzou +Yusuf Tarık Günaydın +Yves Junqueira Zac Dover Zach Borboa -Zachary Jaffee +Zachary Jaffee Zain Memon Zaiste! Zane DeGraffenried @@ -1632,21 +2141,35 @@ Zen Lin(Zhinan Lin) Zhang Kun Zhang Wei Zhang Wentao +ZhangHang +zhangxianwei Zhenan Ye <21551168@zju.edu.cn> -zhouhao +zhenghenghuo +Zhenhai Gao +Zhenkun Bi +zhipengzuo +Zhou Hao +Zhoulin Xie Zhu Guihua +Zhu Kunjia Zhuoyun Wei +Ziheng Liu Zilin Du zimbatm Ziming Dong ZJUshuaizhou <21551191@zju.edu.cn> zmarouf Zoltan Tombol +Zou Yu zqh -Zuhayr Elahi +Zuhayr Elahi Zunayed Ali Álex González Álvaro Lázaro Átila Camurça Alves 尹吉峰 +屈骏 +徐俊杰 +慕陶 搏通 +黄艳红00139573 diff --git a/vendor/github.com/docker/docker/LICENSE b/vendor/github.com/docker/docker/LICENSE index 8f3fee627a..6d8d58fb67 100644 --- a/vendor/github.com/docker/docker/LICENSE +++ b/vendor/github.com/docker/docker/LICENSE @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2013-2016 Docker, Inc. + Copyright 2013-2018 Docker, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/github.com/docker/docker/NOTICE b/vendor/github.com/docker/docker/NOTICE index 8a37c1c7bc..58b19b6d15 100644 --- a/vendor/github.com/docker/docker/NOTICE +++ b/vendor/github.com/docker/docker/NOTICE @@ -1,9 +1,9 @@ Docker -Copyright 2012-2016 Docker, Inc. +Copyright 2012-2017 Docker, Inc. This product includes software developed at Docker, Inc. (https://www.docker.com). -This product contains software (https://github.com/kr/pty) developed +This product contains software (https://github.com/creack/pty) developed by Keith Rarick, licensed under the MIT License. The following is courtesy of our legal counsel: diff --git a/vendor/github.com/docker/docker/pkg/namesgenerator/names-generator.go b/vendor/github.com/docker/docker/pkg/namesgenerator/names-generator.go index cfb8157d69..2dfb66af03 100644 --- a/vendor/github.com/docker/docker/pkg/namesgenerator/names-generator.go +++ b/vendor/github.com/docker/docker/pkg/namesgenerator/names-generator.go @@ -1,9 +1,8 @@ -package namesgenerator +package namesgenerator // import "github.com/docker/docker/pkg/namesgenerator" import ( "fmt" - - "github.com/docker/docker/pkg/random" + "math/rand" ) var ( @@ -15,16 +14,21 @@ var ( "amazing", "angry", "awesome", + "beautiful", "blissful", + "bold", "boring", "brave", + "busy", + "charming", "clever", - "cocky", + "cool", "compassionate", "competent", "condescending", "confident", "cranky", + "crazy", "dazzling", "determined", "distracted", @@ -36,16 +40,19 @@ var ( "elegant", "eloquent", "epic", + "exciting", "fervent", "festive", "flamboyant", "focused", "friendly", "frosty", + "funny", "gallant", "gifted", "goofy", "gracious", + "great", "happy", "hardcore", "heuristic", @@ -53,19 +60,22 @@ var ( "hungry", "infallible", "inspiring", + "interesting", + "intelligent", "jolly", "jovial", "keen", - "kickass", "kind", "laughing", "loving", "lucid", + "magical", "mystifying", "modest", "musing", "naughty", "nervous", + "nice", "nifty", "nostalgic", "objective", @@ -77,6 +87,7 @@ var ( "priceless", "quirky", "quizzical", + "recursing", "relaxed", "reverent", "romantic", @@ -86,8 +97,10 @@ var ( "silly", "sleepy", "stoic", + "strange", "stupefied", "suspicious", + "sweet", "tender", "thirsty", "trusting", @@ -95,6 +108,7 @@ var ( "upbeat", "vibrant", "vigilant", + "vigorous", "wizardly", "wonderful", "xenodochial", @@ -115,6 +129,9 @@ var ( // June Almeida - Scottish virologist who took the first pictures of the rubella virus - https://en.wikipedia.org/wiki/June_Almeida "almeida", + // Kathleen Antonelli, American computer programmer and one of the six original programmers of the ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli + "antonelli", + // Maria Gaetana Agnesi - Italian mathematician, philosopher, theologian and humanitarian. She was the first woman to write a mathematics handbook and the first woman appointed as a Mathematics Professor at a University. https://en.wikipedia.org/wiki/Maria_Gaetana_Agnesi "agnesi", @@ -136,6 +153,9 @@ var ( // Stefan Banach - Polish mathematician, was one of the founders of modern functional analysis. https://en.wikipedia.org/wiki/Stefan_Banach "banach", + // Buckaroo Banzai and his mentor Dr. Hikita perfected the "oscillation overthruster", a device that allows one to pass through solid matter. - https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension + "banzai", + // John Bardeen co-invented the transistor - https://en.wikipedia.org/wiki/John_Bardeen "bardeen", @@ -151,12 +171,21 @@ var ( // Alexander Graham Bell - an eminent Scottish-born scientist, inventor, engineer and innovator who is credited with inventing the first practical telephone - https://en.wikipedia.org/wiki/Alexander_Graham_Bell "bell", + // Karl Friedrich Benz - a German automobile engineer. Inventor of the first practical motorcar. https://en.wikipedia.org/wiki/Karl_Benz + "benz", + // Homi J Bhabha - was an Indian nuclear physicist, founding director, and professor of physics at the Tata Institute of Fundamental Research. Colloquially known as "father of Indian nuclear programme"- https://en.wikipedia.org/wiki/Homi_J._Bhabha "bhabha", // Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millennium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus "bhaskara", + // Sue Black - British computer scientist and campaigner. She has been instrumental in saving Bletchley Park, the site of World War II codebreaking - https://en.wikipedia.org/wiki/Sue_Black_(computer_scientist) + "black", + + // Elizabeth Helen Blackburn - Australian-American Nobel laureate; best known for co-discovering telomerase. https://en.wikipedia.org/wiki/Elizabeth_Blackburn + "blackburn", + // Elizabeth Blackwell - American doctor and first American woman to receive a medical degree - https://en.wikipedia.org/wiki/Elizabeth_Blackwell "blackwell", @@ -172,6 +201,9 @@ var ( // Satyendra Nath Bose - He provided the foundation for Bose–Einstein statistics and the theory of the Bose–Einstein condensate. - https://en.wikipedia.org/wiki/Satyendra_Nath_Bose "bose", + // Katherine Louise Bouman is an imaging scientist and Assistant Professor of Computer Science at the California Institute of Technology. She researches computational methods for imaging, and developed an algorithm that made possible the picture first visualization of a black hole using the Event Horizon Telescope. - https://en.wikipedia.org/wiki/Katie_Bouman + "bouman", + // Evelyn Boyd Granville - She was one of the first African-American woman to receive a Ph.D. in mathematics; she earned it in 1949 from Yale University. https://en.wikipedia.org/wiki/Evelyn_Boyd_Granville "boyd", @@ -184,14 +216,47 @@ var ( // Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff) "brown", + // Linda Brown Buck - American biologist and Nobel laureate best known for her genetic and molecular analyses of the mechanisms of smell. https://en.wikipedia.org/wiki/Linda_B._Buck + "buck", + + // Dame Susan Jocelyn Bell Burnell - Northern Irish astrophysicist who discovered radio pulsars and was the first to analyse them. https://en.wikipedia.org/wiki/Jocelyn_Bell_Burnell + "burnell", + + // Annie Jump Cannon - pioneering female astronomer who classified hundreds of thousands of stars and created the system we use to understand stars today. https://en.wikipedia.org/wiki/Annie_Jump_Cannon + "cannon", + // Rachel Carson - American marine biologist and conservationist, her book Silent Spring and other writings are credited with advancing the global environmental movement. https://en.wikipedia.org/wiki/Rachel_Carson "carson", + // Dame Mary Lucy Cartwright - British mathematician who was one of the first to study what is now known as chaos theory. Also known for Cartwright's theorem which finds applications in signal processing. https://en.wikipedia.org/wiki/Mary_Cartwright + "cartwright", + + // George Washington Carver - American agricultural scientist and inventor. He was the most prominent black scientist of the early 20th century. https://en.wikipedia.org/wiki/George_Washington_Carver + "carver", + + // Vinton Gray Cerf - American Internet pioneer, recognised as one of "the fathers of the Internet". With Robert Elliot Kahn, he designed TCP and IP, the primary data communication protocols of the Internet and other computer networks. https://en.wikipedia.org/wiki/Vint_Cerf + "cerf", + // Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar "chandrasekhar", - //Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon) - "shannon", + // Sergey Alexeyevich Chaplygin (Russian: Серге́й Алексе́евич Чаплы́гин; April 5, 1869 – October 8, 1942) was a Russian and Soviet physicist, mathematician, and mechanical engineer. He is known for mathematical formulas such as Chaplygin's equation and for a hypothetical substance in cosmology called Chaplygin gas, named after him. https://en.wikipedia.org/wiki/Sergey_Chaplygin + "chaplygin", + + // Émilie du Châtelet - French natural philosopher, mathematician, physicist, and author during the early 1730s, known for her translation of and commentary on Isaac Newton's book Principia containing basic laws of physics. https://en.wikipedia.org/wiki/%C3%89milie_du_Ch%C3%A2telet + "chatelet", + + // Asima Chatterjee was an Indian organic chemist noted for her research on vinca alkaloids, development of drugs for treatment of epilepsy and malaria - https://en.wikipedia.org/wiki/Asima_Chatterjee + "chatterjee", + + // Pafnuty Chebyshev - Russian mathematician. He is known fo his works on probability, statistics, mechanics, analytical geometry and number theory https://en.wikipedia.org/wiki/Pafnuty_Chebyshev + "chebyshev", + + // Bram Cohen - American computer programmer and author of the BitTorrent peer-to-peer protocol. https://en.wikipedia.org/wiki/Bram_Cohen + "cohen", + + // David Lee Chaum - American computer scientist and cryptographer. Known for his seminal contributions in the field of anonymous communication. https://en.wikipedia.org/wiki/David_Chaum + "chaum", // Joan Clarke - Bletchley Park code breaker during the Second World War who pioneered techniques that remained top secret for decades. Also an accomplished numismatist https://en.wikipedia.org/wiki/Joan_Clarke "clarke", @@ -219,9 +284,24 @@ var ( // Leonardo Da Vinci invented too many things to list here. https://en.wikipedia.org/wiki/Leonardo_da_Vinci. "davinci", + // A. K. (Alexander Keewatin) Dewdney, Canadian mathematician, computer scientist, author and filmmaker. Contributor to Scientific American's "Computer Recreations" from 1984 to 1991. Author of Core War (program), The Planiverse, The Armchair Universe, The Magic Machine, The New Turing Omnibus, and more. https://en.wikipedia.org/wiki/Alexander_Dewdney + "dewdney", + + // Satish Dhawan - Indian mathematician and aerospace engineer, known for leading the successful and indigenous development of the Indian space programme. https://en.wikipedia.org/wiki/Satish_Dhawan + "dhawan", + + // Bailey Whitfield Diffie - American cryptographer and one of the pioneers of public-key cryptography. https://en.wikipedia.org/wiki/Whitfield_Diffie + "diffie", + // Edsger Wybe Dijkstra was a Dutch computer scientist and mathematical scientist. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra. "dijkstra", + // Paul Adrien Maurice Dirac - English theoretical physicist who made fundamental contributions to the early development of both quantum mechanics and quantum electrodynamics. https://en.wikipedia.org/wiki/Paul_Dirac + "dirac", + + // Agnes Meyer Driscoll - American cryptanalyst during World Wars I and II who successfully cryptanalysed a number of Japanese ciphers. She was also the co-developer of one of the cipher machines of the US Navy, the CM. https://en.wikipedia.org/wiki/Agnes_Meyer_Driscoll + "driscoll", + // Donna Dubinsky - played an integral role in the development of personal digital assistants (PDAs) serving as CEO of Palm, Inc. and co-founding Handspring. https://en.wikipedia.org/wiki/Donna_Dubinsky "dubinsky", @@ -234,9 +314,18 @@ var ( // Albert Einstein invented the general theory of relativity. https://en.wikipedia.org/wiki/Albert_Einstein "einstein", + // Alexandra Asanovna Elbakyan (Russian: Алекса́ндра Аса́новна Элбакя́н) is a Kazakhstani graduate student, computer programmer, internet pirate in hiding, and the creator of the site Sci-Hub. Nature has listed her in 2016 in the top ten people that mattered in science, and Ars Technica has compared her to Aaron Swartz. - https://en.wikipedia.org/wiki/Alexandra_Elbakyan + "elbakyan", + + // Taher A. ElGamal - Egyptian cryptographer best known for the ElGamal discrete log cryptosystem and the ElGamal digital signature scheme. https://en.wikipedia.org/wiki/Taher_Elgamal + "elgamal", + // Gertrude Elion - American biochemist, pharmacologist and the 1988 recipient of the Nobel Prize in Medicine - https://en.wikipedia.org/wiki/Gertrude_Elion "elion", + // James Henry Ellis - British engineer and cryptographer employed by the GCHQ. Best known for conceiving for the first time, the idea of public-key cryptography. https://en.wikipedia.org/wiki/James_H._Ellis + "ellis", + // Douglas Engelbart gave the mother of all demos: https://en.wikipedia.org/wiki/Douglas_Engelbart "engelbart", @@ -246,6 +335,12 @@ var ( // Leonhard Euler invented large parts of modern mathematics. https://de.wikipedia.org/wiki/Leonhard_Euler "euler", + // Michael Faraday - British scientist who contributed to the study of electromagnetism and electrochemistry. https://en.wikipedia.org/wiki/Michael_Faraday + "faraday", + + // Horst Feistel - German-born American cryptographer who was one of the earliest non-government researchers to study the design and theory of block ciphers. Co-developer of DES and Lucifer. Feistel networks, a symmetric structure used in the construction of block ciphers are named after him. https://en.wikipedia.org/wiki/Horst_Feistel + "feistel", + // Pierre de Fermat pioneered several aspects of modern mathematics. https://en.wikipedia.org/wiki/Pierre_de_Fermat "fermat", @@ -258,12 +353,27 @@ var ( // Benjamin Franklin is famous for his experiments in electricity and the invention of the lightning rod. "franklin", + // Yuri Alekseyevich Gagarin - Soviet pilot and cosmonaut, best known as the first human to journey into outer space. https://en.wikipedia.org/wiki/Yuri_Gagarin + "gagarin", + // Galileo was a founding father of modern astronomy, and faced politics and obscurantism to establish scientific truth. https://en.wikipedia.org/wiki/Galileo_Galilei "galileo", + // Évariste Galois - French mathematician whose work laid the foundations of Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections, all while still in his late teens. https://en.wikipedia.org/wiki/%C3%89variste_Galois + "galois", + + // Kadambini Ganguly - Indian physician, known for being the first South Asian female physician, trained in western medicine, to graduate in South Asia. https://en.wikipedia.org/wiki/Kadambini_Ganguly + "ganguly", + // William Henry "Bill" Gates III is an American business magnate, philanthropist, investor, computer programmer, and inventor. https://en.wikipedia.org/wiki/Bill_Gates "gates", + // Johann Carl Friedrich Gauss - German mathematician who made significant contributions to many fields, including number theory, algebra, statistics, analysis, differential geometry, geodesy, geophysics, mechanics, electrostatics, magnetic fields, astronomy, matrix theory, and optics. https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss + "gauss", + + // Marie-Sophie Germain - French mathematician, physicist and philosopher. Known for her work on elasticity theory, number theory and philosophy. https://en.wikipedia.org/wiki/Sophie_Germain + "germain", + // Adele Goldberg, was one of the designers and developers of the Smalltalk language. https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist) "goldberg", @@ -279,24 +389,51 @@ var ( // Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall "goodall", + // Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould + "gould", + + // Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider + "greider", + + // Alexander Grothendieck - German-born French mathematician who became a leading figure in the creation of modern algebraic geometry. https://en.wikipedia.org/wiki/Alexander_Grothendieck + "grothendieck", + // Lois Haibt - American computer scientist, part of the team at IBM that developed FORTRAN - https://en.wikipedia.org/wiki/Lois_Haibt "haibt", // Margaret Hamilton - Director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for the Apollo space program. https://en.wikipedia.org/wiki/Margaret_Hamilton_(scientist) "hamilton", + // Caroline Harriet Haslett - English electrical engineer, electricity industry administrator and champion of women's rights. Co-author of British Standard 1363 that specifies AC power plugs and sockets used across the United Kingdom (which is widely considered as one of the safest designs). https://en.wikipedia.org/wiki/Caroline_Haslett + "haslett", + // Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. https://en.wikipedia.org/wiki/Stephen_Hawking "hawking", + // Martin Edward Hellman - American cryptologist, best known for his invention of public-key cryptography in co-operation with Whitfield Diffie and Ralph Merkle. https://en.wikipedia.org/wiki/Martin_Hellman + "hellman", + // Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg "heisenberg", + // Grete Hermann was a German philosopher noted for her philosophical work on the foundations of quantum mechanics. https://en.wikipedia.org/wiki/Grete_Hermann + "hermann", + + // Caroline Lucretia Herschel - German astronomer and discoverer of several comets. https://en.wikipedia.org/wiki/Caroline_Herschel + "herschel", + + // Heinrich Rudolf Hertz - German physicist who first conclusively proved the existence of the electromagnetic waves. https://en.wikipedia.org/wiki/Heinrich_Hertz + "hertz", + // Jaroslav Heyrovský was the inventor of the polarographic method, father of the electroanalytical method, and recipient of the Nobel Prize in 1959. His main field of work was polarography. https://en.wikipedia.org/wiki/Jaroslav_Heyrovsk%C3%BD "heyrovsky", // Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin "hodgkin", + // Douglas R. Hofstadter is an American professor of cognitive science and author of the Pulitzer Prize and American Book Award-winning work Goedel, Escher, Bach: An Eternal Golden Braid in 1979. A mind-bending work which coined Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's Law." https://en.wikipedia.org/wiki/Douglas_Hofstadter + "hofstadter", + // Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephone switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover "hoover", @@ -309,15 +446,27 @@ var ( // Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia "hypatia", + // Teruko Ishizaka - Japanese scientist and immunologist who co-discovered the antibody class Immunoglobulin E. https://en.wikipedia.org/wiki/Teruko_Ishizaka + "ishizaka", + + // Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/Mary_Jackson_(engineer) + "jackson", + // Yeong-Sil Jang was a Korean scientist and astronomer during the Joseon Dynasty; he invented the first metal printing press and water gauge. https://en.wikipedia.org/wiki/Jang_Yeong-sil "jang", + // Mae Carol Jemison - is an American engineer, physician, and former NASA astronaut. She became the first black woman to travel in space when she served as a mission specialist aboard the Space Shuttle Endeavour - https://en.wikipedia.org/wiki/Mae_Jemison + "jemison", + // Betty Jennings - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Jean_Bartik "jennings", // Mary Lou Jepsen, was the founder and chief technology officer of One Laptop Per Child (OLPC), and the founder of Pixel Qi. https://en.wikipedia.org/wiki/Mary_Lou_Jepsen "jepsen", + // Katherine Coleman Goble Johnson - American physicist and mathematician contributed to the NASA. https://en.wikipedia.org/wiki/Katherine_Johnson + "johnson", + // Irène Joliot-Curie - French scientist who was awarded the Nobel Prize for Chemistry in 1935. Daughter of Marie and Pierre Curie. https://en.wikipedia.org/wiki/Ir%C3%A8ne_Joliot-Curie "joliot", @@ -327,16 +476,28 @@ var ( // A. P. J. Abdul Kalam - is an Indian scientist aka Missile Man of India for his work on the development of ballistic missile and launch vehicle technology - https://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam "kalam", + // Sergey Petrovich Kapitsa (Russian: Серге́й Петро́вич Капи́ца; 14 February 1928 – 14 August 2012) was a Russian physicist and demographer. He was best known as host of the popular and long-running Russian scientific TV show, Evident, but Incredible. His father was the Nobel laureate Soviet-era physicist Pyotr Kapitsa, and his brother was the geographer and Antarctic explorer Andrey Kapitsa. - https://en.wikipedia.org/wiki/Sergey_Kapitsa + "kapitsa", + // Susan Kare, created the icons and many of the interface elements for the original Apple Macintosh in the 1980s, and was an original employee of NeXT, working as the Creative Director. https://en.wikipedia.org/wiki/Susan_Kare "kare", + // Mstislav Keldysh - a Soviet scientist in the field of mathematics and mechanics, academician of the USSR Academy of Sciences (1946), President of the USSR Academy of Sciences (1961–1975), three times Hero of Socialist Labor (1956, 1961, 1971), fellow of the Royal Society of Edinburgh (1968). https://en.wikipedia.org/wiki/Mstislav_Keldysh + "keldysh", + // Mary Kenneth Keller, Sister Mary Kenneth Keller became the first American woman to earn a PhD in Computer Science in 1965. https://en.wikipedia.org/wiki/Mary_Kenneth_Keller "keller", + // Johannes Kepler, German astronomer known for his three laws of planetary motion - https://en.wikipedia.org/wiki/Johannes_Kepler + "kepler", + + // Omar Khayyam - Persian mathematician, astronomer and poet. Known for his work on the classification and solution of cubic equations, for his contribution to the understanding of Euclid's fifth postulate and for computing the length of a year very accurately. https://en.wikipedia.org/wiki/Omar_Khayyam + "khayyam", + // Har Gobind Khorana - Indian-American biochemist who shared the 1968 Nobel Prize for Physiology - https://en.wikipedia.org/wiki/Har_Gobind_Khorana "khorana", - // Jack Kilby invented silicone integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Jack_Kilby + // Jack Kilby invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Jack_Kilby "kilby", // Maria Kirch - German astronomer and first woman to discover a comet - https://en.wikipedia.org/wiki/Maria_Margarethe_Kirch @@ -360,10 +521,16 @@ var ( // Mary Leakey - British paleoanthropologist who discovered the first fossilized Proconsul skull - https://en.wikipedia.org/wiki/Mary_Leakey "leakey", - // Henrietta Swan Leavitt - she was an American astronomer who discovered the relation between the luminosity and the period of Cepheid variable stars. https://en.wikipedia.org/wiki/Henrietta_Swan_Leavitt + // Henrietta Swan Leavitt - she was an American astronomer who discovered the relation between the luminosity and the period of Cepheid variable stars. https://en.wikipedia.org/wiki/Henrietta_Swan_Leavitt "leavitt", - //Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin + // Esther Miriam Zimmer Lederberg - American microbiologist and a pioneer of bacterial genetics. https://en.wikipedia.org/wiki/Esther_Lederberg + "lederberg", + + // Inge Lehmann - Danish seismologist and geophysicist. Known for discovering in 1936 that the Earth has a solid inner core inside a molten outer core. https://en.wikipedia.org/wiki/Inge_Lehmann + "lehmann", + + // Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin "lewin", // Ruth Lichterman - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Ruth_Teitelbaum @@ -381,6 +548,15 @@ var ( // Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician) "mahavira", + // Lynn Margulis (b. Lynn Petra Alexander) - an American evolutionary theorist and biologist, science author, educator, and popularizer, and was the primary modern proponent for the significance of symbiosis in evolution. - https://en.wikipedia.org/wiki/Lynn_Margulis + "margulis", + + // Yukihiro Matsumoto - Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language. https://en.wikipedia.org/wiki/Yukihiro_Matsumoto + "matsumoto", + + // James Clerk Maxwell - Scottish physicist, best known for his formulation of electromagnetic theory. https://en.wikipedia.org/wiki/James_Clerk_Maxwell + "maxwell", + // Maria Mayer - American theoretical physicist and Nobel laureate in Physics for proposing the nuclear shell model of the atomic nucleus - https://en.wikipedia.org/wiki/Maria_Mayer "mayer", @@ -390,33 +566,57 @@ var ( // Barbara McClintock - a distinguished American cytogeneticist, 1983 Nobel Laureate in Physiology or Medicine for discovering transposons. https://en.wikipedia.org/wiki/Barbara_McClintock "mcclintock", + // Anne Laura Dorinthea McLaren - British developmental biologist whose work helped lead to human in-vitro fertilisation. https://en.wikipedia.org/wiki/Anne_McLaren + "mclaren", + // Malcolm McLean invented the modern shipping container: https://en.wikipedia.org/wiki/Malcom_McLean "mclean", // Kay McNulty - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli "mcnulty", + // Gregor Johann Mendel - Czech scientist and founder of genetics. https://en.wikipedia.org/wiki/Gregor_Mendel + "mendel", + + // Dmitri Mendeleev - a chemist and inventor. He formulated the Periodic Law, created a farsighted version of the periodic table of elements, and used it to correct the properties of some already discovered elements and also to predict the properties of eight elements yet to be discovered. https://en.wikipedia.org/wiki/Dmitri_Mendeleev + "mendeleev", + // Lise Meitner - Austrian/Swedish physicist who was involved in the discovery of nuclear fission. The element meitnerium is named after her - https://en.wikipedia.org/wiki/Lise_Meitner "meitner", // Carla Meninsky, was the game designer and programmer for Atari 2600 games Dodge 'Em and Warlords. https://en.wikipedia.org/wiki/Carla_Meninsky "meninsky", + // Ralph C. Merkle - American computer scientist, known for devising Merkle's puzzles - one of the very first schemes for public-key cryptography. Also, inventor of Merkle trees and co-inventor of the Merkle-Damgård construction for building collision-resistant cryptographic hash functions and the Merkle-Hellman knapsack cryptosystem. https://en.wikipedia.org/wiki/Ralph_Merkle + "merkle", + // Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf "mestorf", - // Marvin Minsky - Pioneer in Artificial Intelligence, co-founder of the MIT's AI Lab, won the Turing Award in 1969. https://en.wikipedia.org/wiki/Marvin_Minsky - "minsky", - // Maryam Mirzakhani - an Iranian mathematician and the first woman to win the Fields Medal. https://en.wikipedia.org/wiki/Maryam_Mirzakhani "mirzakhani", + // Gordon Earle Moore - American engineer, Silicon Valley founding father, author of Moore's law. https://en.wikipedia.org/wiki/Gordon_Moore + "moore", + // Samuel Morse - contributed to the invention of a single-wire telegraph system based on European telegraphs and was a co-developer of the Morse code - https://en.wikipedia.org/wiki/Samuel_Morse "morse", // Ian Murdock - founder of the Debian project - https://en.wikipedia.org/wiki/Ian_Murdock "murdock", + // May-Britt Moser - Nobel prize winner neuroscientist who contributed to the discovery of grid cells in the brain. https://en.wikipedia.org/wiki/May-Britt_Moser + "moser", + + // John Napier of Merchiston - Scottish landowner known as an astronomer, mathematician and physicist. Best known for his discovery of logarithms. https://en.wikipedia.org/wiki/John_Napier + "napier", + + // John Forbes Nash, Jr. - American mathematician who made fundamental contributions to game theory, differential geometry, and the study of partial differential equations. https://en.wikipedia.org/wiki/John_Forbes_Nash_Jr. + "nash", + + // John von Neumann - todays computer architectures are based on the von Neumann architecture. https://en.wikipedia.org/wiki/Von_Neumann_architecture + "neumann", + // Isaac Newton invented classic mechanics and modern optics. https://en.wikipedia.org/wiki/Isaac_Newton "newton", @@ -432,7 +632,7 @@ var ( // Poppy Northcutt. Poppy Northcutt was the first woman to work as part of NASA’s Mission Control. http://www.businessinsider.com/poppy-northcutt-helped-apollo-astronauts-2014-12?op=1 "northcutt", - // Robert Noyce invented silicone integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Robert_Noyce + // Robert Noyce invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Robert_Noyce "noyce", // Panini - Ancient Indian linguist and grammarian from 4th century CE who worked on the world's first formal system - https://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini#Comparison_with_modern_formal_systems @@ -441,6 +641,9 @@ var ( // Ambroise Pare invented modern surgery. https://en.wikipedia.org/wiki/Ambroise_Par%C3%A9 "pare", + // Blaise Pascal, French mathematician, physicist, and inventor - https://en.wikipedia.org/wiki/Blaise_Pascal + "pascal", + // Louis Pasteur discovered vaccination, fermentation and pasteurization. https://en.wikipedia.org/wiki/Louis_Pasteur. "pasteur", @@ -459,6 +662,9 @@ var ( // Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras "poitras", + // Tat’yana Avenirovna Proskuriakova (Russian: Татья́на Авени́ровна Проскуряко́ва) (January 23 [O.S. January 10] 1909 – August 30, 1985) was a Russian-American Mayanist scholar and archaeologist who contributed significantly to the deciphering of Maya hieroglyphs, the writing system of the pre-Columbian Maya civilization of Mesoamerica. https://en.wikipedia.org/wiki/Tatiana_Proskouriakoff + "proskuriakova", + // Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy "ptolemy", @@ -477,18 +683,39 @@ var ( // Dennis Ritchie - co-creator of UNIX and the C programming language. - https://en.wikipedia.org/wiki/Dennis_Ritchie "ritchie", + // Ida Rhodes - American pioneer in computer programming, designed the first computer used for Social Security. https://en.wikipedia.org/wiki/Ida_Rhodes + "rhodes", + + // Julia Hall Bowman Robinson - American mathematician renowned for her contributions to the fields of computability theory and computational complexity theory. https://en.wikipedia.org/wiki/Julia_Robinson + "robinson", + // Wilhelm Conrad Röntgen - German physicist who was awarded the first Nobel Prize in Physics in 1901 for the discovery of X-rays (Röntgen rays). https://en.wikipedia.org/wiki/Wilhelm_R%C3%B6ntgen "roentgen", // Rosalind Franklin - British biophysicist and X-ray crystallographer whose research was critical to the understanding of DNA - https://en.wikipedia.org/wiki/Rosalind_Franklin "rosalind", + // Vera Rubin - American astronomer who pioneered work on galaxy rotation rates. https://en.wikipedia.org/wiki/Vera_Rubin + "rubin", + // Meghnad Saha - Indian astrophysicist best known for his development of the Saha equation, used to describe chemical and physical conditions in stars - https://en.wikipedia.org/wiki/Meghnad_Saha "saha", // Jean E. Sammet developed FORMAC, the first widely used computer language for symbolic manipulation of mathematical formulas. https://en.wikipedia.org/wiki/Jean_E._Sammet "sammet", + // Mildred Sanderson - American mathematician best known for Sanderson's theorem concerning modular invariants. https://en.wikipedia.org/wiki/Mildred_Sanderson + "sanderson", + + // Satoshi Nakamoto is the name used by the unknown person or group of people who developed bitcoin, authored the bitcoin white paper, and created and deployed bitcoin's original reference implementation. https://en.wikipedia.org/wiki/Satoshi_Nakamoto + "satoshi", + + // Adi Shamir - Israeli cryptographer whose numerous inventions and contributions to cryptography include the Ferge Fiat Shamir identification scheme, the Rivest Shamir Adleman (RSA) public-key cryptosystem, the Shamir's secret sharing scheme, the breaking of the Merkle-Hellman cryptosystem, the TWINKLE and TWIRL factoring devices and the discovery of differential cryptanalysis (with Eli Biham). https://en.wikipedia.org/wiki/Adi_Shamir + "shamir", + + // Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon) + "shannon", + // Carol Shaw - Originally an Atari employee, Carol Shaw is said to be the first female video game designer. https://en.wikipedia.org/wiki/Carol_Shaw_(video_game_designer) "shaw", @@ -498,21 +725,27 @@ var ( // William Shockley co-invented the transistor - https://en.wikipedia.org/wiki/William_Shockley "shockley", + // Lina Solomonovna Stern (or Shtern; Russian: Лина Соломоновна Штерн; 26 August 1878 – 7 March 1968) was a Soviet biochemist, physiologist and humanist whose medical discoveries saved thousands of lives at the fronts of World War II. She is best known for her pioneering work on blood–brain barrier, which she described as hemato-encephalic barrier in 1921. https://en.wikipedia.org/wiki/Lina_Stern + "shtern", + // Françoise Barré-Sinoussi - French virologist and Nobel Prize Laureate in Physiology or Medicine; her work was fundamental in identifying HIV as the cause of AIDS. https://en.wikipedia.org/wiki/Fran%C3%A7oise_Barr%C3%A9-Sinoussi "sinoussi", // Betty Snyder - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Betty_Holberton "snyder", + // Cynthia Solomon - Pioneer in the fields of artificial intelligence, computer science and educational computing. Known for creation of Logo, an educational programming language. https://en.wikipedia.org/wiki/Cynthia_Solomon + "solomon", + // Frances Spence - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Frances_Spence "spence", - // Richard Matthew Stallman - the founder of the Free Software movement, the GNU project, the Free Software Foundation, and the League for Programming Freedom. He also invented the concept of copyleft to protect the ideals of this movement, and enshrined this concept in the widely-used GPL (General Public License) for software. https://en.wikiquote.org/wiki/Richard_Stallman - "stallman", - // Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker "stonebraker", + // Ivan Edward Sutherland - American computer scientist and Internet pioneer, widely regarded as the father of computer graphics. https://en.wikipedia.org/wiki/Ivan_Sutherland + "sutherland", + // Janese Swanson (with others) developed the first of the Carmen Sandiego games. She went on to found Girl Tech. https://en.wikipedia.org/wiki/Janese_Swanson "swanson", @@ -522,36 +755,60 @@ var ( // Bertha Swirles was a theoretical physicist who made a number of contributions to early quantum theory. https://en.wikipedia.org/wiki/Bertha_Swirles "swirles", + // Helen Brooke Taussig - American cardiologist and founder of the field of paediatric cardiology. https://en.wikipedia.org/wiki/Helen_B._Taussig + "taussig", + + // Valentina Tereshkova is a Russian engineer, cosmonaut and politician. She was the first woman to fly to space in 1963. In 2013, at the age of 76, she offered to go on a one-way mission to Mars. https://en.wikipedia.org/wiki/Valentina_Tereshkova + "tereshkova", + // Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla "tesla", + // Marie Tharp - American geologist and oceanic cartographer who co-created the first scientific map of the Atlantic Ocean floor. Her work led to the acceptance of the theories of plate tectonics and continental drift. https://en.wikipedia.org/wiki/Marie_Tharp + "tharp", + // Ken Thompson - co-creator of UNIX and the C programming language - https://en.wikipedia.org/wiki/Ken_Thompson "thompson", // Linus Torvalds invented Linux and Git. https://en.wikipedia.org/wiki/Linus_Torvalds "torvalds", + // Youyou Tu - Chinese pharmaceutical chemist and educator known for discovering artemisinin and dihydroartemisinin, used to treat malaria, which has saved millions of lives. Joint winner of the 2015 Nobel Prize in Physiology or Medicine. https://en.wikipedia.org/wiki/Tu_Youyou + "tu", + // Alan Turing was a founding father of computer science. https://en.wikipedia.org/wiki/Alan_Turing. "turing", // Varahamihira - Ancient Indian mathematician who discovered trigonometric formulae during 505-587 CE - https://en.wikipedia.org/wiki/Var%C4%81hamihira#Contributions "varahamihira", + // Dorothy Vaughan was a NASA mathematician and computer programmer on the SCOUT launch vehicle program that put America's first satellites into space - https://en.wikipedia.org/wiki/Dorothy_Vaughan + "vaughan", + // Sir Mokshagundam Visvesvaraya - is a notable Indian engineer. He is a recipient of the Indian Republic's highest honour, the Bharat Ratna, in 1955. On his birthday, 15 September is celebrated as Engineer's Day in India in his memory - https://en.wikipedia.org/wiki/Visvesvaraya "visvesvaraya", // Christiane Nüsslein-Volhard - German biologist, won Nobel Prize in Physiology or Medicine in 1995 for research on the genetic control of embryonic development. https://en.wikipedia.org/wiki/Christiane_N%C3%BCsslein-Volhard "volhard", + // Cédric Villani - French mathematician, won Fields Medal, Fermat Prize and Poincaré Price for his work in differential geometry and statistical mechanics. https://en.wikipedia.org/wiki/C%C3%A9dric_Villani + "villani", + // Marlyn Wescoff - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Marlyn_Meltzer "wescoff", + // Sylvia B. Wilbur - British computer scientist who helped develop the ARPANET, was one of the first to exchange email in the UK and a leading researcher in computer-supported collaborative work. https://en.wikipedia.org/wiki/Sylvia_Wilbur + "wilbur", + // Andrew Wiles - Notable British mathematician who proved the enigmatic Fermat's Last Theorem - https://en.wikipedia.org/wiki/Andrew_Wiles "wiles", // Roberta Williams, did pioneering work in graphical adventure games for personal computers, particularly the King's Quest series. https://en.wikipedia.org/wiki/Roberta_Williams "williams", + // Malcolm John Williamson - British mathematician and cryptographer employed by the GCHQ. Developed in 1974 what is now known as Diffie-Hellman key exchange (Diffie and Hellman first published the scheme in 1976). https://en.wikipedia.org/wiki/Malcolm_J._Williamson + "williamson", + // Sophie Wilson designed the first Acorn Micro-Computer and the instruction set for ARM processors. https://en.wikipedia.org/wiki/Sophie_Wilson "wilson", @@ -564,11 +821,17 @@ var ( // The Wright brothers, Orville and Wilbur - credited with inventing and building the world's first successful airplane and making the first controlled, powered and sustained heavier-than-air human flight - https://en.wikipedia.org/wiki/Wright_brothers "wright", + // Chien-Shiung Wu - Chinese-American experimental physicist who made significant contributions to nuclear physics. https://en.wikipedia.org/wiki/Chien-Shiung_Wu + "wu", + // Rosalyn Sussman Yalow - Rosalyn Sussman Yalow was an American medical physicist, and a co-winner of the 1977 Nobel Prize in Physiology or Medicine for development of the radioimmunoassay technique. https://en.wikipedia.org/wiki/Rosalyn_Sussman_Yalow "yalow", // Ada Yonath - an Israeli crystallographer, the first woman from the Middle East to win a Nobel prize in the sciences. https://en.wikipedia.org/wiki/Ada_Yonath "yonath", + + // Nikolay Yegorovich Zhukovsky (Russian: Никола́й Его́рович Жуко́вский, January 17 1847 – March 17, 1921) was a Russian scientist, mathematician and engineer, and a founding father of modern aero- and hydrodynamics. Whereas contemporary scientists scoffed at the idea of human flight, Zhukovsky was the first to undertake the study of airflow. He is often called the Father of Russian Aviation. https://en.wikipedia.org/wiki/Nikolay_Yegorovich_Zhukovsky + "zhukovsky", } ) @@ -576,15 +839,14 @@ var ( // formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random // integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3` func GetRandomName(retry int) string { - rnd := random.Rand begin: - name := fmt.Sprintf("%s_%s", left[rnd.Intn(len(left))], right[rnd.Intn(len(right))]) + name := fmt.Sprintf("%s_%s", left[rand.Intn(len(left))], right[rand.Intn(len(right))]) if name == "boring_wozniak" /* Steve Wozniak is not boring */ { goto begin } if retry > 0 { - name = fmt.Sprintf("%s%d", name, rnd.Intn(10)) + name = fmt.Sprintf("%s%d", name, rand.Intn(10)) } return name } diff --git a/vendor/github.com/docker/docker/pkg/random/random.go b/vendor/github.com/docker/docker/pkg/random/random.go deleted file mode 100644 index 70de4d1304..0000000000 --- a/vendor/github.com/docker/docker/pkg/random/random.go +++ /dev/null @@ -1,71 +0,0 @@ -package random - -import ( - cryptorand "crypto/rand" - "io" - "math" - "math/big" - "math/rand" - "sync" - "time" -) - -// Rand is a global *rand.Rand instance, which initialized with NewSource() source. -var Rand = rand.New(NewSource()) - -// Reader is a global, shared instance of a pseudorandom bytes generator. -// It doesn't consume entropy. -var Reader io.Reader = &reader{rnd: Rand} - -// copypaste from standard math/rand -type lockedSource struct { - lk sync.Mutex - src rand.Source -} - -func (r *lockedSource) Int63() (n int64) { - r.lk.Lock() - n = r.src.Int63() - r.lk.Unlock() - return -} - -func (r *lockedSource) Seed(seed int64) { - r.lk.Lock() - r.src.Seed(seed) - r.lk.Unlock() -} - -// NewSource returns math/rand.Source safe for concurrent use and initialized -// with current unix-nano timestamp -func NewSource() rand.Source { - var seed int64 - if cryptoseed, err := cryptorand.Int(cryptorand.Reader, big.NewInt(math.MaxInt64)); err != nil { - // This should not happen, but worst-case fallback to time-based seed. - seed = time.Now().UnixNano() - } else { - seed = cryptoseed.Int64() - } - return &lockedSource{ - src: rand.NewSource(seed), - } -} - -type reader struct { - rnd *rand.Rand -} - -func (r *reader) Read(b []byte) (int, error) { - i := 0 - for { - val := r.rnd.Int63() - for val > 0 { - b[i] = byte(val) - i++ - if i == len(b) { - return i, nil - } - val >>= 8 - } - } -} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/LICENSE b/vendor/github.com/eclipse/paho.mqtt.golang/LICENSE index aa7cc810fa..9b9a9eb8b8 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/LICENSE +++ b/vendor/github.com/eclipse/paho.mqtt.golang/LICENSE @@ -1,87 +1,20 @@ -Eclipse Public License - v 1.0 +This project is dual licensed under the Eclipse Public License 1.0 and the +Eclipse Distribution License 1.0 as described in the epl-v10 and edl-v10 files. -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +The EDL is copied below in order to pass the pkg.go.dev license check (https://pkg.go.dev/license-policy). -1. DEFINITIONS +**** +Eclipse Distribution License - v 1.0 -"Contribution" means: +Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and +All rights reserved. -b) in the case of each subsequent Contributor: +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -i) changes to the Program, and + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -ii) additions to the Program; +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. \ No newline at end of file diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/README.md b/vendor/github.com/eclipse/paho.mqtt.golang/README.md index 81c7148e09..c1acf4e1e9 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/README.md +++ b/vendor/github.com/eclipse/paho.mqtt.golang/README.md @@ -1,32 +1,47 @@ -[![GoDoc](https://godoc.org/github.com/eclipse/paho.mqtt.golang?status.svg)](https://godoc.org/github.com/eclipse/paho.mqtt.golang) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/eclipse/paho.mqtt.golang)](https://pkg.go.dev/github.com/eclipse/paho.mqtt.golang) [![Go Report Card](https://goreportcard.com/badge/github.com/eclipse/paho.mqtt.golang)](https://goreportcard.com/report/github.com/eclipse/paho.mqtt.golang) Eclipse Paho MQTT Go client =========================== -This repository contains the source code for the [Eclipse Paho](http://eclipse.org/paho) MQTT Go client library. +This repository contains the source code for the [Eclipse Paho](https://eclipse.org/paho) MQTT 3.1/3.11 Go client library. -This code builds a library which enable applications to connect to an [MQTT](http://mqtt.org) broker to publish messages, and to subscribe to topics and receive published messages. +This code builds a library which enable applications to connect to an [MQTT](https://mqtt.org) broker to publish +messages, and to subscribe to topics and receive published messages. This library supports a fully asynchronous mode of operation. +A client supporting MQTT V5 is [also available](https://github.com/eclipse/paho.golang). Installation and Build ---------------------- -This client is designed to work with the standard Go tools, so installation is as easy as: +The process depends upon whether you are using [modules](https://golang.org/ref/mod) (recommended) or `GOPATH`. + +#### Modules + +If you are using [modules](https://blog.golang.org/using-go-modules) then `import "github.com/eclipse/paho.mqtt.golang"` +and start using it. The necessary packages will be download automatically when you run `go build`. + +Note that the latest release will be downloaded and changes may have been made since the release. If you have +encountered an issue, or wish to try the latest code for another reason, then run +`go get github.com/eclipse/paho.mqtt.golang@master` to get the latest commit. + +#### GOPATH + +Installation is as easy as: ``` go get github.com/eclipse/paho.mqtt.golang ``` -The client depends on Google's [websockets](https://godoc.org/golang.org/x/net/websocket) and [proxy](https://godoc.org/golang.org/x/net/proxy) package, -also easily installed with the commands: +The client depends on Google's [proxy](https://godoc.org/golang.org/x/net/proxy) package and the +[websockets](https://godoc.org/github.com/gorilla/websocket) package, also easily installed with the commands: ``` -go get golang.org/x/net/websocket +go get github.com/gorilla/websocket go get golang.org/x/net/proxy ``` @@ -35,27 +50,119 @@ Usage and API ------------- Detailed API documentation is available by using to godoc tool, or can be browsed online -using the [godoc.org](http://godoc.org/github.com/eclipse/paho.mqtt.golang) service. - -Make use of the library by importing it in your Go client source code. For example, -``` -import "github.com/eclipse/paho.mqtt.golang" -``` +using the [pkg.go.dev](https://pkg.go.dev/github.com/eclipse/paho.mqtt.golang) service. Samples are available in the `cmd` directory for reference. +Note: + +The library also supports using MQTT over websockets by using the `ws://` (unsecure) or `wss://` (secure) prefix in the +URI. If the client is running behind a corporate http/https proxy then the following environment variables `HTTP_PROXY`, +`HTTPS_PROXY` and `NO_PROXY` are taken into account when establishing the connection. -Runtime tracing +Troubleshooting --------------- -Tracing is enabled by assigning logs (from the Go log package) to the logging endpoints, ERROR, CRITICAL, WARN and DEBUG +If you are new to MQTT and your application is not working as expected reviewing the +[MQTT specification](https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html), which this library implements, +is a good first step. [MQTT.org](https://mqtt.org) has some [good resources](https://mqtt.org/getting-started/) that answer many +common questions. + +### Error Handling + +The asynchronous nature of this library makes it easy to forget to check for errors. Consider using a go routine to +log these: + +```go +t := client.Publish("topic", qos, retained, msg) +go func() { + _ = t.Wait() // Can also use '<-t.Done()' in releases > 1.2.0 + if t.Error() != nil { + log.Error(t.Error()) // Use your preferred logging technique (or just fmt.Printf) + } +}() +``` + +### Logging +If you are encountering issues then enabling logging, both within this library and on your broker, is a good way to +begin troubleshooting. This library can produce various levels of log by assigning the logging endpoints, ERROR, +CRITICAL, WARN and DEBUG. For example: + +```go +func main() { + mqtt.ERROR = log.New(os.Stdout, "[ERROR] ", 0) + mqtt.CRITICAL = log.New(os.Stdout, "[CRIT] ", 0) + mqtt.WARN = log.New(os.Stdout, "[WARN] ", 0) + mqtt.DEBUG = log.New(os.Stdout, "[DEBUG] ", 0) + + // Connect, Subscribe, Publish etc.. +} +``` + +### Common Problems + +* Seemingly random disconnections may be caused by another client connecting to the broker with the same client +identifier; this is as per the [spec](https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc384800405). +* Unless ordered delivery of messages is essential (and you have configured your broker to support this e.g. + `max_inflight_messages=1` in mosquitto) then set `ClientOptions.SetOrderMatters(false)`. Doing so will avoid the + below issue (deadlocks due to blocking message handlers). +* A `MessageHandler` (called when a new message is received) must not block (unless + `ClientOptions.SetOrderMatters(false)` set). If you wish to perform a long-running task, or publish a message, then + please use a go routine (blocking in the handler is a common cause of unexpected `pingresp +not received, disconnecting` errors). +* When QOS1+ subscriptions have been created previously and you connect with `CleanSession` set to false it is possible that the broker will deliver retained +messages before `Subscribe` can be called. To process these messages either configure a handler with `AddRoute` or +set a `DefaultPublishHandler`. +* Loss of network connectivity may not be detected immediately. If this is an issue then consider setting +`ClientOptions.KeepAlive` (sends regular messages to check the link is active). +* Brokers offer many configuration options; some settings may lead to unexpected results. If using Mosquitto check +`max_inflight_messages`, `max_queued_messages`, `persistence` (the defaults may not be what you expect). Reporting bugs -------------- -Please report bugs by raising issues for this project in github https://github.com/eclipse/paho.mqtt.golang/issues +Please report bugs by raising issues for this project in github https://github.com/eclipse/paho.mqtt.golang/issues + +*A limited number of contributors monitor the issues section so if you have a general question please consider the +resources in the [more information](#more-information) section (your question will be seen by more people, and you are +likely to receive an answer more quickly).* + +We welcome bug reports, but it is important they are actionable. A significant percentage of issues reported are not +resolved due to a lack of information. If we cannot replicate the problem then it is unlikely we will be able to fix it. +The information required will vary from issue to issue but consider including: + +* Which version of the package you are using (tag or commit - this should be in your go.mod file) +* A [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). Providing an example +is the best way to demonstrate the issue you are facing; it is important this includes all relevant information +(including broker configuration). Docker (see `cmd/docker`) makes it relatively simple to provide a working end-to-end +example. +* A full, clear, description of the problem (detail what you are expecting vs what actually happens). +* Details of your attempts to resolve the issue (what have you tried, what worked, what did not). +* [Application Logs](#logging) covering the period the issue occurred. Unless you have isolated the root cause of the issue please include a link to a full log (including data from well before the problem arose). +* Broker Logs covering the period the issue occurred. +It is important to remember that this library does not stand alone; it communicates with a broker and any issues you are +seeing may be due to: + +* Bugs in your code. +* Bugs in this library. +* The broker configuration. +* Bugs in the broker. +* Issues with whatever you are communicating with. + +When submitting an issue, please ensure that you provide sufficient details to enable us to eliminate causes outside of +this library. + +Contributing +------------ + +We welcome pull requests but before your contribution can be accepted by the project, you need to create and +electronically sign the Eclipse Contributor Agreement (ECA) and sign off on the Eclipse Foundation Certificate of Origin. + +More information is available in the +[Eclipse Development Resources](http://wiki.eclipse.org/Development_Resources/Contributing_via_Git); please take special +note of the requirement that the commit record contain a "Signed-off-by" entry. More information ---------------- @@ -65,3 +172,6 @@ Discussion of the Paho clients takes place on the [Eclipse paho-dev mailing list General questions about the MQTT protocol are discussed in the [MQTT Google Group](https://groups.google.com/forum/?hl=en-US&fromgroups#!forum/mqtt). There is much more information available via the [MQTT community site](http://mqtt.org). + +[Stack Overflow](https://stackoverflow.com/questions/tagged/mqtt+go) has a range questions covering a range of common +issues (both relating to use of this library and MQTT in general). diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/client.go b/vendor/github.com/eclipse/paho.mqtt.golang/client.go index 24d56c1f38..60d8e7f35a 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/client.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/client.go @@ -18,6 +18,7 @@ package mqtt import ( + "bytes" "errors" "fmt" "net" @@ -54,11 +55,13 @@ const ( // information can be found in their respective documentation. // Numerous connection options may be specified by configuring a // and then supplying a ClientOptions type. +// Implementations of Client must be safe for concurrent use by multiple +// goroutines type Client interface { // IsConnected returns a bool signifying whether // the client is connected or not. IsConnected() bool - // IsConnectionOpen return a bool signifying wether the client has an active + // IsConnectionOpen return a bool signifying whether the client has an active // connection to mqtt broker, i.e not in disconnected or reconnect mode IsConnectionOpen() bool // Connect will create a connection to the message broker, by default @@ -74,11 +77,21 @@ type Client interface { // Returns a token to track delivery of the message to the broker Publish(topic string, qos byte, retained bool, payload interface{}) Token // Subscribe starts a new subscription. Provide a MessageHandler to be executed when - // a message is published on the topic provided, or nil for the default handler + // a message is published on the topic provided, or nil for the default handler. + // + // If options.OrderMatters is true (the default) then callback must not block or + // call functions within this package that may block (e.g. Publish) other than in + // a new go routine. + // callback must be safe for concurrent use by multiple goroutines. Subscribe(topic string, qos byte, callback MessageHandler) Token // SubscribeMultiple starts a new subscription for multiple topics. Provide a MessageHandler to // be executed when a message is published on one of the topics provided, or nil for the - // default handler + // default handler. + // + // If options.OrderMatters is true (the default) then callback must not block or + // call functions within this package that may block (e.g. Publish) other than in + // a new go routine. + // callback must be safe for concurrent use by multiple goroutines. SubscribeMultiple(filters map[string]byte, callback MessageHandler) Token // Unsubscribe will end the subscription from each of the topics provided. // Messages published to those topics from other clients will no longer be @@ -86,7 +99,13 @@ type Client interface { Unsubscribe(topics ...string) Token // AddRoute allows you to add a handler for messages on a specific topic // without making a subscription. For example having a different handler - // for parts of a wildcard subscription + // for parts of a wildcard subscription or for receiving retained messages + // upon connection (before Sub scribe can be processed). + // + // If options.OrderMatters is true (the default) then callback must not block or + // call functions within this package that may block (e.g. Publish) other than in + // a new go routine. + // callback must be safe for concurrent use by multiple goroutines. AddRoute(topic string, callback MessageHandler) // OptionsReader returns a ClientOptionsReader which is a copy of the clientoptions // in use by the client. @@ -94,25 +113,31 @@ type Client interface { } // client implements the Client interface +// clients are safe for concurrent use by multiple +// goroutines type client struct { - lastSent atomic.Value - lastReceived atomic.Value - pingOutstanding int32 - status uint32 - sync.RWMutex - messageIds - conn net.Conn - ibound chan packets.ControlPacket - obound chan *PacketAndToken - oboundP chan *PacketAndToken - msgRouter *router - stopRouter chan bool - incomingPubChan chan *packets.PublishPacket - errors chan error - stop chan struct{} - persist Store - options ClientOptions - workers sync.WaitGroup + lastSent atomic.Value // time.Time - the last time a packet was successfully sent to network + lastReceived atomic.Value // time.Time - the last time a packet was successfully received from network + pingOutstanding int32 // set to 1 if a ping has been sent but response not ret received + + status uint32 // see const definitions at top of file for possible values + sync.RWMutex // Protects the above two variables (note: atomic writes are also used somewhat inconsistently) + + messageIds // effectively a map from message id to token completor + + obound chan *PacketAndToken // outgoing publish packet + oboundP chan *PacketAndToken // outgoing 'priority' packet (anything other than publish) + msgRouter *router // routes topics to handlers + persist Store + options ClientOptions + optionsMu sync.Mutex // Protects the options in a few limited cases where needed for testing + + conn net.Conn // the network connection, must only be set with connMu locked (only used when starting/stopping workers) + connMu sync.Mutex // mutex for the connection (again only used in two functions) + + stop chan struct{} // Closed to request that workers stop + workers sync.WaitGroup // used to wait for workers to complete (ping, keepalive, errwatch, resume) + commsStopped chan struct{} // closed when the comms routines have stopped (kept running until after workers have closed to avoid deadlocks) } // NewClient will create an MQTT v3.1.1 client with all of the options specified @@ -138,17 +163,21 @@ func NewClient(o *ClientOptions) Client { c.persist = c.options.Store c.status = disconnected c.messageIds = messageIds{index: make(map[uint16]tokenCompletor)} - c.msgRouter, c.stopRouter = newRouter() + c.msgRouter = newRouter() c.msgRouter.setDefaultHandler(c.options.DefaultPublishHandler) - if !c.options.AutoReconnect { - c.options.MessageChannelDepth = 0 - } + c.obound = make(chan *PacketAndToken) + c.oboundP = make(chan *PacketAndToken) return c } // AddRoute allows you to add a handler for messages on a specific topic // without making a subscription. For example having a different handler // for parts of a wildcard subscription +// +// If options.OrderMatters is true (the default) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in +// a new go routine. +// callback must be safe for concurrent use by multiple goroutines. func (c *client) AddRoute(topic string, callback MessageHandler) { if callback != nil { c.msgRouter.addRoute(topic, callback) @@ -157,6 +186,8 @@ func (c *client) AddRoute(topic string, callback MessageHandler) { // IsConnected returns a bool signifying whether // the client is connected or not. +// connected means that the connection is up now OR it will +// be established/reestablished automatically when possible func (c *client) IsConnected() bool { c.RLock() defer c.RUnlock() @@ -166,6 +197,8 @@ func (c *client) IsConnected() bool { return true case c.options.AutoReconnect && status > connecting: return true + case c.options.ConnectRetry && status == connecting: + return true default: return false } @@ -195,141 +228,81 @@ func (c *client) connectionStatus() uint32 { func (c *client) setConnected(status uint32) { c.Lock() defer c.Unlock() - atomic.StoreUint32(&c.status, uint32(status)) + atomic.StoreUint32(&c.status, status) } -//ErrNotConnected is the error returned from function calls that are -//made when the client is not connected to a broker -var ErrNotConnected = errors.New("Not Connected") +// ErrNotConnected is the error returned from function calls that are +// made when the client is not connected to a broker +var ErrNotConnected = errors.New("not Connected") // Connect will create a connection to the message broker, by default // it will attempt to connect at v3.1.1 and auto retry at v3.1 if that // fails +// Note: If using QOS1+ and CleanSession=false it is advisable to add +// routes (or a DefaultPublishHandler) prior to calling Connect() +// because queued messages may be delivered immediately post connection func (c *client) Connect() Token { - var err error t := newToken(packets.Connect).(*ConnectToken) DEBUG.Println(CLI, "Connect()") - c.obound = make(chan *PacketAndToken, c.options.MessageChannelDepth) - c.oboundP = make(chan *PacketAndToken, c.options.MessageChannelDepth) - c.ibound = make(chan packets.ControlPacket) - - go func() { - c.persist.Open() - - c.setConnected(connecting) - c.errors = make(chan error, 1) - c.stop = make(chan struct{}) + if c.options.ConnectRetry && atomic.LoadUint32(&c.status) != disconnected { + // if in any state other than disconnected and ConnectRetry is + // enabled then the connection will come up automatically + // client can assume connection is up + WARN.Println(CLI, "Connect() called but not disconnected") + t.returnCode = packets.Accepted + t.flowComplete() + return t + } - var rc byte - protocolVersion := c.options.ProtocolVersion + c.persist.Open() + if c.options.ConnectRetry { + c.reserveStoredPublishIDs() // Reserve IDs to allow publish before connect complete + } + c.setConnected(connecting) + go func() { if len(c.options.Servers) == 0 { - t.setError(fmt.Errorf("No servers defined to connect to")) + t.setError(fmt.Errorf("no servers defined to connect to")) return } - for _, broker := range c.options.Servers { - cm := newConnectMsgFromOptions(&c.options, broker) - c.options.ProtocolVersion = protocolVersion - CONN: - DEBUG.Println(CLI, "about to write new connect msg") - c.conn, err = openConnection(broker, c.options.TLSConfig, c.options.ConnectTimeout, c.options.HTTPHeaders) - if err == nil { - DEBUG.Println(CLI, "socket connected to broker") - switch c.options.ProtocolVersion { - case 3: - DEBUG.Println(CLI, "Using MQTT 3.1 protocol") - cm.ProtocolName = "MQIsdp" - cm.ProtocolVersion = 3 - case 0x83: - DEBUG.Println(CLI, "Using MQTT 3.1b protocol") - cm.ProtocolName = "MQIsdp" - cm.ProtocolVersion = 0x83 - case 0x84: - DEBUG.Println(CLI, "Using MQTT 3.1.1b protocol") - cm.ProtocolName = "MQTT" - cm.ProtocolVersion = 0x84 - default: - DEBUG.Println(CLI, "Using MQTT 3.1.1 protocol") - c.options.ProtocolVersion = 4 - cm.ProtocolName = "MQTT" - cm.ProtocolVersion = 4 - } - cm.Write(c.conn) - - rc, t.sessionPresent = c.connect() - if rc != packets.Accepted { - if c.conn != nil { - c.conn.Close() - c.conn = nil - } - //if the protocol version was explicitly set don't do any fallback - if c.options.protocolVersionExplicit { - ERROR.Println(CLI, "Connecting to", broker, "CONNACK was not CONN_ACCEPTED, but rather", packets.ConnackReturnCodes[rc]) - continue - } - if c.options.ProtocolVersion == 4 { - DEBUG.Println(CLI, "Trying reconnect using MQTT 3.1 protocol") - c.options.ProtocolVersion = 3 - goto CONN - } + RETRYCONN: + var conn net.Conn + var rc byte + var err error + conn, rc, t.sessionPresent, err = c.attemptConnection() + if err != nil { + if c.options.ConnectRetry { + DEBUG.Println(CLI, "Connect failed, sleeping for", int(c.options.ConnectRetryInterval.Seconds()), "seconds and will then retry") + time.Sleep(c.options.ConnectRetryInterval) + + if atomic.LoadUint32(&c.status) == connecting { + goto RETRYCONN } - break - } else { - ERROR.Println(CLI, err.Error()) - WARN.Println(CLI, "failed to connect to broker, trying next") - rc = packets.ErrNetworkError } - } - - if c.conn == nil { ERROR.Println(CLI, "Failed to connect to a broker") c.setConnected(disconnected) c.persist.Close() t.returnCode = rc - if rc != packets.ErrNetworkError { - t.setError(packets.ConnErrors[rc]) - } else { - t.setError(fmt.Errorf("%s : %s", packets.ConnErrors[rc], err)) - } + t.setError(err) return } - - c.options.protocolVersionExplicit = true - - if c.options.KeepAlive != 0 { - atomic.StoreInt32(&c.pingOutstanding, 0) - c.lastReceived.Store(time.Now()) - c.lastSent.Store(time.Now()) - c.workers.Add(1) - go keepalive(c) - } - - c.incomingPubChan = make(chan *packets.PublishPacket, c.options.MessageChannelDepth) - c.msgRouter.matchAndDispatch(c.incomingPubChan, c.options.Order, c) - - c.setConnected(connected) - DEBUG.Println(CLI, "client is connected") - if c.options.OnConnect != nil { - go c.options.OnConnect(c) - } - - c.workers.Add(4) - go errorWatch(c) - go alllogic(c) - go outgoing(c) - go incoming(c) - - // Take care of any messages in the store - if c.options.CleanSession == false { - c.resume(c.options.ResumeSubs) + inboundFromStore := make(chan packets.ControlPacket) // there may be some inbound comms packets in the store that are awaiting processing + if c.startCommsWorkers(conn, inboundFromStore) { + // Take care of any messages in the store + if !c.options.CleanSession { + c.resume(c.options.ResumeSubs, inboundFromStore) + } else { + c.persist.Reset() + } } else { - c.persist.Reset() + WARN.Println(CLI, "Connect() called but connection established in another goroutine") } - DEBUG.Println(CLI, "exit startClient") + close(inboundFromStore) t.flowComplete() + DEBUG.Println(CLI, "exit startClient") }() return t } @@ -338,126 +311,121 @@ func (c *client) Connect() Token { func (c *client) reconnect() { DEBUG.Println(CLI, "enter reconnect") var ( - err error - - rc = byte(1) - sleep = time.Duration(1 * time.Second) + sleep = 1 * time.Second + conn net.Conn ) - for rc != 0 && atomic.LoadUint32(&c.status) != disconnected { - for _, broker := range c.options.Servers { - cm := newConnectMsgFromOptions(&c.options, broker) - DEBUG.Println(CLI, "about to write new connect msg") - c.Lock() - c.conn, err = openConnection(broker, c.options.TLSConfig, c.options.ConnectTimeout, c.options.HTTPHeaders) - c.Unlock() - if err == nil { - DEBUG.Println(CLI, "socket connected to broker") - switch c.options.ProtocolVersion { - case 0x83: - DEBUG.Println(CLI, "Using MQTT 3.1b protocol") - cm.ProtocolName = "MQIsdp" - cm.ProtocolVersion = 0x83 - case 0x84: - DEBUG.Println(CLI, "Using MQTT 3.1.1b protocol") - cm.ProtocolName = "MQTT" - cm.ProtocolVersion = 0x84 - case 3: - DEBUG.Println(CLI, "Using MQTT 3.1 protocol") - cm.ProtocolName = "MQIsdp" - cm.ProtocolVersion = 3 - default: - DEBUG.Println(CLI, "Using MQTT 3.1.1 protocol") - cm.ProtocolName = "MQTT" - cm.ProtocolVersion = 4 - } - cm.Write(c.conn) - - rc, _ = c.connect() - if rc != packets.Accepted { - c.conn.Close() - c.conn = nil - //if the protocol version was explicitly set don't do any fallback - if c.options.protocolVersionExplicit { - ERROR.Println(CLI, "Connecting to", broker, "CONNACK was not Accepted, but rather", packets.ConnackReturnCodes[rc]) - continue - } - } - break - } else { - ERROR.Println(CLI, err.Error()) - WARN.Println(CLI, "failed to connect to broker, trying next") - rc = packets.ErrNetworkError - } + for { + if nil != c.options.OnReconnecting { + c.options.OnReconnecting(c, &c.options) + } + var err error + conn, _, _, err = c.attemptConnection() + if err == nil { + break + } + DEBUG.Println(CLI, "Reconnect failed, sleeping for", int(sleep.Seconds()), "seconds:", err) + time.Sleep(sleep) + if sleep < c.options.MaxReconnectInterval { + sleep *= 2 } - if rc != 0 { - DEBUG.Println(CLI, "Reconnect failed, sleeping for", int(sleep.Seconds()), "seconds") - time.Sleep(sleep) - if sleep < c.options.MaxReconnectInterval { - sleep *= 2 - } - if sleep > c.options.MaxReconnectInterval { - sleep = c.options.MaxReconnectInterval - } + if sleep > c.options.MaxReconnectInterval { + sleep = c.options.MaxReconnectInterval + } + // Disconnect may have been called + if atomic.LoadUint32(&c.status) == disconnected { + break } } + // Disconnect() must have been called while we were trying to reconnect. if c.connectionStatus() == disconnected { + if conn != nil { + conn.Close() + } DEBUG.Println(CLI, "Client moved to disconnected state while reconnecting, abandoning reconnect") return } - c.stop = make(chan struct{}) - - if c.options.KeepAlive != 0 { - atomic.StoreInt32(&c.pingOutstanding, 0) - c.lastReceived.Store(time.Now()) - c.lastSent.Store(time.Now()) - c.workers.Add(1) - go keepalive(c) - } - - c.setConnected(connected) - DEBUG.Println(CLI, "client is reconnected") - if c.options.OnConnect != nil { - go c.options.OnConnect(c) + inboundFromStore := make(chan packets.ControlPacket) // there may be some inbound comms packets in the store that are awaiting processing + if c.startCommsWorkers(conn, inboundFromStore) { + c.resume(c.options.ResumeSubs, inboundFromStore) } + close(inboundFromStore) +} - c.workers.Add(4) - go errorWatch(c) - go alllogic(c) - go outgoing(c) - go incoming(c) +// attemptConnection makes a single attempt to connect to each of the brokers +// the protocol version to use is passed in (as c.options.ProtocolVersion) +// Note: Does not set c.conn in order to minimise race conditions +// Returns: +// net.Conn - Connected network connection +// byte - Return code (packets.Accepted indicates a successful connection). +// bool - SessionPresent flag from the connect ack (only valid if packets.Accepted) +// err - Error (err != nil guarantees that conn has been set to active connection). +func (c *client) attemptConnection() (net.Conn, byte, bool, error) { + protocolVersion := c.options.ProtocolVersion + var ( + sessionPresent bool + conn net.Conn + err error + rc byte + ) - c.resume(false) -} + c.optionsMu.Lock() // Protect c.options.Servers so that servers can be added in test cases + brokers := c.options.Servers + c.optionsMu.Unlock() + for _, broker := range brokers { + cm := newConnectMsgFromOptions(&c.options, broker) + DEBUG.Println(CLI, "about to write new connect msg") + CONN: + tlsCfg := c.options.TLSConfig + if c.options.OnConnectAttempt != nil { + DEBUG.Println(CLI, "using custom onConnectAttempt handler...") + tlsCfg = c.options.OnConnectAttempt(broker, c.options.TLSConfig) + } + // Start by opening the network connection (tcp, tls, ws) etc + conn, err = openConnection(broker, tlsCfg, c.options.ConnectTimeout, c.options.HTTPHeaders, c.options.WebsocketOptions) + if err != nil { + ERROR.Println(CLI, err.Error()) + WARN.Println(CLI, "failed to connect to broker, trying next") + rc = packets.ErrNetworkError + continue + } + DEBUG.Println(CLI, "socket connected to broker") -// This function is only used for receiving a connack -// when the connection is first started. -// This prevents receiving incoming data while resume -// is in progress if clean session is false. -func (c *client) connect() (byte, bool) { - DEBUG.Println(NET, "connect started") + // Now we send the perform the MQTT connection handshake + rc, sessionPresent, err = connectMQTT(conn, cm, protocolVersion) + if rc == packets.Accepted { + break // successfully connected + } - ca, err := packets.ReadPacket(c.conn) - if err != nil { - ERROR.Println(NET, "connect got error", err) - return packets.ErrNetworkError, false - } - if ca == nil { - ERROR.Println(NET, "received nil packet") - return packets.ErrNetworkError, false + // We may be have to attempt the connection with MQTT 3.1 + if conn != nil { + _ = conn.Close() + } + if !c.options.protocolVersionExplicit && protocolVersion == 4 { // try falling back to 3.1? + DEBUG.Println(CLI, "Trying reconnect using MQTT 3.1 protocol") + protocolVersion = 3 + goto CONN + } + if c.options.protocolVersionExplicit { // to maintain logging from previous version + ERROR.Println(CLI, "Connecting to", broker, "CONNACK was not CONN_ACCEPTED, but rather", packets.ConnackReturnCodes[rc]) + } } - - msg, ok := ca.(*packets.ConnackPacket) - if !ok { - ERROR.Println(NET, "received msg that was not CONNACK") - return packets.ErrNetworkError, false + // If the connection was successful we set member variable and lock in the protocol version for future connection attempts (and users) + if rc == packets.Accepted { + c.options.ProtocolVersion = protocolVersion + c.options.protocolVersionExplicit = true + } else { + // Maintain same error format as used previously + if rc != packets.ErrNetworkError { // mqtt error + err = packets.ConnErrors[rc] + } else { // network error (if this occurred in ConnectMQTT then err will be nil) + err = fmt.Errorf("%s : %s", packets.ConnErrors[rc], err) + } } - - DEBUG.Println(NET, "received connack") - return msg.ReturnCode, msg.SessionPresent + return conn, rc, sessionPresent, err } // Disconnect will end the connection with the server, but not before waiting @@ -471,10 +439,22 @@ func (c *client) Disconnect(quiesce uint) { dm := packets.NewControlPacket(packets.Disconnect).(*packets.DisconnectPacket) dt := newToken(packets.Disconnect) - c.oboundP <- &PacketAndToken{p: dm, t: dt} + disconnectSent := false + select { + case c.oboundP <- &PacketAndToken{p: dm, t: dt}: + disconnectSent = true + case <-c.commsStopped: + WARN.Println("Disconnect packet could not be sent because comms stopped") + case <-time.After(time.Duration(quiesce) * time.Millisecond): + WARN.Println("Disconnect packet not sent due to timeout") + } // wait for work to finish, or quiesce time consumed - dt.WaitTimeout(time.Duration(quiesce) * time.Millisecond) + if disconnectSent { + DEBUG.Println(CLI, "calling WaitTimeout") + dt.WaitTimeout(time.Duration(quiesce) * time.Millisecond) + DEBUG.Println(CLI, "WaitTimeout done") + } } else { WARN.Println(CLI, "Disconnect() called but not connected (disconnected/reconnecting)") c.setConnected(disconnected) @@ -483,83 +463,207 @@ func (c *client) Disconnect(quiesce uint) { c.disconnect() } -// ForceDisconnect will end the connection with the mqtt broker immediately. +// forceDisconnect will end the connection with the mqtt broker immediately (used for tests only) func (c *client) forceDisconnect() { if !c.IsConnected() { WARN.Println(CLI, "already disconnected") return } c.setConnected(disconnected) - c.conn.Close() DEBUG.Println(CLI, "forcefully disconnecting") c.disconnect() } -func (c *client) internalConnLost(err error) { - // Only do anything if this was called and we are still "connected" - // forceDisconnect can cause incoming/outgoing/alllogic to end with - // error from closing the socket but state will be "disconnected" - if c.IsConnected() { - c.closeStop() - c.conn.Close() - c.workers.Wait() - if c.options.CleanSession && !c.options.AutoReconnect { - c.messageIds.cleanUp() - } - if c.options.AutoReconnect { - c.setConnected(reconnecting) - go c.reconnect() - } else { - c.setConnected(disconnected) - } - if c.options.OnConnectionLost != nil { - go c.options.OnConnectionLost(c, err) - } +// disconnect cleans up after a final disconnection (user requested so no auto reconnection) +func (c *client) disconnect() { + done := c.stopCommsWorkers() + if done != nil { + <-done // Wait until the disconnect is complete (to limit chance that another connection will be started) + DEBUG.Println(CLI, "forcefully disconnecting") + c.messageIds.cleanUp() + DEBUG.Println(CLI, "disconnected") + c.persist.Close() } } -func (c *client) closeStop() { - c.Lock() - defer c.Unlock() - select { - case <-c.stop: - DEBUG.Println("In disconnect and stop channel is already closed") - default: - if c.stop != nil { - close(c.stop) - } +// internalConnLost cleanup when connection is lost or an error occurs +// Note: This function will not block +func (c *client) internalConnLost(err error) { + // It is possible that internalConnLost will be called multiple times simultaneously + // (including after sending a DisconnectPacket) as such we only do cleanup etc if the + // routines were actually running and are not being disconnected at users request + DEBUG.Println(CLI, "internalConnLost called") + stopDone := c.stopCommsWorkers() + if stopDone != nil { // stopDone will be nil if workers already in the process of stopping or stopped + go func() { + DEBUG.Println(CLI, "internalConnLost waiting on workers") + <-stopDone + DEBUG.Println(CLI, "internalConnLost workers stopped") + // It is possible that Disconnect was called which led to this error so reconnection depends upon status + reconnect := c.options.AutoReconnect && c.connectionStatus() > connecting + + if c.options.CleanSession && !reconnect { + c.messageIds.cleanUp() + } + if reconnect { + c.setConnected(reconnecting) + go c.reconnect() + } else { + c.setConnected(disconnected) + } + if c.options.OnConnectionLost != nil { + go c.options.OnConnectionLost(c, err) + } + DEBUG.Println(CLI, "internalConnLost complete") + }() } } -func (c *client) closeStopRouter() { - c.Lock() - defer c.Unlock() - select { - case <-c.stopRouter: - DEBUG.Println("In disconnect and stop channel is already closed") - default: - if c.stopRouter != nil { - close(c.stopRouter) - } +// startCommsWorkers is called when the connection is up. +// It starts off all of the routines needed to process incoming and outgoing messages. +// Returns true if the comms workers were started (i.e. they were not already running) +func (c *client) startCommsWorkers(conn net.Conn, inboundFromStore <-chan packets.ControlPacket) bool { + DEBUG.Println(CLI, "startCommsWorkers called") + c.connMu.Lock() + defer c.connMu.Unlock() + if c.conn != nil { + WARN.Println(CLI, "startCommsWorkers called when commsworkers already running") + conn.Close() // No use for the new network connection + return false } -} + c.conn = conn // Store the connection -func (c *client) closeConn() { - c.Lock() - defer c.Unlock() - if c.conn != nil { - c.conn.Close() + c.stop = make(chan struct{}) + if c.options.KeepAlive != 0 { + atomic.StoreInt32(&c.pingOutstanding, 0) + c.lastReceived.Store(time.Now()) + c.lastSent.Store(time.Now()) + c.workers.Add(1) + go keepalive(c, conn) } + + // matchAndDispatch will process messages received from the network. It may generate acknowledgements + // It will complete when incomingPubChan is closed and will close ackOut prior to exiting + incomingPubChan := make(chan *packets.PublishPacket) + c.workers.Add(1) // Done will be called when ackOut is closed + ackOut := c.msgRouter.matchAndDispatch(incomingPubChan, c.options.Order, c) + + c.setConnected(connected) + DEBUG.Println(CLI, "client is connected/reconnected") + if c.options.OnConnect != nil { + go c.options.OnConnect(c) + } + + // c.oboundP and c.obound need to stay active for the life of the client because, depending upon the options, + // messages may be published while the client is disconnected (they will block unless in a goroutine). However + // to keep the comms routines clean we want to shutdown the input messages it uses so create out own channels + // and copy data across. + commsobound := make(chan *PacketAndToken) // outgoing publish packets + commsoboundP := make(chan *PacketAndToken) // outgoing 'priority' packet + c.workers.Add(1) + go func() { + defer c.workers.Done() + for { + select { + case msg := <-c.oboundP: + commsoboundP <- msg + case msg := <-c.obound: + commsobound <- msg + case msg, ok := <-ackOut: + if !ok { + ackOut = nil // ignore channel going forward + c.workers.Done() // matchAndDispatch has completed + continue // await next message + } + commsoboundP <- msg + case <-c.stop: + // Attempt to transmit any outstanding acknowledgements (this may well fail but should work if this is a clean disconnect) + if ackOut != nil { + for msg := range ackOut { + commsoboundP <- msg + } + c.workers.Done() // matchAndDispatch has completed + } + close(commsoboundP) // Nothing sending to these channels anymore so close them and allow comms routines to exit + close(commsobound) + DEBUG.Println(CLI, "startCommsWorkers output redirector finished") + return + } + } + }() + + commsIncomingPub, commsErrors := startComms(c.conn, c, inboundFromStore, commsoboundP, commsobound) + c.commsStopped = make(chan struct{}) + go func() { + for { + if commsIncomingPub == nil && commsErrors == nil { + break + } + select { + case pub, ok := <-commsIncomingPub: + if !ok { + // Incoming comms has shutdown + close(incomingPubChan) // stop the router + commsIncomingPub = nil + continue + } + incomingPubChan <- pub + case err, ok := <-commsErrors: + if !ok { + commsErrors = nil + continue + } + ERROR.Println(CLI, "Connect comms goroutine - error triggered", err) + c.internalConnLost(err) // no harm in calling this if the connection is already down (or shutdown is in progress) + continue + } + } + DEBUG.Println(CLI, "incoming comms goroutine done") + close(c.commsStopped) + }() + DEBUG.Println(CLI, "startCommsWorkers done") + return true } -func (c *client) disconnect() { - c.closeStop() - c.closeConn() - c.workers.Wait() - c.messageIds.cleanUp() - c.closeStopRouter() - DEBUG.Println(CLI, "disconnected") - c.persist.Close() +// stopWorkersAndComms - Cleanly shuts down worker go routines (including the comms routines) and waits until everything has stopped +// Returns nil it workers did not need to be stopped; otherwise returns a channel which will be closed when the stop is complete +// Note: This may block so run as a go routine if calling from any of the comms routines +func (c *client) stopCommsWorkers() chan struct{} { + DEBUG.Println(CLI, "stopCommsWorkers called") + // It is possible that this function will be called multiple times simultaneously due to the way things get shutdown + c.connMu.Lock() + if c.conn == nil { + DEBUG.Println(CLI, "stopCommsWorkers done (not running)") + c.connMu.Unlock() + return nil + } + + // It is important that everything is stopped in the correct order to avoid deadlocks. The main issue here is + // the router because it both receives incoming publish messages and also sends outgoing acknowledgements. To + // avoid issues we signal the workers to stop and close the connection (it is probably already closed but + // there is no harm in being sure). We can then wait for the workers to finnish before closing outbound comms + // channels which will allow the comms routines to exit. + + // We stop all non-comms related workers first (ping, keepalive, errwatch, resume etc) so they don't get blocked waiting on comms + close(c.stop) // Signal for workers to stop + c.conn.Close() // Possible that this is already closed but no harm in closing again + c.conn = nil // Important that this is the only place that this is set to nil + c.connMu.Unlock() // As the connection is now nil we can unlock the mu (allowing subsequent calls to exit immediately) + + doneChan := make(chan struct{}) + + go func() { + DEBUG.Println(CLI, "stopCommsWorkers waiting for workers") + c.workers.Wait() + + // Stopping the workers will allow the comms routines to exit; we wait for these to complete + DEBUG.Println(CLI, "stopCommsWorkers waiting for comms") + <-c.commsStopped // wait for comms routine to stop + + DEBUG.Println(CLI, "stopCommsWorkers done") + close(doneChan) + }() + return doneChan } // Publish will publish a message with the specified QoS and content @@ -580,32 +684,55 @@ func (c *client) Publish(topic string, qos byte, retained bool, payload interfac pub.Qos = qos pub.TopicName = topic pub.Retain = retained - switch payload.(type) { + switch p := payload.(type) { case string: - pub.Payload = []byte(payload.(string)) + pub.Payload = []byte(p) case []byte: - pub.Payload = payload.([]byte) + pub.Payload = p + case bytes.Buffer: + pub.Payload = p.Bytes() default: - token.setError(fmt.Errorf("Unknown payload type")) + token.setError(fmt.Errorf("unknown payload type")) return token } if pub.Qos != 0 && pub.MessageID == 0 { - pub.MessageID = c.getID(token) - token.messageID = pub.MessageID + mID := c.getID(token) + if mID == 0 { + token.setError(fmt.Errorf("no message IDs available")) + return token + } + pub.MessageID = mID + token.messageID = mID } persistOutbound(c.persist, pub) - if c.connectionStatus() == reconnecting { + switch c.connectionStatus() { + case connecting: + DEBUG.Println(CLI, "storing publish message (connecting), topic:", topic) + case reconnecting: DEBUG.Println(CLI, "storing publish message (reconnecting), topic:", topic) - } else { + default: DEBUG.Println(CLI, "sending publish message, topic:", topic) - c.obound <- &PacketAndToken{p: pub, t: token} + publishWaitTimeout := c.options.WriteTimeout + if publishWaitTimeout == 0 { + publishWaitTimeout = time.Second * 30 + } + select { + case c.obound <- &PacketAndToken{p: pub, t: token}: + case <-time.After(publishWaitTimeout): + token.setError(errors.New("publish was broken by timeout")) + } } return token } // Subscribe starts a new subscription. Provide a MessageHandler to be executed when // a message is published on the topic provided. +// +// If options.OrderMatters is true (the default) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in +// a new go routine. +// callback must be safe for concurrent use by multiple goroutines. func (c *client) Subscribe(topic string, qos byte, callback MessageHandler) Token { token := newToken(packets.Subscribe).(*SubscribeToken) DEBUG.Println(CLI, "enter Subscribe") @@ -613,6 +740,18 @@ func (c *client) Subscribe(topic string, qos byte, callback MessageHandler) Toke token.setError(ErrNotConnected) return token } + if !c.IsConnectionOpen() { + switch { + case !c.options.ResumeSubs: + // if not connected and resumesubs not set this sub will be thrown away + token.setError(fmt.Errorf("not currently connected and ResumeSubs not set")) + return token + case c.options.CleanSession && c.connectionStatus() == reconnecting: + // if reconnecting and cleansession is true this sub will be thrown away + token.setError(fmt.Errorf("reconnecting state and cleansession is true")) + return token + } + } sub := packets.NewControlPacket(packets.Subscribe).(*packets.SubscribePacket) if err := validateTopicAndQos(topic, qos); err != nil { token.setError(err) @@ -620,24 +759,61 @@ func (c *client) Subscribe(topic string, qos byte, callback MessageHandler) Toke } sub.Topics = append(sub.Topics, topic) sub.Qoss = append(sub.Qoss, qos) - DEBUG.Println(CLI, sub.String()) - if strings.HasPrefix(topic, "$share") { + if strings.HasPrefix(topic, "$share/") { topic = strings.Join(strings.Split(topic, "/")[2:], "/") } + if strings.HasPrefix(topic, "$queue/") { + topic = strings.TrimPrefix(topic, "$queue/") + } + if callback != nil { c.msgRouter.addRoute(topic, callback) } token.subs = append(token.subs, topic) - c.oboundP <- &PacketAndToken{p: sub, t: token} + + if sub.MessageID == 0 { + mID := c.getID(token) + if mID == 0 { + token.setError(fmt.Errorf("no message IDs available")) + return token + } + sub.MessageID = mID + token.messageID = mID + } + DEBUG.Println(CLI, sub.String()) + + persistOutbound(c.persist, sub) + switch c.connectionStatus() { + case connecting: + DEBUG.Println(CLI, "storing subscribe message (connecting), topic:", topic) + case reconnecting: + DEBUG.Println(CLI, "storing subscribe message (reconnecting), topic:", topic) + default: + DEBUG.Println(CLI, "sending subscribe message, topic:", topic) + subscribeWaitTimeout := c.options.WriteTimeout + if subscribeWaitTimeout == 0 { + subscribeWaitTimeout = time.Second * 30 + } + select { + case c.oboundP <- &PacketAndToken{p: sub, t: token}: + case <-time.After(subscribeWaitTimeout): + token.setError(errors.New("subscribe was broken by timeout")) + } + } DEBUG.Println(CLI, "exit Subscribe") return token } // SubscribeMultiple starts a new subscription for multiple topics. Provide a MessageHandler to // be executed when a message is published on one of the topics provided. +// +// If options.OrderMatters is true (the default) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in +// a new go routine. +// callback must be safe for concurrent use by multiple goroutines. func (c *client) SubscribeMultiple(filters map[string]byte, callback MessageHandler) Token { var err error token := newToken(packets.Subscribe).(*SubscribeToken) @@ -646,6 +822,18 @@ func (c *client) SubscribeMultiple(filters map[string]byte, callback MessageHand token.setError(ErrNotConnected) return token } + if !c.IsConnectionOpen() { + switch { + case !c.options.ResumeSubs: + // if not connected and resumesubs not set this sub will be thrown away + token.setError(fmt.Errorf("not currently connected and ResumeSubs not set")) + return token + case c.options.CleanSession && c.connectionStatus() == reconnecting: + // if reconnecting and cleansession is true this sub will be thrown away + token.setError(fmt.Errorf("reconnecting state and cleansession is true")) + return token + } + } sub := packets.NewControlPacket(packets.Subscribe).(*packets.SubscribePacket) if sub.Topics, sub.Qoss, err = validateSubscribeMap(filters); err != nil { token.setError(err) @@ -659,60 +847,149 @@ func (c *client) SubscribeMultiple(filters map[string]byte, callback MessageHand } token.subs = make([]string, len(sub.Topics)) copy(token.subs, sub.Topics) - c.oboundP <- &PacketAndToken{p: sub, t: token} + + if sub.MessageID == 0 { + mID := c.getID(token) + if mID == 0 { + token.setError(fmt.Errorf("no message IDs available")) + return token + } + sub.MessageID = mID + token.messageID = mID + } + persistOutbound(c.persist, sub) + switch c.connectionStatus() { + case connecting: + DEBUG.Println(CLI, "storing subscribe message (connecting), topics:", sub.Topics) + case reconnecting: + DEBUG.Println(CLI, "storing subscribe message (reconnecting), topics:", sub.Topics) + default: + DEBUG.Println(CLI, "sending subscribe message, topics:", sub.Topics) + subscribeWaitTimeout := c.options.WriteTimeout + if subscribeWaitTimeout == 0 { + subscribeWaitTimeout = time.Second * 30 + } + select { + case c.oboundP <- &PacketAndToken{p: sub, t: token}: + case <-time.After(subscribeWaitTimeout): + token.setError(errors.New("subscribe was broken by timeout")) + } + } DEBUG.Println(CLI, "exit SubscribeMultiple") return token } +// reserveStoredPublishIDs reserves the ids for publish packets in the persistent store to ensure these are not duplicated +func (c *client) reserveStoredPublishIDs() { + // The resume function sets the stored id for publish packets only (some other packets + // will get new ids in net code). This means that the only keys we need to ensure are + // unique are the publish ones (and these will completed/replaced in resume() ) + if !c.options.CleanSession { + storedKeys := c.persist.All() + for _, key := range storedKeys { + packet := c.persist.Get(key) + if packet == nil { + continue + } + switch packet.(type) { + case *packets.PublishPacket: + details := packet.Details() + token := &PlaceHolderToken{id: details.MessageID} + c.claimID(token, details.MessageID) + } + } + } +} + // Load all stored messages and resend them // Call this to ensure QOS > 1,2 even after an application crash -func (c *client) resume(subscription bool) { +// Note: This function will exit if c.stop is closed (this allows the shutdown to proceed avoiding a potential deadlock) +// +func (c *client) resume(subscription bool, ibound chan packets.ControlPacket) { + DEBUG.Println(STR, "enter Resume") storedKeys := c.persist.All() for _, key := range storedKeys { packet := c.persist.Get(key) if packet == nil { + DEBUG.Println(STR, fmt.Sprintf("resume found NIL packet (%s)", key)) continue } details := packet.Details() if isKeyOutbound(key) { - switch packet.(type) { + switch p := packet.(type) { case *packets.SubscribePacket: if subscription { DEBUG.Println(STR, fmt.Sprintf("loaded pending subscribe (%d)", details.MessageID)) + subPacket := packet.(*packets.SubscribePacket) token := newToken(packets.Subscribe).(*SubscribeToken) - c.oboundP <- &PacketAndToken{p: packet, t: token} + token.messageID = details.MessageID + token.subs = append(token.subs, subPacket.Topics...) + c.claimID(token, details.MessageID) + select { + case c.oboundP <- &PacketAndToken{p: packet, t: token}: + case <-c.stop: + DEBUG.Println(STR, "resume exiting due to stop") + return + } + } else { + c.persist.Del(key) // Unsubscribe packets should not be retained following a reconnect } case *packets.UnsubscribePacket: if subscription { DEBUG.Println(STR, fmt.Sprintf("loaded pending unsubscribe (%d)", details.MessageID)) token := newToken(packets.Unsubscribe).(*UnsubscribeToken) - c.oboundP <- &PacketAndToken{p: packet, t: token} + select { + case c.oboundP <- &PacketAndToken{p: packet, t: token}: + case <-c.stop: + DEBUG.Println(STR, "resume exiting due to stop") + return + } + } else { + c.persist.Del(key) // Unsubscribe packets should not be retained following a reconnect } case *packets.PubrelPacket: DEBUG.Println(STR, fmt.Sprintf("loaded pending pubrel (%d)", details.MessageID)) select { case c.oboundP <- &PacketAndToken{p: packet, t: nil}: case <-c.stop: + DEBUG.Println(STR, "resume exiting due to stop") + return } case *packets.PublishPacket: + // spec: If the DUP flag is set to 0, it indicates that this is the first occasion that the Client or + // Server has attempted to send this MQTT PUBLISH Packet. If the DUP flag is set to 1, it indicates that + // this might be re-delivery of an earlier attempt to send the Packet. + // + // If the message is in the store than an attempt at delivery has been made (note that the message may + // never have made it onto the wire but tracking that would be complicated!). + if p.Qos != 0 { // spec: The DUP flag MUST be set to 0 for all QoS 0 messages + p.Dup = true + } token := newToken(packets.Publish).(*PublishToken) token.messageID = details.MessageID c.claimID(token, details.MessageID) DEBUG.Println(STR, fmt.Sprintf("loaded pending publish (%d)", details.MessageID)) DEBUG.Println(STR, details) - c.obound <- &PacketAndToken{p: packet, t: token} + select { + case c.obound <- &PacketAndToken{p: p, t: token}: + case <-c.stop: + DEBUG.Println(STR, "resume exiting due to stop") + return + } default: ERROR.Println(STR, "invalid message type in store (discarded)") c.persist.Del(key) } } else { switch packet.(type) { - case *packets.PubrelPacket, *packets.PublishPacket: + case *packets.PubrelPacket: DEBUG.Println(STR, fmt.Sprintf("loaded pending incomming (%d)", details.MessageID)) select { - case c.ibound <- packet: + case ibound <- packet: case <-c.stop: + DEBUG.Println(STR, "resume exiting due to stop (ibound <- packet)") + return } default: ERROR.Println(STR, "invalid message type in store (discarded)") @@ -720,6 +997,7 @@ func (c *client) resume(subscription bool) { } } } + DEBUG.Println(STR, "exit resume") } // Unsubscribe will end the subscription from each of the topics provided. @@ -732,13 +1010,53 @@ func (c *client) Unsubscribe(topics ...string) Token { token.setError(ErrNotConnected) return token } + if !c.IsConnectionOpen() { + switch { + case !c.options.ResumeSubs: + // if not connected and resumesubs not set this unsub will be thrown away + token.setError(fmt.Errorf("not currently connected and ResumeSubs not set")) + return token + case c.options.CleanSession && c.connectionStatus() == reconnecting: + // if reconnecting and cleansession is true this unsub will be thrown away + token.setError(fmt.Errorf("reconnecting state and cleansession is true")) + return token + } + } unsub := packets.NewControlPacket(packets.Unsubscribe).(*packets.UnsubscribePacket) unsub.Topics = make([]string, len(topics)) copy(unsub.Topics, topics) - c.oboundP <- &PacketAndToken{p: unsub, t: token} - for _, topic := range topics { - c.msgRouter.deleteRoute(topic) + if unsub.MessageID == 0 { + mID := c.getID(token) + if mID == 0 { + token.setError(fmt.Errorf("no message IDs available")) + return token + } + unsub.MessageID = mID + token.messageID = mID + } + + persistOutbound(c.persist, unsub) + + switch c.connectionStatus() { + case connecting: + DEBUG.Println(CLI, "storing unsubscribe message (connecting), topics:", topics) + case reconnecting: + DEBUG.Println(CLI, "storing unsubscribe message (reconnecting), topics:", topics) + default: + DEBUG.Println(CLI, "sending unsubscribe message, topics:", topics) + subscribeWaitTimeout := c.options.WriteTimeout + if subscribeWaitTimeout == 0 { + subscribeWaitTimeout = time.Second * 30 + } + select { + case c.oboundP <- &PacketAndToken{p: unsub, t: token}: + for _, topic := range topics { + c.msgRouter.deleteRoute(topic) + } + case <-time.After(subscribeWaitTimeout): + token.setError(errors.New("unsubscribe was broken by timeout")) + } } DEBUG.Println(CLI, "exit Unsubscribe") @@ -752,8 +1070,43 @@ func (c *client) OptionsReader() ClientOptionsReader { return r } -//DefaultConnectionLostHandler is a definition of a function that simply -//reports to the DEBUG log the reason for the client losing a connection. +// DefaultConnectionLostHandler is a definition of a function that simply +// reports to the DEBUG log the reason for the client losing a connection. func DefaultConnectionLostHandler(client Client, reason error) { DEBUG.Println("Connection lost:", reason.Error()) } + +// UpdateLastReceived - Will be called whenever a packet is received off the network +// This is used by the keepalive routine to +func (c *client) UpdateLastReceived() { + if c.options.KeepAlive != 0 { + c.lastReceived.Store(time.Now()) + } +} + +// UpdateLastReceived - Will be called whenever a packet is successfully transmitted to the network +func (c *client) UpdateLastSent() { + if c.options.KeepAlive != 0 { + c.lastSent.Store(time.Now()) + } +} + +// getWriteTimeOut returns the writetimeout (duration to wait when writing to the connection) or 0 if none +func (c *client) getWriteTimeOut() time.Duration { + return c.options.WriteTimeout +} + +// persistOutbound adds the packet to the outbound store +func (c *client) persistOutbound(m packets.ControlPacket) { + persistOutbound(c.persist, m) +} + +// persistInbound adds the packet to the inbound store +func (c *client) persistInbound(m packets.ControlPacket) { + persistInbound(c.persist, m) +} + +// pingRespReceived will be called by the network routines when a ping response is received +func (c *client) pingRespReceived() { + atomic.StoreInt32(&c.pingOutstanding, 0) +} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/components.go b/vendor/github.com/eclipse/paho.mqtt.golang/components.go index 01f5fafdf8..23ade20edb 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/components.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/components.go @@ -28,4 +28,5 @@ const ( TST component = "[test] " STA component = "[state] " ERR component = "[error] " + ROU component = "[router] " ) diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/filestore.go b/vendor/github.com/eclipse/paho.mqtt.golang/filestore.go index c4a0d36b53..a4bc109290 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/filestore.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/filestore.go @@ -101,7 +101,7 @@ func (store *FileStore) Get(key string) packets.ControlPacket { store.RLock() defer store.RUnlock() if !store.opened { - ERROR.Println(STR, "Trying to use file store, but not open") + ERROR.Println(STR, "trying to use file store, but not open") return nil } filepath := fullpath(store.directory, key) @@ -117,14 +117,16 @@ func (store *FileStore) Get(key string) packets.ControlPacket { if rerr != nil { newpath := corruptpath(store.directory, key) WARN.Println(STR, "corrupted file detected:", rerr.Error(), "archived at:", newpath) - os.Rename(filepath, newpath) + if err := os.Rename(filepath, newpath); err != nil { + ERROR.Println(STR, err) + } return nil } return msg } // All will provide a list of all of the keys associated with messages -// currenly residing in the FileStore. +// currently residing in the FileStore. func (store *FileStore) All() []string { store.RLock() defer store.RUnlock() @@ -156,7 +158,7 @@ func (store *FileStore) all() []string { var files fileInfos if !store.opened { - ERROR.Println(STR, "Trying to use file store, but not open") + ERROR.Println(STR, "trying to use file store, but not open") return nil } @@ -166,7 +168,7 @@ func (store *FileStore) all() []string { for _, f := range files { DEBUG.Println(STR, "file in All():", f.Name()) name := f.Name() - if name[len(name)-4:len(name)] != msgExt { + if name[len(name)-4:] != msgExt { DEBUG.Println(STR, "skipping file, doesn't have right extension: ", name) continue } @@ -179,7 +181,7 @@ func (store *FileStore) all() []string { // lockless func (store *FileStore) del(key string) { if !store.opened { - ERROR.Println(STR, "Trying to use file store, but not open") + ERROR.Println(STR, "trying to use file store, but not open") return } DEBUG.Println(STR, "store del filepath:", store.directory) diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/go.mod b/vendor/github.com/eclipse/paho.mqtt.golang/go.mod new file mode 100644 index 0000000000..fcbd7872ef --- /dev/null +++ b/vendor/github.com/eclipse/paho.mqtt.golang/go.mod @@ -0,0 +1,8 @@ +module github.com/eclipse/paho.mqtt.golang + +go 1.14 + +require ( + github.com/gorilla/websocket v1.4.2 + golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 +) diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/go.sum b/vendor/github.com/eclipse/paho.mqtt.golang/go.sum new file mode 100644 index 0000000000..7095afb15b --- /dev/null +++ b/vendor/github.com/eclipse/paho.mqtt.golang/go.sum @@ -0,0 +1,8 @@ +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 h1:Jcxah/M+oLZ/R4/z5RzfPzGbPXnVDPkEDtf2JnuxN+U= +golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/memstore.go b/vendor/github.com/eclipse/paho.mqtt.golang/memstore.go index 499c490bdb..d245a5fb25 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/memstore.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/memstore.go @@ -88,7 +88,7 @@ func (store *MemoryStore) All() []string { ERROR.Println(STR, "Trying to use memory store, but not open") return nil } - keys := []string{} + var keys []string for k := range store.messages { keys = append(keys, k) } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/message.go b/vendor/github.com/eclipse/paho.mqtt.golang/message.go index 903e5dcf5e..0f8ca603e2 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/message.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/message.go @@ -16,9 +16,9 @@ package mqtt import ( "net/url" + "sync" "github.com/eclipse/paho.mqtt.golang/packets" - "sync" ) // Message defines the externals that a message implementation must support @@ -114,7 +114,7 @@ func newConnectMsgFromOptions(options *ClientOptions, broker *url.URL) *packets. if username != "" { m.UsernameFlag = true m.Username = username - //mustn't have password without user as well + // mustn't have password without user as well if password != "" { m.PasswordFlag = true m.Password = []byte(password) diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/messageids.go b/vendor/github.com/eclipse/paho.mqtt.golang/messageids.go index 9a5fa9fd15..26c2c0d201 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/messageids.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/messageids.go @@ -28,6 +28,8 @@ type MId uint16 type messageIds struct { sync.RWMutex index map[uint16]tokenCompletor + + lastIssuedID uint16 // The most recently issued ID. Used so we cycle through ids rather than immediately reusing them (can make debugging easier) } const ( @@ -40,11 +42,11 @@ func (mids *messageIds) cleanUp() { for _, token := range mids.index { switch token.(type) { case *PublishToken: - token.setError(fmt.Errorf("Connection lost before Publish completed")) + token.setError(fmt.Errorf("connection lost before Publish completed")) case *SubscribeToken: - token.setError(fmt.Errorf("Connection lost before Subscribe completed")) + token.setError(fmt.Errorf("connection lost before Subscribe completed")) case *UnsubscribeToken: - token.setError(fmt.Errorf("Connection lost before Unsubscribe completed")) + token.setError(fmt.Errorf("connection lost before Unsubscribe completed")) case nil: continue } @@ -71,18 +73,33 @@ func (mids *messageIds) claimID(token tokenCompletor, id uint16) { old.flowComplete() mids.index[id] = token } + if id > mids.lastIssuedID { + mids.lastIssuedID = id + } } +// getID will return an available id or 0 if none available +// The id will generally be the previous id + 1 (because this makes tracing messages a bit simpler) func (mids *messageIds) getID(t tokenCompletor) uint16 { mids.Lock() defer mids.Unlock() - for i := midMin; i < midMax; i++ { + i := mids.lastIssuedID // note: the only situation where lastIssuedID is 0 the map will be empty + looped := false // uint16 will loop from 65535->0 + for { + i++ + if i == 0 { // skip 0 because its not a valid id (Control Packets MUST contain a non-zero 16-bit Packet Identifier [MQTT-2.3.1-1]) + i++ + looped = true + } if _, ok := mids.index[i]; !ok { mids.index[i] = t + mids.lastIssuedID = i return i } + if (looped && i == mids.lastIssuedID) || (mids.lastIssuedID == 0 && i == midMax) { // lastIssuedID will be 0 at startup + return 0 // no free ids + } } - return 0 } func (mids *messageIds) getToken(id uint16) tokenCompletor { @@ -98,14 +115,23 @@ type DummyToken struct { id uint16 } +// Wait implements the Token Wait method. func (d *DummyToken) Wait() bool { return true } +// WaitTimeout implements the Token WaitTimeout method. func (d *DummyToken) WaitTimeout(t time.Duration) bool { return true } +// Done implements the Token Done method. +func (d *DummyToken) Done() <-chan struct{} { + ch := make(chan struct{}) + close(ch) + return ch +} + func (d *DummyToken) flowComplete() { ERROR.Printf("A lookup for token %d returned nil\n", d.id) } @@ -115,3 +141,36 @@ func (d *DummyToken) Error() error { } func (d *DummyToken) setError(e error) {} + +// PlaceHolderToken does nothing and was implemented to allow a messageid to be reserved +// it differs from DummyToken in that calling flowComplete does not generate an error (it +// is expected that flowComplete will be called when the token is overwritten with a real token) +type PlaceHolderToken struct { + id uint16 +} + +// Wait implements the Token Wait method. +func (p *PlaceHolderToken) Wait() bool { + return true +} + +// WaitTimeout implements the Token WaitTimeout method. +func (p *PlaceHolderToken) WaitTimeout(t time.Duration) bool { + return true +} + +// Done implements the Token Done method. +func (p *PlaceHolderToken) Done() <-chan struct{} { + ch := make(chan struct{}) + close(ch) + return ch +} + +func (p *PlaceHolderToken) flowComplete() { +} + +func (p *PlaceHolderToken) Error() error { + return nil +} + +func (p *PlaceHolderToken) setError(e error) {} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/net.go b/vendor/github.com/eclipse/paho.mqtt.golang/net.go index 3e6366be71..485bb2aab2 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/net.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/net.go @@ -15,341 +15,450 @@ package mqtt import ( - "crypto/tls" "errors" - "fmt" + "io" "net" - "net/http" - "net/url" - "os" "reflect" - "sync/atomic" + "strings" + "sync" "time" "github.com/eclipse/paho.mqtt.golang/packets" - "golang.org/x/net/proxy" - "golang.org/x/net/websocket" ) -func signalError(c chan<- error, err error) { - select { - case c <- err: +const closedNetConnErrorText = "use of closed network connection" // error string for closed conn (https://golang.org/src/net/error_test.go) + +// ConnectMQTT takes a connected net.Conn and performs the initial MQTT handshake. Parameters are: +// conn - Connected net.Conn +// cm - Connect Packet with everything other than the protocol name/version populated (historical reasons) +// protocolVersion - The protocol version to attempt to connect with +// +// Note that, for backward compatibility, ConnectMQTT() suppresses the actual connection error (compare to connectMQTT()). +func ConnectMQTT(conn net.Conn, cm *packets.ConnectPacket, protocolVersion uint) (byte, bool) { + rc, sessionPresent, _ := connectMQTT(conn, cm, protocolVersion) + return rc, sessionPresent +} + +func connectMQTT(conn io.ReadWriter, cm *packets.ConnectPacket, protocolVersion uint) (byte, bool, error) { + switch protocolVersion { + case 3: + DEBUG.Println(CLI, "Using MQTT 3.1 protocol") + cm.ProtocolName = "MQIsdp" + cm.ProtocolVersion = 3 + case 0x83: + DEBUG.Println(CLI, "Using MQTT 3.1b protocol") + cm.ProtocolName = "MQIsdp" + cm.ProtocolVersion = 0x83 + case 0x84: + DEBUG.Println(CLI, "Using MQTT 3.1.1b protocol") + cm.ProtocolName = "MQTT" + cm.ProtocolVersion = 0x84 default: + DEBUG.Println(CLI, "Using MQTT 3.1.1 protocol") + cm.ProtocolName = "MQTT" + cm.ProtocolVersion = 4 } -} -func openConnection(uri *url.URL, tlsc *tls.Config, timeout time.Duration, headers http.Header) (net.Conn, error) { - switch uri.Scheme { - case "ws": - config, _ := websocket.NewConfig(uri.String(), fmt.Sprintf("http://%s", uri.Host)) - config.Protocol = []string{"mqtt"} - config.Header = headers - config.Dialer = &net.Dialer{Timeout: timeout} - conn, err := websocket.DialConfig(config) - if err != nil { - return nil, err - } - conn.PayloadType = websocket.BinaryFrame - return conn, err - case "wss": - config, _ := websocket.NewConfig(uri.String(), fmt.Sprintf("https://%s", uri.Host)) - config.Protocol = []string{"mqtt"} - config.TlsConfig = tlsc - config.Header = headers - config.Dialer = &net.Dialer{Timeout: timeout} - conn, err := websocket.DialConfig(config) - if err != nil { - return nil, err - } - conn.PayloadType = websocket.BinaryFrame - return conn, err - case "tcp": - allProxy := os.Getenv("all_proxy") - if len(allProxy) == 0 { - conn, err := net.DialTimeout("tcp", uri.Host, timeout) - if err != nil { - return nil, err - } - return conn, nil - } - proxyDialer := proxy.FromEnvironment() + if err := cm.Write(conn); err != nil { + ERROR.Println(CLI, err) + return packets.ErrNetworkError, false, err + } - conn, err := proxyDialer.Dial("tcp", uri.Host) - if err != nil { - return nil, err - } - return conn, nil - case "unix": - conn, err := net.DialTimeout("unix", uri.Host, timeout) - if err != nil { - return nil, err - } - return conn, nil - case "ssl": - fallthrough - case "tls": - fallthrough - case "tcps": - allProxy := os.Getenv("all_proxy") - if len(allProxy) == 0 { - conn, err := tls.DialWithDialer(&net.Dialer{Timeout: timeout}, "tcp", uri.Host, tlsc) - if err != nil { - return nil, err - } - return conn, nil - } - proxyDialer := proxy.FromEnvironment() + rc, sessionPresent, err := verifyCONNACK(conn) + return rc, sessionPresent, err +} - conn, err := proxyDialer.Dial("tcp", uri.Host) - if err != nil { - return nil, err - } +// This function is only used for receiving a connack +// when the connection is first started. +// This prevents receiving incoming data while resume +// is in progress if clean session is false. +func verifyCONNACK(conn io.Reader) (byte, bool, error) { + DEBUG.Println(NET, "connect started") - tlsConn := tls.Client(conn, tlsc) + ca, err := packets.ReadPacket(conn) + if err != nil { + ERROR.Println(NET, "connect got error", err) + return packets.ErrNetworkError, false, err + } - err = tlsConn.Handshake() - if err != nil { - conn.Close() - return nil, err - } + if ca == nil { + ERROR.Println(NET, "received nil packet") + return packets.ErrNetworkError, false, errors.New("nil CONNACK packet") + } - return tlsConn, nil + msg, ok := ca.(*packets.ConnackPacket) + if !ok { + ERROR.Println(NET, "received msg that was not CONNACK") + return packets.ErrNetworkError, false, errors.New("non-CONNACK first packet received") } - return nil, errors.New("Unknown protocol") + + DEBUG.Println(NET, "received connack") + return msg.ReturnCode, msg.SessionPresent, nil +} + +// inbound encapsulates the output from startIncoming. +// err - If != nil then an error has occurred +// cp - A control packet received over the network link +type inbound struct { + err error + cp packets.ControlPacket } -// actually read incoming messages off the wire -// send Message object into ibound channel -func incoming(c *client) { +// startIncoming initiates a goroutine that reads incoming messages off the wire and sends them to the channel (returned). +// If there are any issues with the network connection then the returned channel will be closed and the goroutine will exit +// (so closing the connection will terminate the goroutine) +func startIncoming(conn io.Reader) <-chan inbound { var err error var cp packets.ControlPacket - - defer c.workers.Done() + ibound := make(chan inbound) DEBUG.Println(NET, "incoming started") - for { - if cp, err = packets.ReadPacket(c.conn); err != nil { - break - } - DEBUG.Println(NET, "Received Message") - select { - case c.ibound <- cp: - // Notify keepalive logic that we recently received a packet - if c.options.KeepAlive != 0 { - c.lastReceived.Store(time.Now()) + go func() { + for { + if cp, err = packets.ReadPacket(conn); err != nil { + // We do not want to log the error if it is due to the network connection having been closed + // elsewhere (i.e. after sending DisconnectPacket). Detecting this situation is the subject of + // https://github.com/golang/go/issues/4373 + if !strings.Contains(err.Error(), closedNetConnErrorText) { + ibound <- inbound{err: err} + } + close(ibound) + DEBUG.Println(NET, "incoming complete") + return } - case <-c.stop: - // This avoids a deadlock should a message arrive while shutting down. - // In that case the "reader" of c.ibound might already be gone - WARN.Println(NET, "incoming dropped a received message during shutdown") - break + DEBUG.Println(NET, "startIncoming Received Message") + ibound <- inbound{cp: cp} } - } - // We received an error on read. - // If disconnect is in progress, swallow error and return - select { - case <-c.stop: - DEBUG.Println(NET, "incoming stopped") - return - // Not trying to disconnect, send the error to the errors channel - default: - ERROR.Println(NET, "incoming stopped with error", err) - signalError(c.errors, err) - return - } -} + }() -// receive a Message object on obound, and then -// actually send outgoing message to the wire -func outgoing(c *client) { - defer c.workers.Done() - DEBUG.Println(NET, "outgoing started") + return ibound +} - for { - DEBUG.Println(NET, "outgoing waiting for an outbound message") - select { - case <-c.stop: - DEBUG.Println(NET, "outgoing stopped") - return - case pub := <-c.obound: - msg := pub.p.(*packets.PublishPacket) - - if c.options.WriteTimeout > 0 { - c.conn.SetWriteDeadline(time.Now().Add(c.options.WriteTimeout)) - } +// incomingComms encapsulates the possible output of the incomingComms routine. If err != nil then an error has occurred and +// the routine will have terminated; otherwise one of the other members should be non-nil +type incomingComms struct { + err error // If non-nil then there has been an error (ignore everything else) + outbound *PacketAndToken // Packet (with token) than needs to be sent out (e.g. an acknowledgement) + incomingPub *packets.PublishPacket // A new publish has been received; this will need to be passed on to our user +} - if err := msg.Write(c.conn); err != nil { - ERROR.Println(NET, "outgoing stopped with error", err) - pub.t.setError(err) - signalError(c.errors, err) - return - } +// startIncomingComms initiates incoming communications; this includes starting a goroutine to process incoming +// messages. +// Accepts a channel of inbound messages from the store (persisted messages); note this must be closed as soon as the +// everything in the store has been sent. +// Returns a channel that will be passed any received packets; this will be closed on a network error (and inboundFromStore closed) +func startIncomingComms(conn io.Reader, + c commsFns, + inboundFromStore <-chan packets.ControlPacket, +) <-chan incomingComms { + ibound := startIncoming(conn) // Start goroutine that reads from network connection + output := make(chan incomingComms) - if c.options.WriteTimeout > 0 { - // If we successfully wrote, we don't want the timeout to happen during an idle period - // so we reset it to infinite. - c.conn.SetWriteDeadline(time.Time{}) + DEBUG.Println(NET, "startIncomingComms started") + go func() { + for { + if inboundFromStore == nil && ibound == nil { + close(output) + DEBUG.Println(NET, "startIncomingComms goroutine complete") + return // As soon as ibound is closed we can exit (should have already processed an error) } + DEBUG.Println(NET, "logic waiting for msg on ibound") - if msg.Qos == 0 { - pub.t.flowComplete() - } - DEBUG.Println(NET, "obound wrote msg, id:", msg.MessageID) - case msg := <-c.oboundP: - switch msg.p.(type) { - case *packets.SubscribePacket: - msg.p.(*packets.SubscribePacket).MessageID = c.getID(msg.t) - case *packets.UnsubscribePacket: - msg.p.(*packets.UnsubscribePacket).MessageID = c.getID(msg.t) - } - DEBUG.Println(NET, "obound priority msg to write, type", reflect.TypeOf(msg.p)) - if err := msg.p.Write(c.conn); err != nil { - ERROR.Println(NET, "outgoing stopped with error", err) - if msg.t != nil { - msg.t.setError(err) + var msg packets.ControlPacket + var ok bool + select { + case msg, ok = <-inboundFromStore: + if !ok { + DEBUG.Println(NET, "startIncomingComms: inboundFromStore complete") + inboundFromStore = nil // should happen quickly as this is only for persisted messages + continue } - signalError(c.errors, err) - return - } - switch msg.p.(type) { - case *packets.DisconnectPacket: - msg.t.(*DisconnectToken).flowComplete() - DEBUG.Println(NET, "outbound wrote disconnect, stopping") - return + DEBUG.Println(NET, "startIncomingComms: got msg from store") + case ibMsg, ok := <-ibound: + if !ok { + DEBUG.Println(NET, "startIncomingComms: ibound complete") + ibound = nil + continue + } + DEBUG.Println(NET, "startIncomingComms: got msg on ibound") + // If the inbound comms routine encounters any issues it will send us an error. + if ibMsg.err != nil { + output <- incomingComms{err: ibMsg.err} + continue // Usually the channel will be closed immediately after sending an error but safer that we do not assume this + } + msg = ibMsg.cp + + c.persistInbound(msg) + c.UpdateLastReceived() // Notify keepalive logic that we recently received a packet } - } - // Reset ping timer after sending control packet. - if c.options.KeepAlive != 0 { - c.lastSent.Store(time.Now()) - } - } -} -// receive Message objects on ibound -// store messages if necessary -// send replies on obound -// delete messages from store if necessary -func alllogic(c *client) { - defer c.workers.Done() - DEBUG.Println(NET, "logic started") - - for { - DEBUG.Println(NET, "logic waiting for msg on ibound") - - select { - case msg := <-c.ibound: - DEBUG.Println(NET, "logic got msg on ibound") - persistInbound(c.persist, msg) switch m := msg.(type) { case *packets.PingrespPacket: - DEBUG.Println(NET, "received pingresp") - atomic.StoreInt32(&c.pingOutstanding, 0) + DEBUG.Println(NET, "startIncomingComms: received pingresp") + c.pingRespReceived() case *packets.SubackPacket: - DEBUG.Println(NET, "received suback, id:", m.MessageID) + DEBUG.Println(NET, "startIncomingComms: received suback, id:", m.MessageID) token := c.getToken(m.MessageID) - switch t := token.(type) { - case *SubscribeToken: - DEBUG.Println(NET, "granted qoss", m.ReturnCodes) + + if t, ok := token.(*SubscribeToken); ok { + DEBUG.Println(NET, "startIncomingComms: granted qoss", m.ReturnCodes) for i, qos := range m.ReturnCodes { t.subResult[t.subs[i]] = qos } } + token.flowComplete() c.freeID(m.MessageID) case *packets.UnsubackPacket: - DEBUG.Println(NET, "received unsuback, id:", m.MessageID) + DEBUG.Println(NET, "startIncomingComms: received unsuback, id:", m.MessageID) c.getToken(m.MessageID).flowComplete() c.freeID(m.MessageID) case *packets.PublishPacket: - DEBUG.Println(NET, "received publish, msgId:", m.MessageID) - DEBUG.Println(NET, "putting msg on onPubChan") - switch m.Qos { - case 2: - c.incomingPubChan <- m - DEBUG.Println(NET, "done putting msg on incomingPubChan") - case 1: - c.incomingPubChan <- m - DEBUG.Println(NET, "done putting msg on incomingPubChan") - case 0: - select { - case c.incomingPubChan <- m: - case <-c.stop: - } - DEBUG.Println(NET, "done putting msg on incomingPubChan") - } + DEBUG.Println(NET, "startIncomingComms: received publish, msgId:", m.MessageID) + output <- incomingComms{incomingPub: m} case *packets.PubackPacket: - DEBUG.Println(NET, "received puback, id:", m.MessageID) - // c.receipts.get(msg.MsgId()) <- Receipt{} - // c.receipts.end(msg.MsgId()) + DEBUG.Println(NET, "startIncomingComms: received puback, id:", m.MessageID) c.getToken(m.MessageID).flowComplete() c.freeID(m.MessageID) case *packets.PubrecPacket: - DEBUG.Println(NET, "received pubrec, id:", m.MessageID) + DEBUG.Println(NET, "startIncomingComms: received pubrec, id:", m.MessageID) prel := packets.NewControlPacket(packets.Pubrel).(*packets.PubrelPacket) prel.MessageID = m.MessageID - select { - case c.oboundP <- &PacketAndToken{p: prel, t: nil}: - case <-c.stop: - } + output <- incomingComms{outbound: &PacketAndToken{p: prel, t: nil}} case *packets.PubrelPacket: - DEBUG.Println(NET, "received pubrel, id:", m.MessageID) + DEBUG.Println(NET, "startIncomingComms: received pubrel, id:", m.MessageID) pc := packets.NewControlPacket(packets.Pubcomp).(*packets.PubcompPacket) pc.MessageID = m.MessageID - persistOutbound(c.persist, pc) - select { - case c.oboundP <- &PacketAndToken{p: pc, t: nil}: - case <-c.stop: - } + c.persistOutbound(pc) + output <- incomingComms{outbound: &PacketAndToken{p: pc, t: nil}} case *packets.PubcompPacket: - DEBUG.Println(NET, "received pubcomp, id:", m.MessageID) + DEBUG.Println(NET, "startIncomingComms: received pubcomp, id:", m.MessageID) c.getToken(m.MessageID).flowComplete() c.freeID(m.MessageID) } - case <-c.stop: - WARN.Println(NET, "logic stopped") - return } - } + }() + return output } -func (c *client) ackFunc(packet *packets.PublishPacket) func() { +// startOutgoingComms initiates a go routine to transmit outgoing packets. +// Pass in an open network connection and channels for outbound messages (including those triggered +// directly from incoming comms). +// Returns a channel that will receive details of any errors (closed when the goroutine exits) +// This function wil only terminate when all input channels are closed +func startOutgoingComms(conn net.Conn, + c commsFns, + oboundp <-chan *PacketAndToken, + obound <-chan *PacketAndToken, + oboundFromIncoming <-chan *PacketAndToken, +) <-chan error { + errChan := make(chan error) + DEBUG.Println(NET, "outgoing started") + + go func() { + for { + DEBUG.Println(NET, "outgoing waiting for an outbound message") + + // This goroutine will only exits when all of the input channels we receive on have been closed. This approach is taken to avoid any + // deadlocks (if the connection goes down there are limited options as to what we can do with anything waiting on us and + // throwing away the packets seems the best option) + if oboundp == nil && obound == nil && oboundFromIncoming == nil { + DEBUG.Println(NET, "outgoing comms stopping") + close(errChan) + return + } + + select { + case pub, ok := <-obound: + if !ok { + obound = nil + continue + } + msg := pub.p.(*packets.PublishPacket) + DEBUG.Println(NET, "obound msg to write", msg.MessageID) + + writeTimeout := c.getWriteTimeOut() + if writeTimeout > 0 { + if err := conn.SetWriteDeadline(time.Now().Add(writeTimeout)); err != nil { + ERROR.Println(NET, "SetWriteDeadline ", err) + } + } + + if err := msg.Write(conn); err != nil { + ERROR.Println(NET, "outgoing obound reporting error ", err) + pub.t.setError(err) + // report error if it's not due to the connection being closed elsewhere + if !strings.Contains(err.Error(), closedNetConnErrorText) { + errChan <- err + } + continue + } + + if writeTimeout > 0 { + // If we successfully wrote, we don't want the timeout to happen during an idle period + // so we reset it to infinite. + if err := conn.SetWriteDeadline(time.Time{}); err != nil { + ERROR.Println(NET, "SetWriteDeadline to 0 ", err) + } + } + + if msg.Qos == 0 { + pub.t.flowComplete() + } + DEBUG.Println(NET, "obound wrote msg, id:", msg.MessageID) + case msg, ok := <-oboundp: + if !ok { + oboundp = nil + continue + } + DEBUG.Println(NET, "obound priority msg to write, type", reflect.TypeOf(msg.p)) + if err := msg.p.Write(conn); err != nil { + ERROR.Println(NET, "outgoing oboundp reporting error ", err) + if msg.t != nil { + msg.t.setError(err) + } + errChan <- err + continue + } + + if _, ok := msg.p.(*packets.DisconnectPacket); ok { + msg.t.(*DisconnectToken).flowComplete() + DEBUG.Println(NET, "outbound wrote disconnect, closing connection") + // As per the MQTT spec "After sending a DISCONNECT Packet the Client MUST close the Network Connection" + // Closing the connection will cause the goroutines to end in sequence (starting with incoming comms) + conn.Close() + } + case msg, ok := <-oboundFromIncoming: // message triggered by an inbound message (PubrecPacket or PubrelPacket) + if !ok { + oboundFromIncoming = nil + continue + } + DEBUG.Println(NET, "obound from incoming msg to write, type", reflect.TypeOf(msg.p), " ID ", msg.p.Details().MessageID) + if err := msg.p.Write(conn); err != nil { + ERROR.Println(NET, "outgoing oboundFromIncoming reporting error", err) + if msg.t != nil { + msg.t.setError(err) + } + errChan <- err + continue + } + } + c.UpdateLastSent() // Record that a packet has been received (for keepalive routine) + } + }() + return errChan +} + +// commsFns provide access to the client state (messageids, requesting disconnection and updating timing) +type commsFns interface { + getToken(id uint16) tokenCompletor // Retrieve the token for the specified messageid (if none then a dummy token must be returned) + freeID(id uint16) // Release the specified messageid (clearing out of any persistent store) + UpdateLastReceived() // Must be called whenever a packet is received + UpdateLastSent() // Must be called whenever a packet is successfully sent + getWriteTimeOut() time.Duration // Return the writetimeout (or 0 if none) + persistOutbound(m packets.ControlPacket) // add the packet to the outbound store + persistInbound(m packets.ControlPacket) // add the packet to the inbound store + pingRespReceived() // Called when a ping response is received +} + +// startComms initiates goroutines that handles communications over the network connection +// Messages will be stored (via commsFns) and deleted from the store as necessary +// It returns two channels: +// packets.PublishPacket - Will receive publish packets received over the network. +// Closed when incoming comms routines exit (on shutdown or if network link closed) +// error - Any errors will be sent on this channel. The channel is closed when all comms routines have shut down +// +// Note: The comms routines monitoring oboundp and obound will not shutdown until those channels are both closed. Any messages received between the +// connection being closed and those channels being closed will generate errors (and nothing will be sent). That way the chance of a deadlock is +// minimised. +func startComms(conn net.Conn, // Network connection (must be active) + c commsFns, // getters and setters to enable us to cleanly interact with client + inboundFromStore <-chan packets.ControlPacket, // Inbound packets from the persistence store (should be closed relatively soon after startup) + oboundp <-chan *PacketAndToken, + obound <-chan *PacketAndToken) ( + <-chan *packets.PublishPacket, // Publishpackages received over the network + <-chan error, // Any errors (should generally trigger a disconnect) +) { + // Start inbound comms handler; this needs to be able to transmit messages so we start a go routine to add these to the priority outbound channel + ibound := startIncomingComms(conn, c, inboundFromStore) + outboundFromIncoming := make(chan *PacketAndToken) // Will accept outgoing messages triggered by startIncomingComms (e.g. acknowledgements) + + // Start the outgoing handler. It is important to note that output from startIncomingComms is fed into startOutgoingComms (for ACK's) + oboundErr := startOutgoingComms(conn, c, oboundp, obound, outboundFromIncoming) + DEBUG.Println(NET, "startComms started") + + // Run up go routines to handle the output from the above comms functions - these are handled in separate + // go routines because they can interact (e.g. ibound triggers an ACK to obound which triggers an error) + var wg sync.WaitGroup + wg.Add(2) + + outPublish := make(chan *packets.PublishPacket) + outError := make(chan error) + + // Any messages received get passed to the appropriate channel + go func() { + for ic := range ibound { + if ic.err != nil { + outError <- ic.err + continue + } + if ic.outbound != nil { + outboundFromIncoming <- ic.outbound + continue + } + if ic.incomingPub != nil { + outPublish <- ic.incomingPub + continue + } + ERROR.Println(STR, "startComms received empty incomingComms msg") + } + // Close channels that will not be written to again (allowing other routines to exit) + close(outboundFromIncoming) + close(outPublish) + wg.Done() + }() + + // Any errors will be passed out to our caller + go func() { + for err := range oboundErr { + outError <- err + } + wg.Done() + }() + + // outError is used by both routines so can only be closed when they are both complete + go func() { + wg.Wait() + close(outError) + DEBUG.Println(NET, "startComms closing outError") + }() + + return outPublish, outError +} + +// ackFunc acknowledges a packet +// WARNING the function returned must not be called if the comms routine is shutting down or not running +// (it needs outgoing comms in order to send the acknowledgement). Currently this is only called from +// matchAndDispatch which will be shutdown before the comms are +func ackFunc(oboundP chan *PacketAndToken, persist Store, packet *packets.PublishPacket) func() { return func() { switch packet.Qos { case 2: pr := packets.NewControlPacket(packets.Pubrec).(*packets.PubrecPacket) pr.MessageID = packet.MessageID DEBUG.Println(NET, "putting pubrec msg on obound") - select { - case c.oboundP <- &PacketAndToken{p: pr, t: nil}: - case <-c.stop: - } + oboundP <- &PacketAndToken{p: pr, t: nil} DEBUG.Println(NET, "done putting pubrec msg on obound") case 1: pa := packets.NewControlPacket(packets.Puback).(*packets.PubackPacket) pa.MessageID = packet.MessageID DEBUG.Println(NET, "putting puback msg on obound") - persistOutbound(c.persist, pa) - select { - case c.oboundP <- &PacketAndToken{p: pa, t: nil}: - case <-c.stop: - } + persistOutbound(persist, pa) + oboundP <- &PacketAndToken{p: pa, t: nil} DEBUG.Println(NET, "done putting puback msg on obound") case 0: // do nothing, since there is no need to send an ack packet back } } } - -func errorWatch(c *client) { - defer c.workers.Done() - select { - case <-c.stop: - WARN.Println(NET, "errorWatch stopped") - return - case err := <-c.errors: - ERROR.Println(NET, "error triggered, stopping") - go c.internalConnLost(err) - return - } -} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/netconn.go b/vendor/github.com/eclipse/paho.mqtt.golang/netconn.go new file mode 100644 index 0000000000..0cb6cd16db --- /dev/null +++ b/vendor/github.com/eclipse/paho.mqtt.golang/netconn.go @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013 IBM Corp. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Seth Hoenig + * Allan Stockdill-Mander + * Mike Robertson + */ + +package mqtt + +import ( + "crypto/tls" + "errors" + "net" + "net/http" + "net/url" + "os" + "time" + + "golang.org/x/net/proxy" +) + +// +// This just establishes the network connection; once established the type of connection should be irrelevant +// + +// openConnection opens a network connection using the protocol indicated in the URL. +// Does not carry out any MQTT specific handshakes. +func openConnection(uri *url.URL, tlsc *tls.Config, timeout time.Duration, headers http.Header, websocketOptions *WebsocketOptions) (net.Conn, error) { + switch uri.Scheme { + case "ws": + conn, err := NewWebsocket(uri.String(), nil, timeout, headers, websocketOptions) + return conn, err + case "wss": + conn, err := NewWebsocket(uri.String(), tlsc, timeout, headers, websocketOptions) + return conn, err + case "mqtt", "tcp": + allProxy := os.Getenv("all_proxy") + if len(allProxy) == 0 { + conn, err := net.DialTimeout("tcp", uri.Host, timeout) + if err != nil { + return nil, err + } + return conn, nil + } + proxyDialer := proxy.FromEnvironment() + + conn, err := proxyDialer.Dial("tcp", uri.Host) + if err != nil { + return nil, err + } + return conn, nil + case "unix": + conn, err := net.DialTimeout("unix", uri.Host, timeout) + if err != nil { + return nil, err + } + return conn, nil + case "ssl", "tls", "mqtts", "mqtt+ssl", "tcps": + allProxy := os.Getenv("all_proxy") + if len(allProxy) == 0 { + conn, err := tls.DialWithDialer(&net.Dialer{Timeout: timeout}, "tcp", uri.Host, tlsc) + if err != nil { + return nil, err + } + return conn, nil + } + proxyDialer := proxy.FromEnvironment() + + conn, err := proxyDialer.Dial("tcp", uri.Host) + if err != nil { + return nil, err + } + + tlsConn := tls.Client(conn, tlsc) + + err = tlsConn.Handshake() + if err != nil { + _ = conn.Close() + return nil, err + } + + return tlsConn, nil + } + return nil, errors.New("unknown protocol") +} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/options.go b/vendor/github.com/eclipse/paho.mqtt.golang/options.go index e96e9ed7c2..4a1420c179 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/options.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/options.go @@ -10,6 +10,7 @@ * Seth Hoenig * Allan Stockdill-Mander * Mike Robertson + * Måns Ansgariusson */ // Portions copyright © 2018 TIBCO Software Inc. @@ -44,7 +45,15 @@ type ConnectionLostHandler func(Client, error) // at initial connection and on reconnection type OnConnectHandler func(Client) -// ClientOptions contains configurable options for an Client. +// ReconnectHandler is invoked prior to reconnecting after +// the initial connection is lost +type ReconnectHandler func(Client, *ClientOptions) + +// ConnectionAttemptHandler is invoked prior to making the initial connection. +type ConnectionAttemptHandler func(broker *url.URL, tlsCfg *tls.Config) *tls.Config + +// ClientOptions contains configurable options for an Client. Note that these should be set using the +// relevant methods (e.g. AddBroker) rather than directly. See those functions for information on usage. type ClientOptions struct { Servers []*url.URL ClientID string @@ -66,21 +75,26 @@ type ClientOptions struct { ConnectTimeout time.Duration MaxReconnectInterval time.Duration AutoReconnect bool + ConnectRetryInterval time.Duration + ConnectRetry bool Store Store DefaultPublishHandler MessageHandler OnConnect OnConnectHandler OnConnectionLost ConnectionLostHandler + OnReconnecting ReconnectHandler + OnConnectAttempt ConnectionAttemptHandler WriteTimeout time.Duration MessageChannelDepth uint ResumeSubs bool HTTPHeaders http.Header + WebsocketOptions *WebsocketOptions } // NewClientOptions will create a new ClientClientOptions type with some // default values. // Port: 1883 // CleanSession: True -// Order: True +// Order: True (note: it is recommended that this be set to FALSE unless order is important) // KeepAlive: 30 (seconds) // ConnectTimeout: 30 (seconds) // MaxReconnectInterval 10 (minutes) @@ -105,13 +119,16 @@ func NewClientOptions() *ClientOptions { ConnectTimeout: 30 * time.Second, MaxReconnectInterval: 10 * time.Minute, AutoReconnect: true, + ConnectRetryInterval: 30 * time.Second, + ConnectRetry: false, Store: nil, OnConnect: nil, OnConnectionLost: DefaultConnectionLostHandler, + OnConnectAttempt: nil, WriteTimeout: 0, // 0 represents timeout disabled - MessageChannelDepth: 100, ResumeSubs: false, HTTPHeaders: make(map[string][]string), + WebsocketOptions: &WebsocketOptions{}, } return o } @@ -149,7 +166,7 @@ func (o *ClientOptions) SetResumeSubs(resume bool) *ClientOptions { // SetClientID will set the client id to be used by this client when // connecting to the MQTT broker. According to the MQTT v3.1 specification, -// a client id mus be no longer than 23 characters. +// a client id must be no longer than 23 characters. func (o *ClientOptions) SetClientID(id string) *ClientOptions { o.ClientID = id return o @@ -157,7 +174,7 @@ func (o *ClientOptions) SetClientID(id string) *ClientOptions { // SetUsername will set the username to be used by this client when connecting // to the MQTT broker. Note: without the use of SSL/TLS, this information will -// be sent in plaintext accross the wire. +// be sent in plaintext across the wire. func (o *ClientOptions) SetUsername(u string) *ClientOptions { o.Username = u return o @@ -165,7 +182,7 @@ func (o *ClientOptions) SetUsername(u string) *ClientOptions { // SetPassword will set the password to be used by this client when connecting // to the MQTT broker. Note: without the use of SSL/TLS, this information will -// be sent in plaintext accross the wire. +// be sent in plaintext across the wire. func (o *ClientOptions) SetPassword(p string) *ClientOptions { o.Password = p return o @@ -174,7 +191,7 @@ func (o *ClientOptions) SetPassword(p string) *ClientOptions { // SetCredentialsProvider will set a method to be called by this client when // connecting to the MQTT broker that provide the current username and password. // Note: without the use of SSL/TLS, this information will be sent -// in plaintext accross the wire. +// in plaintext across the wire. func (o *ClientOptions) SetCredentialsProvider(p CredentialsProvider) *ClientOptions { o.CredentialsProvider = p return o @@ -184,7 +201,7 @@ func (o *ClientOptions) SetCredentialsProvider(p CredentialsProvider) *ClientOpt // when this client connects to an MQTT broker. By setting this flag, you are // indicating that no messages saved by the broker for this client should be // delivered. Any messages that were going to be sent by this client before -// diconnecting previously but didn't will not be sent upon connecting to the +// disconnecting previously but didn't will not be sent upon connecting to the // broker. func (o *ClientOptions) SetCleanSession(clean bool) *ClientOptions { o.CleanSession = clean @@ -192,9 +209,13 @@ func (o *ClientOptions) SetCleanSession(clean bool) *ClientOptions { } // SetOrderMatters will set the message routing to guarantee order within -// each QoS level. By default, this value is true. If set to false, +// each QoS level. By default, this value is true. If set to false (recommended), // this flag indicates that messages can be delivered asynchronously // from the client to the application and possibly arrive out of order. +// Specifically, the message handler is called in its own go routine. +// Note that setting this to true does not guarantee in-order delivery +// (this is subject to broker settings like "max_inflight_messages=1" in mosquitto) +// and if true then handlers must not block. func (o *ClientOptions) SetOrderMatters(order bool) *ClientOptions { o.Order = order return o @@ -274,6 +295,11 @@ func (o *ClientOptions) SetBinaryWill(topic string, payload []byte, qos byte, re // SetDefaultPublishHandler sets the MessageHandler that will be called when a message // is received that does not match any known subscriptions. +// +// If OrderMatters is true (the defaultHandler) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in +// a new go routine. +// defaultHandler must be safe for concurrent use by multiple goroutines. func (o *ClientOptions) SetDefaultPublishHandler(defaultHandler MessageHandler) *ClientOptions { o.DefaultPublishHandler = defaultHandler return o @@ -293,15 +319,31 @@ func (o *ClientOptions) SetConnectionLostHandler(onLost ConnectionLostHandler) * return o } +// SetReconnectingHandler sets the OnReconnecting callback to be executed prior +// to the client attempting a reconnect to the MQTT broker. +func (o *ClientOptions) SetReconnectingHandler(cb ReconnectHandler) *ClientOptions { + o.OnReconnecting = cb + return o +} + +// SetConnectionAttemptHandler sets the ConnectionAttemptHandler callback to be executed prior +// to each attempt to connect to an MQTT broker. Returns the *tls.Config that will be used when establishing +// the connection (a copy of the tls.Config from ClientOptions will be passed in along with the broker URL). +// This allows connection specific changes to be made to the *tls.Config. +func (o *ClientOptions) SetConnectionAttemptHandler(onConnectAttempt ConnectionAttemptHandler) *ClientOptions { + o.OnConnectAttempt = onConnectAttempt + return o +} + // SetWriteTimeout puts a limit on how long a mqtt publish should block until it unblocks with a -// timeout error. A duration of 0 never times out. Default 30 seconds +// timeout error. A duration of 0 never times out. Default never times out func (o *ClientOptions) SetWriteTimeout(t time.Duration) *ClientOptions { o.WriteTimeout = t return o } // SetConnectTimeout limits how long the client will wait when trying to open a connection -// to an MQTT server before timeing out and erroring the attempt. A duration of 0 never times out. +// to an MQTT server before timing out. A duration of 0 never times out. // Default 30 seconds. Currently only operational on TCP/TLS connections. func (o *ClientOptions) SetConnectTimeout(t time.Duration) *ClientOptions { o.ConnectTimeout = t @@ -323,10 +365,25 @@ func (o *ClientOptions) SetAutoReconnect(a bool) *ClientOptions { return o } -// SetMessageChannelDepth sets the size of the internal queue that holds messages while the -// client is temporairily offline, allowing the application to publish when the client is -// reconnecting. This setting is only valid if AutoReconnect is set to true, it is otherwise -// ignored. +// SetConnectRetryInterval sets the time that will be waited between connection attempts +// when initially connecting if ConnectRetry is TRUE +func (o *ClientOptions) SetConnectRetryInterval(t time.Duration) *ClientOptions { + o.ConnectRetryInterval = t + return o +} + +// SetConnectRetry sets whether the connect function will automatically retry the connection +// in the event of a failure (when true the token returned by the Connect function will +// not complete until the connection is up or it is cancelled) +// If ConnectRetry is true then subscriptions should be requested in OnConnect handler +// Setting this to TRUE permits messages to be published before the connection is established +func (o *ClientOptions) SetConnectRetry(a bool) *ClientOptions { + o.ConnectRetry = a + return o +} + +// SetMessageChannelDepth DEPRECATED The value set here no longer has any effect, this function +// remains so the API is not altered. func (o *ClientOptions) SetMessageChannelDepth(s uint) *ClientOptions { o.MessageChannelDepth = s return o @@ -338,3 +395,9 @@ func (o *ClientOptions) SetHTTPHeaders(h http.Header) *ClientOptions { o.HTTPHeaders = h return o } + +// SetWebsocketOptions sets the additional websocket options used in a WebSocket connection +func (o *ClientOptions) SetWebsocketOptions(w *WebsocketOptions) *ClientOptions { + o.WebsocketOptions = w + return o +} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/options_reader.go b/vendor/github.com/eclipse/paho.mqtt.golang/options_reader.go index 60144b93c8..7ff240fef8 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/options_reader.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/options_reader.go @@ -26,7 +26,7 @@ type ClientOptionsReader struct { options *ClientOptions } -//Servers returns a slice of the servers defined in the clientoptions +// Servers returns a slice of the servers defined in the clientoptions func (r *ClientOptionsReader) Servers() []*url.URL { s := make([]*url.URL, len(r.options.Servers)) @@ -38,31 +38,31 @@ func (r *ClientOptionsReader) Servers() []*url.URL { return s } -//ResumeSubs returns true if resuming stored (un)sub is enabled +// ResumeSubs returns true if resuming stored (un)sub is enabled func (r *ClientOptionsReader) ResumeSubs() bool { s := r.options.ResumeSubs return s } -//ClientID returns the set client id +// ClientID returns the set client id func (r *ClientOptionsReader) ClientID() string { s := r.options.ClientID return s } -//Username returns the set username +// Username returns the set username func (r *ClientOptionsReader) Username() string { s := r.options.Username return s } -//Password returns the set password +// Password returns the set password func (r *ClientOptionsReader) Password() string { s := r.options.Password return s } -//CleanSession returns whether Cleansession is set +// CleanSession returns whether Cleansession is set func (r *ClientOptionsReader) CleanSession() bool { s := r.options.CleanSession return s @@ -133,6 +133,18 @@ func (r *ClientOptionsReader) AutoReconnect() bool { return s } +// ConnectRetryInterval returns the delay between retries on the initial connection (if ConnectRetry true) +func (r *ClientOptionsReader) ConnectRetryInterval() time.Duration { + s := r.options.ConnectRetryInterval + return s +} + +// ConnectRetry returns whether the initial connection request will be retried until connection established +func (r *ClientOptionsReader) ConnectRetry() bool { + s := r.options.ConnectRetry + return s +} + func (r *ClientOptionsReader) WriteTimeout() time.Duration { s := r.options.WriteTimeout return s @@ -147,3 +159,9 @@ func (r *ClientOptionsReader) HTTPHeaders() http.Header { h := r.options.HTTPHeaders return h } + +// WebsocketOptions returns the currently configured WebSocket options +func (r *ClientOptionsReader) WebsocketOptions() *WebsocketOptions { + s := r.options.WebsocketOptions + return s +} diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/connack.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/connack.go index 25cf30f63d..1a0dc954ab 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/connack.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/connack.go @@ -6,8 +6,8 @@ import ( "io" ) -//ConnackPacket is an internal representation of the fields of the -//Connack MQTT packet +// ConnackPacket is an internal representation of the fields of the +// Connack MQTT packet type ConnackPacket struct { FixedHeader SessionPresent bool @@ -15,10 +15,7 @@ type ConnackPacket struct { } func (ca *ConnackPacket) String() string { - str := fmt.Sprintf("%s", ca.FixedHeader) - str += " " - str += fmt.Sprintf("sessionpresent: %t returncode: %d", ca.SessionPresent, ca.ReturnCode) - return str + return fmt.Sprintf("%s sessionpresent: %t returncode: %d", ca.FixedHeader, ca.SessionPresent, ca.ReturnCode) } func (ca *ConnackPacket) Write(w io.Writer) error { @@ -35,8 +32,8 @@ func (ca *ConnackPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (ca *ConnackPacket) Unpack(b io.Reader) error { flags, err := decodeByte(b) if err != nil { @@ -48,8 +45,8 @@ func (ca *ConnackPacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (ca *ConnackPacket) Details() Details { return Details{Qos: 0, MessageID: 0} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/connect.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/connect.go index cb03ebc073..2184703bd0 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/connect.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/connect.go @@ -6,8 +6,8 @@ import ( "io" ) -//ConnectPacket is an internal representation of the fields of the -//Connect MQTT packet +// ConnectPacket is an internal representation of the fields of the +// Connect MQTT packet type ConnectPacket struct { FixedHeader ProtocolName string @@ -29,10 +29,11 @@ type ConnectPacket struct { } func (c *ConnectPacket) String() string { - str := fmt.Sprintf("%s", c.FixedHeader) - str += " " - str += fmt.Sprintf("protocolversion: %d protocolname: %s cleansession: %t willflag: %t WillQos: %d WillRetain: %t Usernameflag: %t Passwordflag: %t keepalive: %d clientId: %s willtopic: %s willmessage: %s Username: %s Password: %s", c.ProtocolVersion, c.ProtocolName, c.CleanSession, c.WillFlag, c.WillQos, c.WillRetain, c.UsernameFlag, c.PasswordFlag, c.Keepalive, c.ClientIdentifier, c.WillTopic, c.WillMessage, c.Username, c.Password) - return str + var password string + if len(c.Password) > 0 { + password = "" + } + return fmt.Sprintf("%s protocolversion: %d protocolname: %s cleansession: %t willflag: %t WillQos: %d WillRetain: %t Usernameflag: %t Passwordflag: %t keepalive: %d clientId: %s willtopic: %s willmessage: %s Username: %s Password: %s", c.FixedHeader, c.ProtocolVersion, c.ProtocolName, c.CleanSession, c.WillFlag, c.WillQos, c.WillRetain, c.UsernameFlag, c.PasswordFlag, c.Keepalive, c.ClientIdentifier, c.WillTopic, c.WillMessage, c.Username, password) } func (c *ConnectPacket) Write(w io.Writer) error { @@ -62,8 +63,8 @@ func (c *ConnectPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (c *ConnectPacket) Unpack(b io.Reader) error { var err error c.ProtocolName, err = decodeString(b) @@ -119,36 +120,36 @@ func (c *ConnectPacket) Unpack(b io.Reader) error { return nil } -//Validate performs validation of the fields of a Connect packet +// Validate performs validation of the fields of a Connect packet func (c *ConnectPacket) Validate() byte { if c.PasswordFlag && !c.UsernameFlag { return ErrRefusedBadUsernameOrPassword } if c.ReservedBit != 0 { - //Bad reserved bit + // Bad reserved bit return ErrProtocolViolation } if (c.ProtocolName == "MQIsdp" && c.ProtocolVersion != 3) || (c.ProtocolName == "MQTT" && c.ProtocolVersion != 4) { - //Mismatched or unsupported protocol version + // Mismatched or unsupported protocol version return ErrRefusedBadProtocolVersion } if c.ProtocolName != "MQIsdp" && c.ProtocolName != "MQTT" { - //Bad protocol name + // Bad protocol name return ErrProtocolViolation } if len(c.ClientIdentifier) > 65535 || len(c.Username) > 65535 || len(c.Password) > 65535 { - //Bad size field + // Bad size field return ErrProtocolViolation } if len(c.ClientIdentifier) == 0 && !c.CleanSession { - //Bad client identifier + // Bad client identifier return ErrRefusedIDRejected } return Accepted } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (c *ConnectPacket) Details() Details { return Details{Qos: 0, MessageID: 0} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/disconnect.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/disconnect.go index e5c1869207..a24a84f30d 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/disconnect.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/disconnect.go @@ -1,19 +1,17 @@ package packets import ( - "fmt" "io" ) -//DisconnectPacket is an internal representation of the fields of the -//Disconnect MQTT packet +// DisconnectPacket is an internal representation of the fields of the +// Disconnect MQTT packet type DisconnectPacket struct { FixedHeader } func (d *DisconnectPacket) String() string { - str := fmt.Sprintf("%s", d.FixedHeader) - return str + return d.FixedHeader.String() } func (d *DisconnectPacket) Write(w io.Writer) error { @@ -23,14 +21,14 @@ func (d *DisconnectPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (d *DisconnectPacket) Unpack(b io.Reader) error { return nil } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (d *DisconnectPacket) Details() Details { return Details{Qos: 0, MessageID: 0} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/packets.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/packets.go index 42eeb46d39..3c734b3006 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/packets.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/packets.go @@ -8,9 +8,9 @@ import ( "io" ) -//ControlPacket defines the interface for structs intended to hold -//decoded MQTT packets, either from being read or before being -//written +// ControlPacket defines the interface for structs intended to hold +// decoded MQTT packets, either from being read or before being +// written type ControlPacket interface { Write(io.Writer) error Unpack(io.Reader) error @@ -18,8 +18,8 @@ type ControlPacket interface { Details() Details } -//PacketNames maps the constants for each of the MQTT packet types -//to a string representation of their name. +// PacketNames maps the constants for each of the MQTT packet types +// to a string representation of their name. var PacketNames = map[uint8]string{ 1: "CONNECT", 2: "CONNACK", @@ -37,7 +37,7 @@ var PacketNames = map[uint8]string{ 14: "DISCONNECT", } -//Below are the constants assigned to each of the MQTT packet types +// Below are the constants assigned to each of the MQTT packet types const ( Connect = 1 Connack = 2 @@ -55,8 +55,8 @@ const ( Disconnect = 14 ) -//Below are the const definitions for error codes returned by -//Connect() +// Below are the const definitions for error codes returned by +// Connect() const ( Accepted = 0x00 ErrRefusedBadProtocolVersion = 0x01 @@ -68,8 +68,8 @@ const ( ErrProtocolViolation = 0xFF ) -//ConnackReturnCodes is a map of the error codes constants for Connect() -//to a string representation of the error +// ConnackReturnCodes is a map of the error codes constants for Connect() +// to a string representation of the error var ConnackReturnCodes = map[uint8]string{ 0: "Connection Accepted", 1: "Connection Refused: Bad Protocol Version", @@ -81,23 +81,33 @@ var ConnackReturnCodes = map[uint8]string{ 255: "Connection Refused: Protocol Violation", } -//ConnErrors is a map of the errors codes constants for Connect() -//to a Go error +var ( + ErrorRefusedBadProtocolVersion = errors.New("unacceptable protocol version") + ErrorRefusedIDRejected = errors.New("identifier rejected") + ErrorRefusedServerUnavailable = errors.New("server Unavailable") + ErrorRefusedBadUsernameOrPassword = errors.New("bad user name or password") + ErrorRefusedNotAuthorised = errors.New("not Authorized") + ErrorNetworkError = errors.New("network Error") + ErrorProtocolViolation = errors.New("protocol Violation") +) + +// ConnErrors is a map of the errors codes constants for Connect() +// to a Go error var ConnErrors = map[byte]error{ Accepted: nil, - ErrRefusedBadProtocolVersion: errors.New("Unnacceptable protocol version"), - ErrRefusedIDRejected: errors.New("Identifier rejected"), - ErrRefusedServerUnavailable: errors.New("Server Unavailable"), - ErrRefusedBadUsernameOrPassword: errors.New("Bad user name or password"), - ErrRefusedNotAuthorised: errors.New("Not Authorized"), - ErrNetworkError: errors.New("Network Error"), - ErrProtocolViolation: errors.New("Protocol Violation"), + ErrRefusedBadProtocolVersion: ErrorRefusedBadProtocolVersion, + ErrRefusedIDRejected: ErrorRefusedIDRejected, + ErrRefusedServerUnavailable: ErrorRefusedServerUnavailable, + ErrRefusedBadUsernameOrPassword: ErrorRefusedBadUsernameOrPassword, + ErrRefusedNotAuthorised: ErrorRefusedNotAuthorised, + ErrNetworkError: ErrorNetworkError, + ErrProtocolViolation: ErrorProtocolViolation, } -//ReadPacket takes an instance of an io.Reader (such as net.Conn) and attempts -//to read an MQTT packet from the stream. It returns a ControlPacket -//representing the decoded MQTT packet and an error. One of these returns will -//always be nil, a nil ControlPacket indicating an error occurred. +// ReadPacket takes an instance of an io.Reader (such as net.Conn) and attempts +// to read an MQTT packet from the stream. It returns a ControlPacket +// representing the decoded MQTT packet and an error. One of these returns will +// always be nil, a nil ControlPacket indicating an error occurred. func ReadPacket(r io.Reader) (ControlPacket, error) { var fh FixedHeader b := make([]byte, 1) @@ -123,17 +133,17 @@ func ReadPacket(r io.Reader) (ControlPacket, error) { return nil, err } if n != fh.RemainingLength { - return nil, errors.New("Failed to read expected data") + return nil, errors.New("failed to read expected data") } err = cp.Unpack(bytes.NewBuffer(packetBytes)) return cp, err } -//NewControlPacket is used to create a new ControlPacket of the type specified -//by packetType, this is usually done by reference to the packet type constants -//defined in packets.go. The newly created ControlPacket is empty and a pointer -//is returned. +// NewControlPacket is used to create a new ControlPacket of the type specified +// by packetType, this is usually done by reference to the packet type constants +// defined in packets.go. The newly created ControlPacket is empty and a pointer +// is returned. func NewControlPacket(packetType byte) ControlPacket { switch packetType { case Connect: @@ -168,9 +178,9 @@ func NewControlPacket(packetType byte) ControlPacket { return nil } -//NewControlPacketWithHeader is used to create a new ControlPacket of the type -//specified within the FixedHeader that is passed to the function. -//The newly created ControlPacket is empty and a pointer is returned. +// NewControlPacketWithHeader is used to create a new ControlPacket of the type +// specified within the FixedHeader that is passed to the function. +// The newly created ControlPacket is empty and a pointer is returned. func NewControlPacketWithHeader(fh FixedHeader) (ControlPacket, error) { switch fh.MessageType { case Connect: @@ -205,16 +215,16 @@ func NewControlPacketWithHeader(fh FixedHeader) (ControlPacket, error) { return nil, fmt.Errorf("unsupported packet type 0x%x", fh.MessageType) } -//Details struct returned by the Details() function called on -//ControlPackets to present details of the Qos and MessageID -//of the ControlPacket +// Details struct returned by the Details() function called on +// ControlPackets to present details of the Qos and MessageID +// of the ControlPacket type Details struct { Qos byte MessageID uint16 } -//FixedHeader is a struct to hold the decoded information from -//the fixed header of an MQTT ControlPacket +// FixedHeader is a struct to hold the decoded information from +// the fixed header of an MQTT ControlPacket type FixedHeader struct { MessageType byte Dup bool @@ -274,9 +284,9 @@ func decodeUint16(b io.Reader) (uint16, error) { } func encodeUint16(num uint16) []byte { - bytes := make([]byte, 2) - binary.BigEndian.PutUint16(bytes, num) - return bytes + bytesResult := make([]byte, 2) + binary.BigEndian.PutUint16(bytesResult, num) + return bytesResult } func encodeString(field string) []byte { @@ -329,7 +339,7 @@ func decodeLength(r io.Reader) (int, error) { var rLength uint32 var multiplier uint32 b := make([]byte, 1) - for multiplier < 27 { //fix: Infinite '(digit & 128) == 1' will cause the dead loop + for multiplier < 27 { // fix: Infinite '(digit & 128) == 1' will cause the dead loop _, err := io.ReadFull(r, b) if err != nil { return 0, err diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingreq.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingreq.go index 5c3e88f940..4fa54b26f4 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingreq.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingreq.go @@ -1,19 +1,17 @@ package packets import ( - "fmt" "io" ) -//PingreqPacket is an internal representation of the fields of the -//Pingreq MQTT packet +// PingreqPacket is an internal representation of the fields of the +// Pingreq MQTT packet type PingreqPacket struct { FixedHeader } func (pr *PingreqPacket) String() string { - str := fmt.Sprintf("%s", pr.FixedHeader) - return str + return pr.FixedHeader.String() } func (pr *PingreqPacket) Write(w io.Writer) error { @@ -23,14 +21,14 @@ func (pr *PingreqPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (pr *PingreqPacket) Unpack(b io.Reader) error { return nil } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (pr *PingreqPacket) Details() Details { return Details{Qos: 0, MessageID: 0} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingresp.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingresp.go index 39ebc001e6..61388cacee 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingresp.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pingresp.go @@ -1,19 +1,17 @@ package packets import ( - "fmt" "io" ) -//PingrespPacket is an internal representation of the fields of the -//Pingresp MQTT packet +// PingrespPacket is an internal representation of the fields of the +// Pingresp MQTT packet type PingrespPacket struct { FixedHeader } func (pr *PingrespPacket) String() string { - str := fmt.Sprintf("%s", pr.FixedHeader) - return str + return pr.FixedHeader.String() } func (pr *PingrespPacket) Write(w io.Writer) error { @@ -23,14 +21,14 @@ func (pr *PingrespPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (pr *PingrespPacket) Unpack(b io.Reader) error { return nil } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (pr *PingrespPacket) Details() Details { return Details{Qos: 0, MessageID: 0} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/puback.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/puback.go index 7c0cd7efdd..5e6c381e23 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/puback.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/puback.go @@ -5,18 +5,15 @@ import ( "io" ) -//PubackPacket is an internal representation of the fields of the -//Puback MQTT packet +// PubackPacket is an internal representation of the fields of the +// Puback MQTT packet type PubackPacket struct { FixedHeader MessageID uint16 } func (pa *PubackPacket) String() string { - str := fmt.Sprintf("%s", pa.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", pa.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", pa.FixedHeader, pa.MessageID) } func (pa *PubackPacket) Write(w io.Writer) error { @@ -29,8 +26,8 @@ func (pa *PubackPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (pa *PubackPacket) Unpack(b io.Reader) error { var err error pa.MessageID, err = decodeUint16(b) @@ -38,8 +35,8 @@ func (pa *PubackPacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (pa *PubackPacket) Details() Details { return Details{Qos: pa.Qos, MessageID: pa.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubcomp.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubcomp.go index 4f6f6e216e..47e043db6a 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubcomp.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubcomp.go @@ -5,18 +5,15 @@ import ( "io" ) -//PubcompPacket is an internal representation of the fields of the -//Pubcomp MQTT packet +// PubcompPacket is an internal representation of the fields of the +// Pubcomp MQTT packet type PubcompPacket struct { FixedHeader MessageID uint16 } func (pc *PubcompPacket) String() string { - str := fmt.Sprintf("%s", pc.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", pc.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", pc.FixedHeader, pc.MessageID) } func (pc *PubcompPacket) Write(w io.Writer) error { @@ -29,8 +26,8 @@ func (pc *PubcompPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (pc *PubcompPacket) Unpack(b io.Reader) error { var err error pc.MessageID, err = decodeUint16(b) @@ -38,8 +35,8 @@ func (pc *PubcompPacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (pc *PubcompPacket) Details() Details { return Details{Qos: pc.Qos, MessageID: pc.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/publish.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/publish.go index adc9adb9c0..cdd76b1385 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/publish.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/publish.go @@ -6,8 +6,8 @@ import ( "io" ) -//PublishPacket is an internal representation of the fields of the -//Publish MQTT packet +// PublishPacket is an internal representation of the fields of the +// Publish MQTT packet type PublishPacket struct { FixedHeader TopicName string @@ -16,12 +16,7 @@ type PublishPacket struct { } func (p *PublishPacket) String() string { - str := fmt.Sprintf("%s", p.FixedHeader) - str += " " - str += fmt.Sprintf("topicName: %s MessageID: %d", p.TopicName, p.MessageID) - str += " " - str += fmt.Sprintf("payload: %s", string(p.Payload)) - return str + return fmt.Sprintf("%s topicName: %s MessageID: %d payload: %s", p.FixedHeader, p.TopicName, p.MessageID, string(p.Payload)) } func (p *PublishPacket) Write(w io.Writer) error { @@ -41,8 +36,8 @@ func (p *PublishPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (p *PublishPacket) Unpack(b io.Reader) error { var payloadLength = p.FixedHeader.RemainingLength var err error @@ -61,7 +56,7 @@ func (p *PublishPacket) Unpack(b io.Reader) error { payloadLength -= len(p.TopicName) + 2 } if payloadLength < 0 { - return fmt.Errorf("Error unpacking publish, payload length < 0") + return fmt.Errorf("error unpacking publish, payload length < 0") } p.Payload = make([]byte, payloadLength) _, err = b.Read(p.Payload) @@ -69,10 +64,10 @@ func (p *PublishPacket) Unpack(b io.Reader) error { return err } -//Copy creates a new PublishPacket with the same topic and payload -//but an empty fixed header, useful for when you want to deliver -//a message with different properties such as Qos but the same -//content +// Copy creates a new PublishPacket with the same topic and payload +// but an empty fixed header, useful for when you want to deliver +// a message with different properties such as Qos but the same +// content func (p *PublishPacket) Copy() *PublishPacket { newP := NewControlPacket(Publish).(*PublishPacket) newP.TopicName = p.TopicName @@ -81,8 +76,8 @@ func (p *PublishPacket) Copy() *PublishPacket { return newP } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (p *PublishPacket) Details() Details { return Details{Qos: p.Qos, MessageID: p.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrec.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrec.go index 483372b072..f0a72c5ce3 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrec.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrec.go @@ -5,18 +5,15 @@ import ( "io" ) -//PubrecPacket is an internal representation of the fields of the -//Pubrec MQTT packet +// PubrecPacket is an internal representation of the fields of the +// Pubrec MQTT packet type PubrecPacket struct { FixedHeader MessageID uint16 } func (pr *PubrecPacket) String() string { - str := fmt.Sprintf("%s", pr.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", pr.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", pr.FixedHeader, pr.MessageID) } func (pr *PubrecPacket) Write(w io.Writer) error { @@ -29,8 +26,8 @@ func (pr *PubrecPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (pr *PubrecPacket) Unpack(b io.Reader) error { var err error pr.MessageID, err = decodeUint16(b) @@ -38,8 +35,8 @@ func (pr *PubrecPacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (pr *PubrecPacket) Details() Details { return Details{Qos: pr.Qos, MessageID: pr.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrel.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrel.go index 8590fd976c..af29a82333 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrel.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/pubrel.go @@ -5,18 +5,15 @@ import ( "io" ) -//PubrelPacket is an internal representation of the fields of the -//Pubrel MQTT packet +// PubrelPacket is an internal representation of the fields of the +// Pubrel MQTT packet type PubrelPacket struct { FixedHeader MessageID uint16 } func (pr *PubrelPacket) String() string { - str := fmt.Sprintf("%s", pr.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", pr.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", pr.FixedHeader, pr.MessageID) } func (pr *PubrelPacket) Write(w io.Writer) error { @@ -29,8 +26,8 @@ func (pr *PubrelPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (pr *PubrelPacket) Unpack(b io.Reader) error { var err error pr.MessageID, err = decodeUint16(b) @@ -38,8 +35,8 @@ func (pr *PubrelPacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (pr *PubrelPacket) Details() Details { return Details{Qos: pr.Qos, MessageID: pr.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/suback.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/suback.go index fc0572475a..cdea660d88 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/suback.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/suback.go @@ -6,8 +6,8 @@ import ( "io" ) -//SubackPacket is an internal representation of the fields of the -//Suback MQTT packet +// SubackPacket is an internal representation of the fields of the +// Suback MQTT packet type SubackPacket struct { FixedHeader MessageID uint16 @@ -15,10 +15,7 @@ type SubackPacket struct { } func (sa *SubackPacket) String() string { - str := fmt.Sprintf("%s", sa.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", sa.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", sa.FixedHeader, sa.MessageID) } func (sa *SubackPacket) Write(w io.Writer) error { @@ -34,8 +31,8 @@ func (sa *SubackPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (sa *SubackPacket) Unpack(b io.Reader) error { var qosBuffer bytes.Buffer var err error @@ -53,8 +50,8 @@ func (sa *SubackPacket) Unpack(b io.Reader) error { return nil } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (sa *SubackPacket) Details() Details { return Details{Qos: 0, MessageID: sa.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/subscribe.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/subscribe.go index 0787ce07c0..daef9014bd 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/subscribe.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/subscribe.go @@ -6,8 +6,8 @@ import ( "io" ) -//SubscribePacket is an internal representation of the fields of the -//Subscribe MQTT packet +// SubscribePacket is an internal representation of the fields of the +// Subscribe MQTT packet type SubscribePacket struct { FixedHeader MessageID uint16 @@ -16,10 +16,7 @@ type SubscribePacket struct { } func (s *SubscribePacket) String() string { - str := fmt.Sprintf("%s", s.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d topics: %s", s.MessageID, s.Topics) - return str + return fmt.Sprintf("%s MessageID: %d topics: %s", s.FixedHeader, s.MessageID, s.Topics) } func (s *SubscribePacket) Write(w io.Writer) error { @@ -39,8 +36,8 @@ func (s *SubscribePacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (s *SubscribePacket) Unpack(b io.Reader) error { var err error s.MessageID, err = decodeUint16(b) @@ -59,14 +56,14 @@ func (s *SubscribePacket) Unpack(b io.Reader) error { return err } s.Qoss = append(s.Qoss, qos) - payloadLength -= 2 + len(topic) + 1 //2 bytes of string length, plus string, plus 1 byte for Qos + payloadLength -= 2 + len(topic) + 1 // 2 bytes of string length, plus string, plus 1 byte for Qos } return nil } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (s *SubscribePacket) Details() Details { return Details{Qos: 1, MessageID: s.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsuback.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsuback.go index 4b40c273af..bdf5fd3246 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsuback.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsuback.go @@ -5,18 +5,15 @@ import ( "io" ) -//UnsubackPacket is an internal representation of the fields of the -//Unsuback MQTT packet +// UnsubackPacket is an internal representation of the fields of the +// Unsuback MQTT packet type UnsubackPacket struct { FixedHeader MessageID uint16 } func (ua *UnsubackPacket) String() string { - str := fmt.Sprintf("%s", ua.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", ua.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", ua.FixedHeader, ua.MessageID) } func (ua *UnsubackPacket) Write(w io.Writer) error { @@ -29,8 +26,8 @@ func (ua *UnsubackPacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (ua *UnsubackPacket) Unpack(b io.Reader) error { var err error ua.MessageID, err = decodeUint16(b) @@ -38,8 +35,8 @@ func (ua *UnsubackPacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (ua *UnsubackPacket) Details() Details { return Details{Qos: 0, MessageID: ua.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsubscribe.go b/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsubscribe.go index 2012c310f8..9ccb850150 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsubscribe.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/packets/unsubscribe.go @@ -6,8 +6,8 @@ import ( "io" ) -//UnsubscribePacket is an internal representation of the fields of the -//Unsubscribe MQTT packet +// UnsubscribePacket is an internal representation of the fields of the +// Unsubscribe MQTT packet type UnsubscribePacket struct { FixedHeader MessageID uint16 @@ -15,10 +15,7 @@ type UnsubscribePacket struct { } func (u *UnsubscribePacket) String() string { - str := fmt.Sprintf("%s", u.FixedHeader) - str += " " - str += fmt.Sprintf("MessageID: %d", u.MessageID) - return str + return fmt.Sprintf("%s MessageID: %d", u.FixedHeader, u.MessageID) } func (u *UnsubscribePacket) Write(w io.Writer) error { @@ -36,8 +33,8 @@ func (u *UnsubscribePacket) Write(w io.Writer) error { return err } -//Unpack decodes the details of a ControlPacket after the fixed -//header has been read +// Unpack decodes the details of a ControlPacket after the fixed +// header has been read func (u *UnsubscribePacket) Unpack(b io.Reader) error { var err error u.MessageID, err = decodeUint16(b) @@ -52,8 +49,8 @@ func (u *UnsubscribePacket) Unpack(b io.Reader) error { return err } -//Details returns a Details struct containing the Qos and -//MessageID of this ControlPacket +// Details returns a Details struct containing the Qos and +// MessageID of this ControlPacket func (u *UnsubscribePacket) Details() Details { return Details{Qos: 1, MessageID: u.MessageID} } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/ping.go b/vendor/github.com/eclipse/paho.mqtt.golang/ping.go index dcbcb1dd22..50421f428c 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/ping.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/ping.go @@ -16,13 +16,16 @@ package mqtt import ( "errors" + "io" "sync/atomic" "time" "github.com/eclipse/paho.mqtt.golang/packets" ) -func keepalive(c *client) { +// keepalive - Send ping when connection unused for set period +// connection passed in to avoid race condition on shutdown +func keepalive(c *client, conn io.Writer) { defer c.workers.Done() DEBUG.Println(PNG, "keepalive starting") var checkInterval int64 @@ -51,17 +54,19 @@ func keepalive(c *client) { if atomic.LoadInt32(&c.pingOutstanding) == 0 { DEBUG.Println(PNG, "keepalive sending ping") ping := packets.NewControlPacket(packets.Pingreq).(*packets.PingreqPacket) - //We don't want to wait behind large messages being sent, the Write call - //will block until it it able to send the packet. + // We don't want to wait behind large messages being sent, the Write call + // will block until it it able to send the packet. atomic.StoreInt32(&c.pingOutstanding, 1) - ping.Write(c.conn) + if err := ping.Write(conn); err != nil { + ERROR.Println(PNG, err) + } c.lastSent.Store(time.Now()) pingSent = time.Now() } } - if atomic.LoadInt32(&c.pingOutstanding) > 0 && time.Now().Sub(pingSent) >= c.options.PingTimeout { + if atomic.LoadInt32(&c.pingOutstanding) > 0 && time.Since(pingSent) >= c.options.PingTimeout { CRITICAL.Println(PNG, "pingresp not received, disconnecting") - c.errors <- errors.New("pingresp not received, disconnecting") + c.internalConnLost(errors.New("pingresp not received, disconnecting")) // no harm in calling this if the connection is already down (or shutdown is in progress) return } } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/router.go b/vendor/github.com/eclipse/paho.mqtt.golang/router.go index 7b4e8f8082..42261ee996 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/router.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/router.go @@ -37,17 +37,11 @@ type route struct { // and returns a boolean of the outcome func match(route []string, topic []string) bool { if len(route) == 0 { - if len(topic) == 0 { - return true - } - return false + return len(topic) == 0 } if len(topic) == 0 { - if route[0] == "#" { - return true - } - return false + return route[0] == "#" } if route[0] == "#" { @@ -87,15 +81,13 @@ type router struct { routes *list.List defaultHandler MessageHandler messages chan *packets.PublishPacket - stop chan bool } // newRouter returns a new instance of a Router and channel which can be used to tell the Router // to stop -func newRouter() (*router, chan bool) { - router := &router{routes: list.New(), messages: make(chan *packets.PublishPacket), stop: make(chan bool)} - stop := router.stop - return router, stop +func newRouter() *router { + router := &router{routes: list.New(), messages: make(chan *packets.PublishPacket)} + return router } // addRoute takes a topic string and MessageHandler callback. It looks in the current list of @@ -105,7 +97,7 @@ func (r *router) addRoute(topic string, callback MessageHandler) { r.Lock() defer r.Unlock() for e := r.routes.Front(); e != nil; e = e.Next() { - if e.Value.(*route).match(topic) { + if e.Value.(*route).topic == topic { r := e.Value.(*route) r.callback = callback return @@ -120,7 +112,7 @@ func (r *router) deleteRoute(topic string) { r.Lock() defer r.Unlock() for e := r.routes.Front(); e != nil; e = e.Next() { - if e.Value.(*route).match(topic) { + if e.Value.(*route).topic == topic { r.routes.Remove(e) return } @@ -139,30 +131,31 @@ func (r *router) setDefaultHandler(handler MessageHandler) { // takes messages off the channel, matches them against the internal route list and calls the // associated callback (or the defaultHandler, if one exists and no other route matched). If // anything is sent down the stop channel the function will end. -func (r *router) matchAndDispatch(messages <-chan *packets.PublishPacket, order bool, client *client) { +func (r *router) matchAndDispatch(messages <-chan *packets.PublishPacket, order bool, client *client) <-chan *PacketAndToken { + ackChan := make(chan *PacketAndToken) go func() { - for { - select { - case message := <-messages: - sent := false - r.RLock() - m := messageFromPublish(message, client.ackFunc(message)) - handlers := []MessageHandler{} - for e := r.routes.Front(); e != nil; e = e.Next() { - if e.Value.(*route).match(message.TopicName) { - if order { - handlers = append(handlers, e.Value.(*route).callback) - } else { - hd := e.Value.(*route).callback - go func() { - hd(client, m) - m.Ack() - }() - } - sent = true + for message := range messages { + // DEBUG.Println(ROU, "matchAndDispatch received message") + sent := false + r.RLock() + m := messageFromPublish(message, ackFunc(ackChan, client.persist, message)) + var handlers []MessageHandler + for e := r.routes.Front(); e != nil; e = e.Next() { + if e.Value.(*route).match(message.TopicName) { + if order { + handlers = append(handlers, e.Value.(*route).callback) + } else { + hd := e.Value.(*route).callback + go func() { + hd(client, m) + m.Ack() + }() } + sent = true } - if !sent && r.defaultHandler != nil { + } + if !sent { + if r.defaultHandler != nil { if order { handlers = append(handlers, r.defaultHandler) } else { @@ -171,17 +164,19 @@ func (r *router) matchAndDispatch(messages <-chan *packets.PublishPacket, order m.Ack() }() } + } else { + DEBUG.Println(ROU, "matchAndDispatch received message and no handler was available. Message will NOT be acknowledged.") } - r.RUnlock() - for _, handler := range handlers { - func() { - handler(client, m) - m.Ack() - }() - } - case <-r.stop: - return } + r.RUnlock() + for _, handler := range handlers { + handler(client, m) + m.Ack() + } + // DEBUG.Println(ROU, "matchAndDispatch handled message") } + close(ackChan) + DEBUG.Println(ROU, "matchAndDispatch exiting") }() + return ackChan } diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/token.go b/vendor/github.com/eclipse/paho.mqtt.golang/token.go index 0818553332..dade215d4a 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/token.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/token.go @@ -31,8 +31,24 @@ type PacketAndToken struct { // Token defines the interface for the tokens used to indicate when // actions have completed. type Token interface { + // Wait will wait indefinitely for the Token to complete, ie the Publish + // to be sent and confirmed receipt from the broker. Wait() bool + + // WaitTimeout takes a time.Duration to wait for the flow associated with the + // Token to complete, returns true if it returned before the timeout or + // returns false if the timeout occurred. In the case of a timeout the Token + // does not have an error set in case the caller wishes to wait again. WaitTimeout(time.Duration) bool + + // Done returns a channel that is closed when the flow associated + // with the Token completes. Clients should call Error after the + // channel is closed to check if the flow completed successfully. + // + // Done is provided for use in select statements. Simple use cases may + // use Wait or WaitTimeout. + Done() <-chan struct{} + Error() error } @@ -52,21 +68,14 @@ type baseToken struct { err error } -// Wait will wait indefinitely for the Token to complete, ie the Publish -// to be sent and confirmed receipt from the broker +// Wait implements the Token Wait method. func (b *baseToken) Wait() bool { <-b.complete return true } -// WaitTimeout takes a time.Duration to wait for the flow associated with the -// Token to complete, returns true if it returned before the timeout or -// returns false if the timeout occurred. In the case of a timeout the Token -// does not have an error set in case the caller wishes to wait again +// WaitTimeout implements the Token WaitTimeout method. func (b *baseToken) WaitTimeout(d time.Duration) bool { - b.m.Lock() - defer b.m.Unlock() - timer := time.NewTimer(d) select { case <-b.complete: @@ -80,6 +89,11 @@ func (b *baseToken) WaitTimeout(d time.Duration) bool { return false } +// Done implements the Token Done method. +func (b *baseToken) Done() <-chan struct{} { + return b.complete +} + func (b *baseToken) flowComplete() { select { case <-b.complete: @@ -125,7 +139,7 @@ type ConnectToken struct { sessionPresent bool } -// ReturnCode returns the acknowlegement code in the connack sent +// ReturnCode returns the acknowledgement code in the connack sent // in response to a Connect() func (c *ConnectToken) ReturnCode() byte { c.m.RLock() @@ -160,6 +174,7 @@ type SubscribeToken struct { baseToken subs []string subResult map[string]byte + messageID uint16 } // Result returns a map of topics that were subscribed to along with @@ -175,6 +190,7 @@ func (s *SubscribeToken) Result() map[string]byte { // required to provide information about calls to Unsubscribe() type UnsubscribeToken struct { baseToken + messageID uint16 } // DisconnectToken is an extension of Token containing the extra fields diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/topic.go b/vendor/github.com/eclipse/paho.mqtt.golang/topic.go index 6fa3ad2ac5..6604e6840e 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/topic.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/topic.go @@ -19,18 +19,18 @@ import ( "strings" ) -//ErrInvalidQos is the error returned when an packet is to be sent -//with an invalid Qos value -var ErrInvalidQos = errors.New("Invalid QoS") +// ErrInvalidQos is the error returned when an packet is to be sent +// with an invalid Qos value +var ErrInvalidQos = errors.New("invalid QoS") -//ErrInvalidTopicEmptyString is the error returned when a topic string -//is passed in that is 0 length -var ErrInvalidTopicEmptyString = errors.New("Invalid Topic; empty string") +// ErrInvalidTopicEmptyString is the error returned when a topic string +// is passed in that is 0 length +var ErrInvalidTopicEmptyString = errors.New("invalid Topic; empty string") -//ErrInvalidTopicMultilevel is the error returned when a topic string -//is passed in that has the multi level wildcard in any position but -//the last -var ErrInvalidTopicMultilevel = errors.New("Invalid Topic; multi-level wildcard must be last level") +// ErrInvalidTopicMultilevel is the error returned when a topic string +// is passed in that has the multi level wildcard in any position but +// the last +var ErrInvalidTopicMultilevel = errors.New("invalid Topic; multi-level wildcard must be last level") // Topic Names and Topic Filters // The MQTT v3.1.1 spec clarifies a number of ambiguities with regard @@ -46,10 +46,14 @@ var ErrInvalidTopicMultilevel = errors.New("Invalid Topic; multi-level wildcard // - A TopicName may not contain a wildcard. // - A TopicFilter may only have a # (multi-level) wildcard as the last level. // - A TopicFilter may contain any number of + (single-level) wildcards. -// - A TopicFilter with a # will match the absense of a level +// - A TopicFilter with a # will match the absence of a level // Example: a subscription to "foo/#" will match messages published to "foo". func validateSubscribeMap(subs map[string]byte) ([]string, []byte, error) { + if len(subs) == 0 { + return nil, nil, errors.New("invalid subscription; subscribe map must not be empty") + } + var topics []string var qoss []byte for topic, qos := range subs { @@ -75,7 +79,7 @@ func validateTopicAndQos(topic string, qos byte) error { } } - if qos < 0 || qos > 2 { + if qos > 2 { return ErrInvalidQos } return nil diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/trace.go b/vendor/github.com/eclipse/paho.mqtt.golang/trace.go index 195c8173dc..904a66468a 100644 --- a/vendor/github.com/eclipse/paho.mqtt.golang/trace.go +++ b/vendor/github.com/eclipse/paho.mqtt.golang/trace.go @@ -27,7 +27,7 @@ type ( NOOPLogger struct{} ) -func (NOOPLogger) Println(v ...interface{}) {} +func (NOOPLogger) Println(v ...interface{}) {} func (NOOPLogger) Printf(format string, v ...interface{}) {} // Internal levels of library output that are initialised to not print diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/websocket.go b/vendor/github.com/eclipse/paho.mqtt.golang/websocket.go new file mode 100644 index 0000000000..9fa41ce3e4 --- /dev/null +++ b/vendor/github.com/eclipse/paho.mqtt.golang/websocket.go @@ -0,0 +1,119 @@ +package mqtt + +import ( + "crypto/tls" + "fmt" + "io" + "net" + "net/http" + "net/url" + "sync" + "time" + + "github.com/gorilla/websocket" +) + +// WebsocketOptions are config options for a websocket dialer +type WebsocketOptions struct { + ReadBufferSize int + WriteBufferSize int + Proxy ProxyFunction +} + +type ProxyFunction func(req *http.Request) (*url.URL, error) + +// NewWebsocket returns a new websocket and returns a net.Conn compatible interface using the gorilla/websocket package +func NewWebsocket(host string, tlsc *tls.Config, timeout time.Duration, requestHeader http.Header, options *WebsocketOptions) (net.Conn, error) { + if timeout == 0 { + timeout = 10 * time.Second + } + + if options == nil { + // Apply default options + options = &WebsocketOptions{} + } + if options.Proxy == nil { + options.Proxy = http.ProxyFromEnvironment + } + dialer := &websocket.Dialer{ + Proxy: options.Proxy, + HandshakeTimeout: timeout, + EnableCompression: false, + TLSClientConfig: tlsc, + Subprotocols: []string{"mqtt"}, + ReadBufferSize: options.ReadBufferSize, + WriteBufferSize: options.WriteBufferSize, + } + + ws, resp, err := dialer.Dial(host, requestHeader) + + if err != nil { + if resp != nil { + WARN.Println(CLI, fmt.Sprintf("Websocket handshake failure. StatusCode: %d. Body: %s", resp.StatusCode, resp.Body)) + } + return nil, err + } + + wrapper := &websocketConnector{ + Conn: ws, + } + return wrapper, err +} + +// websocketConnector is a websocket wrapper so it satisfies the net.Conn interface so it is a +// drop in replacement of the golang.org/x/net/websocket package. +// Implementation guide taken from https://github.com/gorilla/websocket/issues/282 +type websocketConnector struct { + *websocket.Conn + r io.Reader + rio sync.Mutex + wio sync.Mutex +} + +// SetDeadline sets both the read and write deadlines +func (c *websocketConnector) SetDeadline(t time.Time) error { + if err := c.SetReadDeadline(t); err != nil { + return err + } + err := c.SetWriteDeadline(t) + return err +} + +// Write writes data to the websocket +func (c *websocketConnector) Write(p []byte) (int, error) { + c.wio.Lock() + defer c.wio.Unlock() + + err := c.WriteMessage(websocket.BinaryMessage, p) + if err != nil { + return 0, err + } + return len(p), nil +} + +// Read reads the current websocket frame +func (c *websocketConnector) Read(p []byte) (int, error) { + c.rio.Lock() + defer c.rio.Unlock() + for { + if c.r == nil { + // Advance to next message. + var err error + _, c.r, err = c.NextReader() + if err != nil { + return 0, err + } + } + n, err := c.r.Read(p) + if err == io.EOF { + // At end of message. + c.r = nil + if n > 0 { + return n, nil + } + // No data read, continue to next message. + continue + } + return n, err + } +} diff --git a/vendor/github.com/fatih/color/README.md b/vendor/github.com/fatih/color/README.md index 42d9abc07e..d62e4024aa 100644 --- a/vendor/github.com/fatih/color/README.md +++ b/vendor/github.com/fatih/color/README.md @@ -1,20 +1,11 @@ -# Archived project. No maintenance. - -This project is not maintained anymore and is archived. Feel free to fork and -make your own changes if needed. For more detail read my blog post: [Taking an indefinite sabbatical from my projects](https://arslan.io/2018/10/09/taking-an-indefinite-sabbatical-from-my-projects/) - -Thanks to everyone for their valuable feedback and contributions. - - -# Color [![GoDoc](https://godoc.org/github.com/fatih/color?status.svg)](https://godoc.org/github.com/fatih/color) +# color [![](https://github.com/fatih/color/workflows/build/badge.svg)](https://github.com/fatih/color/actions) [![PkgGoDev](https://pkg.go.dev/badge/github.com/fatih/color)](https://pkg.go.dev/github.com/fatih/color) Color lets you use colorized outputs in terms of [ANSI Escape Codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It has support for Windows too! The API can be used in several ways, pick one that suits you. - -![Color](https://i.imgur.com/c1JI0lA.png) +![Color](https://user-images.githubusercontent.com/438920/96832689-03b3e000-13f4-11eb-9803-46f4c4de3406.jpg) ## Install diff --git a/vendor/github.com/fatih/color/go.mod b/vendor/github.com/fatih/color/go.mod index bc0df75458..78872815ea 100644 --- a/vendor/github.com/fatih/color/go.mod +++ b/vendor/github.com/fatih/color/go.mod @@ -3,6 +3,6 @@ module github.com/fatih/color go 1.13 require ( - github.com/mattn/go-colorable v0.1.4 - github.com/mattn/go-isatty v0.0.11 + github.com/mattn/go-colorable v0.1.8 + github.com/mattn/go-isatty v0.0.12 ) diff --git a/vendor/github.com/fatih/color/go.sum b/vendor/github.com/fatih/color/go.sum index 44328a8db5..54f7c46e81 100644 --- a/vendor/github.com/fatih/color/go.sum +++ b/vendor/github.com/fatih/color/go.sum @@ -1,8 +1,7 @@ -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.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/go-redis/redis/.travis.yml b/vendor/github.com/go-redis/redis/.travis.yml deleted file mode 100644 index 06d7897b4e..0000000000 --- a/vendor/github.com/go-redis/redis/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false -language: go - -services: - - redis-server - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - tip - -matrix: - allow_failures: - - go: tip - -install: - - go get github.com/onsi/ginkgo - - go get github.com/onsi/gomega diff --git a/vendor/github.com/go-redis/redis/CHANGELOG.md b/vendor/github.com/go-redis/redis/CHANGELOG.md deleted file mode 100644 index 19645661a4..0000000000 --- a/vendor/github.com/go-redis/redis/CHANGELOG.md +++ /dev/null @@ -1,25 +0,0 @@ -# Changelog - -## Unreleased - -- Cluster and Ring pipelines process commands for each node in its own goroutine. - -## 6.14 - -- Added Options.MinIdleConns. -- Added Options.MaxConnAge. -- PoolStats.FreeConns is renamed to PoolStats.IdleConns. -- Add Client.Do to simplify creating custom commands. -- Add Cmd.String, Cmd.Int, Cmd.Int64, Cmd.Uint64, Cmd.Float64, and Cmd.Bool helpers. -- Lower memory usage. - -## v6.13 - -- Ring got new options called `HashReplicas` and `Hash`. It is recommended to set `HashReplicas = 1000` for better keys distribution between shards. -- Cluster client was optimized to use much less memory when reloading cluster state. -- PubSub.ReceiveMessage is re-worked to not use ReceiveTimeout so it does not lose data when timeout occurres. In most cases it is recommended to use PubSub.Channel instead. -- Dialer.KeepAlive is set to 5 minutes by default. - -## v6.12 - -- ClusterClient got new option called `ClusterSlots` which allows to build cluster of normal Redis Servers that don't have cluster mode enabled. See https://godoc.org/github.com/go-redis/redis#example-NewClusterClient--ManualSetup diff --git a/vendor/github.com/go-redis/redis/README.md b/vendor/github.com/go-redis/redis/README.md deleted file mode 100644 index 6c8d99af72..0000000000 --- a/vendor/github.com/go-redis/redis/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# Redis client for Golang - -[![Build Status](https://travis-ci.org/go-redis/redis.png?branch=master)](https://travis-ci.org/go-redis/redis) -[![GoDoc](https://godoc.org/github.com/go-redis/redis?status.svg)](https://godoc.org/github.com/go-redis/redis) -[![Airbrake](https://img.shields.io/badge/kudos-airbrake.io-orange.svg)](https://airbrake.io) - -Supports: - -- Redis 3 commands except QUIT, MONITOR, SLOWLOG and SYNC. -- Automatic connection pooling with [circuit breaker](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern) support. -- [Pub/Sub](https://godoc.org/github.com/go-redis/redis#PubSub). -- [Transactions](https://godoc.org/github.com/go-redis/redis#example-Client-TxPipeline). -- [Pipeline](https://godoc.org/github.com/go-redis/redis#example-Client-Pipeline) and [TxPipeline](https://godoc.org/github.com/go-redis/redis#example-Client-TxPipeline). -- [Scripting](https://godoc.org/github.com/go-redis/redis#Script). -- [Timeouts](https://godoc.org/github.com/go-redis/redis#Options). -- [Redis Sentinel](https://godoc.org/github.com/go-redis/redis#NewFailoverClient). -- [Redis Cluster](https://godoc.org/github.com/go-redis/redis#NewClusterClient). -- [Cluster of Redis Servers](https://godoc.org/github.com/go-redis/redis#example-NewClusterClient--ManualSetup) without using cluster mode and Redis Sentinel. -- [Ring](https://godoc.org/github.com/go-redis/redis#NewRing). -- [Instrumentation](https://godoc.org/github.com/go-redis/redis#ex-package--Instrumentation). -- [Cache friendly](https://github.com/go-redis/cache). -- [Rate limiting](https://github.com/go-redis/redis_rate). -- [Distributed Locks](https://github.com/bsm/redis-lock). - -API docs: https://godoc.org/github.com/go-redis/redis. -Examples: https://godoc.org/github.com/go-redis/redis#pkg-examples. - -## Installation - -Install: - -```shell -go get -u github.com/go-redis/redis -``` - -Import: - -```go -import "github.com/go-redis/redis" -``` - -## Quickstart - -```go -func ExampleNewClient() { - client := redis.NewClient(&redis.Options{ - Addr: "localhost:6379", - Password: "", // no password set - DB: 0, // use default DB - }) - - pong, err := client.Ping().Result() - fmt.Println(pong, err) - // Output: PONG -} - -func ExampleClient() { - err := client.Set("key", "value", 0).Err() - if err != nil { - panic(err) - } - - val, err := client.Get("key").Result() - if err != nil { - panic(err) - } - fmt.Println("key", val) - - val2, err := client.Get("key2").Result() - if err == redis.Nil { - fmt.Println("key2 does not exist") - } else if err != nil { - panic(err) - } else { - fmt.Println("key2", val2) - } - // Output: key value - // key2 does not exist -} -``` - -## Howto - -Please go through [examples](https://godoc.org/github.com/go-redis/redis#pkg-examples) to get an idea how to use this package. - -## Look and feel - -Some corner cases: - -```go -// SET key value EX 10 NX -set, err := client.SetNX("key", "value", 10*time.Second).Result() - -// SORT list LIMIT 0 2 ASC -vals, err := client.Sort("list", redis.Sort{Offset: 0, Count: 2, Order: "ASC"}).Result() - -// ZRANGEBYSCORE zset -inf +inf WITHSCORES LIMIT 0 2 -vals, err := client.ZRangeByScoreWithScores("zset", redis.ZRangeBy{ - Min: "-inf", - Max: "+inf", - Offset: 0, - Count: 2, -}).Result() - -// ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3 AGGREGATE SUM -vals, err := client.ZInterStore("out", redis.ZStore{Weights: []int64{2, 3}}, "zset1", "zset2").Result() - -// EVAL "return {KEYS[1],ARGV[1]}" 1 "key" "hello" -vals, err := client.Eval("return {KEYS[1],ARGV[1]}", []string{"key"}, "hello").Result() -``` - -## Benchmark - -go-redis vs redigo: - -``` -BenchmarkSetGoRedis10Conns64Bytes-4 200000 7621 ns/op 210 B/op 6 allocs/op -BenchmarkSetGoRedis100Conns64Bytes-4 200000 7554 ns/op 210 B/op 6 allocs/op -BenchmarkSetGoRedis10Conns1KB-4 200000 7697 ns/op 210 B/op 6 allocs/op -BenchmarkSetGoRedis100Conns1KB-4 200000 7688 ns/op 210 B/op 6 allocs/op -BenchmarkSetGoRedis10Conns10KB-4 200000 9214 ns/op 210 B/op 6 allocs/op -BenchmarkSetGoRedis100Conns10KB-4 200000 9181 ns/op 210 B/op 6 allocs/op -BenchmarkSetGoRedis10Conns1MB-4 2000 583242 ns/op 2337 B/op 6 allocs/op -BenchmarkSetGoRedis100Conns1MB-4 2000 583089 ns/op 2338 B/op 6 allocs/op -BenchmarkSetRedigo10Conns64Bytes-4 200000 7576 ns/op 208 B/op 7 allocs/op -BenchmarkSetRedigo100Conns64Bytes-4 200000 7782 ns/op 208 B/op 7 allocs/op -BenchmarkSetRedigo10Conns1KB-4 200000 7958 ns/op 208 B/op 7 allocs/op -BenchmarkSetRedigo100Conns1KB-4 200000 7725 ns/op 208 B/op 7 allocs/op -BenchmarkSetRedigo10Conns10KB-4 100000 18442 ns/op 208 B/op 7 allocs/op -BenchmarkSetRedigo100Conns10KB-4 100000 18818 ns/op 208 B/op 7 allocs/op -BenchmarkSetRedigo10Conns1MB-4 2000 668829 ns/op 226 B/op 7 allocs/op -BenchmarkSetRedigo100Conns1MB-4 2000 679542 ns/op 226 B/op 7 allocs/op -``` - -Redis Cluster: - -``` -BenchmarkRedisPing-4 200000 6983 ns/op 116 B/op 4 allocs/op -BenchmarkRedisClusterPing-4 100000 11535 ns/op 117 B/op 4 allocs/op -``` - -## See also - -- [Golang PostgreSQL ORM](https://github.com/go-pg/pg) -- [Golang msgpack](https://github.com/vmihailenco/msgpack) -- [Golang message task queue](https://github.com/vmihailenco/taskq) diff --git a/vendor/github.com/go-redis/redis/cluster_commands.go b/vendor/github.com/go-redis/redis/cluster_commands.go deleted file mode 100644 index dff62c902d..0000000000 --- a/vendor/github.com/go-redis/redis/cluster_commands.go +++ /dev/null @@ -1,22 +0,0 @@ -package redis - -import "sync/atomic" - -func (c *ClusterClient) DBSize() *IntCmd { - cmd := NewIntCmd("dbsize") - var size int64 - err := c.ForEachMaster(func(master *Client) error { - n, err := master.DBSize().Result() - if err != nil { - return err - } - atomic.AddInt64(&size, n) - return nil - }) - if err != nil { - cmd.setErr(err) - return cmd - } - cmd.val = size - return cmd -} diff --git a/vendor/github.com/go-redis/redis/command.go b/vendor/github.com/go-redis/redis/command.go deleted file mode 100644 index c70973d3bf..0000000000 --- a/vendor/github.com/go-redis/redis/command.go +++ /dev/null @@ -1,1972 +0,0 @@ -package redis - -import ( - "fmt" - "net" - "strconv" - "strings" - "time" - - "github.com/go-redis/redis/internal" - "github.com/go-redis/redis/internal/proto" -) - -type Cmder interface { - Name() string - Args() []interface{} - stringArg(int) string - - readReply(rd *proto.Reader) error - setErr(error) - - readTimeout() *time.Duration - - Err() error -} - -func setCmdsErr(cmds []Cmder, e error) { - for _, cmd := range cmds { - if cmd.Err() == nil { - cmd.setErr(e) - } - } -} - -func cmdsFirstErr(cmds []Cmder) error { - for _, cmd := range cmds { - if err := cmd.Err(); err != nil { - return err - } - } - return nil -} - -func writeCmd(wr *proto.Writer, cmds ...Cmder) error { - for _, cmd := range cmds { - err := wr.WriteArgs(cmd.Args()) - if err != nil { - return err - } - } - return nil -} - -func cmdString(cmd Cmder, val interface{}) string { - var ss []string - for _, arg := range cmd.Args() { - ss = append(ss, fmt.Sprint(arg)) - } - s := strings.Join(ss, " ") - if err := cmd.Err(); err != nil { - return s + ": " + err.Error() - } - if val != nil { - switch vv := val.(type) { - case []byte: - return s + ": " + string(vv) - default: - return s + ": " + fmt.Sprint(val) - } - } - return s - -} - -func cmdFirstKeyPos(cmd Cmder, info *CommandInfo) int { - switch cmd.Name() { - case "eval", "evalsha": - if cmd.stringArg(2) != "0" { - return 3 - } - - return 0 - case "publish": - return 1 - } - if info == nil { - return 0 - } - return int(info.FirstKeyPos) -} - -//------------------------------------------------------------------------------ - -type baseCmd struct { - _args []interface{} - err error - - _readTimeout *time.Duration -} - -var _ Cmder = (*Cmd)(nil) - -func (cmd *baseCmd) Err() error { - return cmd.err -} - -func (cmd *baseCmd) Args() []interface{} { - return cmd._args -} - -func (cmd *baseCmd) stringArg(pos int) string { - if pos < 0 || pos >= len(cmd._args) { - return "" - } - s, _ := cmd._args[pos].(string) - return s -} - -func (cmd *baseCmd) Name() string { - if len(cmd._args) > 0 { - // Cmd name must be lower cased. - s := internal.ToLower(cmd.stringArg(0)) - cmd._args[0] = s - return s - } - return "" -} - -func (cmd *baseCmd) readTimeout() *time.Duration { - return cmd._readTimeout -} - -func (cmd *baseCmd) setReadTimeout(d time.Duration) { - cmd._readTimeout = &d -} - -func (cmd *baseCmd) setErr(e error) { - cmd.err = e -} - -//------------------------------------------------------------------------------ - -type Cmd struct { - baseCmd - - val interface{} -} - -func NewCmd(args ...interface{}) *Cmd { - return &Cmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *Cmd) Val() interface{} { - return cmd.val -} - -func (cmd *Cmd) Result() (interface{}, error) { - return cmd.val, cmd.err -} - -func (cmd *Cmd) String() (string, error) { - if cmd.err != nil { - return "", cmd.err - } - switch val := cmd.val.(type) { - case string: - return val, nil - default: - err := fmt.Errorf("redis: unexpected type=%T for String", val) - return "", err - } -} - -func (cmd *Cmd) Int() (int, error) { - if cmd.err != nil { - return 0, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return int(val), nil - case string: - return strconv.Atoi(val) - default: - err := fmt.Errorf("redis: unexpected type=%T for Int", val) - return 0, err - } -} - -func (cmd *Cmd) Int64() (int64, error) { - if cmd.err != nil { - return 0, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return val, nil - case string: - return strconv.ParseInt(val, 10, 64) - default: - err := fmt.Errorf("redis: unexpected type=%T for Int64", val) - return 0, err - } -} - -func (cmd *Cmd) Uint64() (uint64, error) { - if cmd.err != nil { - return 0, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return uint64(val), nil - case string: - return strconv.ParseUint(val, 10, 64) - default: - err := fmt.Errorf("redis: unexpected type=%T for Uint64", val) - return 0, err - } -} - -func (cmd *Cmd) Float32() (float32, error) { - if cmd.err != nil { - return 0, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return float32(val), nil - case string: - f, err := strconv.ParseFloat(val, 32) - if err != nil { - return 0, err - } - return float32(f), nil - default: - err := fmt.Errorf("redis: unexpected type=%T for Float32", val) - return 0, err - } -} - -func (cmd *Cmd) Float64() (float64, error) { - if cmd.err != nil { - return 0, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return float64(val), nil - case string: - return strconv.ParseFloat(val, 64) - default: - err := fmt.Errorf("redis: unexpected type=%T for Float64", val) - return 0, err - } -} - -func (cmd *Cmd) Bool() (bool, error) { - if cmd.err != nil { - return false, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return val != 0, nil - case string: - return strconv.ParseBool(val) - default: - err := fmt.Errorf("redis: unexpected type=%T for Bool", val) - return false, err - } -} - -func (cmd *Cmd) readReply(rd *proto.Reader) error { - cmd.val, cmd.err = rd.ReadReply(sliceParser) - return cmd.err -} - -// Implements proto.MultiBulkParse -func sliceParser(rd *proto.Reader, n int64) (interface{}, error) { - vals := make([]interface{}, 0, n) - for i := int64(0); i < n; i++ { - v, err := rd.ReadReply(sliceParser) - if err != nil { - if err == Nil { - vals = append(vals, nil) - continue - } - if err, ok := err.(proto.RedisError); ok { - vals = append(vals, err) - continue - } - return nil, err - } - - switch v := v.(type) { - case string: - vals = append(vals, v) - default: - vals = append(vals, v) - } - } - return vals, nil -} - -//------------------------------------------------------------------------------ - -type SliceCmd struct { - baseCmd - - val []interface{} -} - -var _ Cmder = (*SliceCmd)(nil) - -func NewSliceCmd(args ...interface{}) *SliceCmd { - return &SliceCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *SliceCmd) Val() []interface{} { - return cmd.val -} - -func (cmd *SliceCmd) Result() ([]interface{}, error) { - return cmd.val, cmd.err -} - -func (cmd *SliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *SliceCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(sliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]interface{}) - return nil -} - -//------------------------------------------------------------------------------ - -type StatusCmd struct { - baseCmd - - val string -} - -var _ Cmder = (*StatusCmd)(nil) - -func NewStatusCmd(args ...interface{}) *StatusCmd { - return &StatusCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *StatusCmd) Val() string { - return cmd.val -} - -func (cmd *StatusCmd) Result() (string, error) { - return cmd.val, cmd.err -} - -func (cmd *StatusCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StatusCmd) readReply(rd *proto.Reader) error { - cmd.val, cmd.err = rd.ReadString() - return cmd.err -} - -//------------------------------------------------------------------------------ - -type IntCmd struct { - baseCmd - - val int64 -} - -var _ Cmder = (*IntCmd)(nil) - -func NewIntCmd(args ...interface{}) *IntCmd { - return &IntCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *IntCmd) Val() int64 { - return cmd.val -} - -func (cmd *IntCmd) Result() (int64, error) { - return cmd.val, cmd.err -} - -func (cmd *IntCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *IntCmd) readReply(rd *proto.Reader) error { - cmd.val, cmd.err = rd.ReadIntReply() - return cmd.err -} - -//------------------------------------------------------------------------------ - -type DurationCmd struct { - baseCmd - - val time.Duration - precision time.Duration -} - -var _ Cmder = (*DurationCmd)(nil) - -func NewDurationCmd(precision time.Duration, args ...interface{}) *DurationCmd { - return &DurationCmd{ - baseCmd: baseCmd{_args: args}, - precision: precision, - } -} - -func (cmd *DurationCmd) Val() time.Duration { - return cmd.val -} - -func (cmd *DurationCmd) Result() (time.Duration, error) { - return cmd.val, cmd.err -} - -func (cmd *DurationCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *DurationCmd) readReply(rd *proto.Reader) error { - var n int64 - n, cmd.err = rd.ReadIntReply() - if cmd.err != nil { - return cmd.err - } - cmd.val = time.Duration(n) * cmd.precision - return nil -} - -//------------------------------------------------------------------------------ - -type TimeCmd struct { - baseCmd - - val time.Time -} - -var _ Cmder = (*TimeCmd)(nil) - -func NewTimeCmd(args ...interface{}) *TimeCmd { - return &TimeCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *TimeCmd) Val() time.Time { - return cmd.val -} - -func (cmd *TimeCmd) Result() (time.Time, error) { - return cmd.val, cmd.err -} - -func (cmd *TimeCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *TimeCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(timeParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.(time.Time) - return nil -} - -// Implements proto.MultiBulkParse -func timeParser(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d elements, expected 2", n) - } - - sec, err := rd.ReadInt() - if err != nil { - return nil, err - } - - microsec, err := rd.ReadInt() - if err != nil { - return nil, err - } - - return time.Unix(sec, microsec*1000), nil -} - -//------------------------------------------------------------------------------ - -type BoolCmd struct { - baseCmd - - val bool -} - -var _ Cmder = (*BoolCmd)(nil) - -func NewBoolCmd(args ...interface{}) *BoolCmd { - return &BoolCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *BoolCmd) Val() bool { - return cmd.val -} - -func (cmd *BoolCmd) Result() (bool, error) { - return cmd.val, cmd.err -} - -func (cmd *BoolCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *BoolCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadReply(nil) - // `SET key value NX` returns nil when key already exists. But - // `SETNX key value` returns bool (0/1). So convert nil to bool. - // TODO: is this okay? - if cmd.err == Nil { - cmd.val = false - cmd.err = nil - return nil - } - if cmd.err != nil { - return cmd.err - } - switch v := v.(type) { - case int64: - cmd.val = v == 1 - return nil - case string: - cmd.val = v == "OK" - return nil - default: - cmd.err = fmt.Errorf("got %T, wanted int64 or string", v) - return cmd.err - } -} - -//------------------------------------------------------------------------------ - -type StringCmd struct { - baseCmd - - val string -} - -var _ Cmder = (*StringCmd)(nil) - -func NewStringCmd(args ...interface{}) *StringCmd { - return &StringCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *StringCmd) Val() string { - return cmd.val -} - -func (cmd *StringCmd) Result() (string, error) { - return cmd.Val(), cmd.err -} - -func (cmd *StringCmd) Bytes() ([]byte, error) { - return []byte(cmd.val), cmd.err -} - -func (cmd *StringCmd) Int() (int, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.Atoi(cmd.Val()) -} - -func (cmd *StringCmd) Int64() (int64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.ParseInt(cmd.Val(), 10, 64) -} - -func (cmd *StringCmd) Uint64() (uint64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.ParseUint(cmd.Val(), 10, 64) -} - -func (cmd *StringCmd) Float32() (float32, error) { - if cmd.err != nil { - return 0, cmd.err - } - f, err := strconv.ParseFloat(cmd.Val(), 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -func (cmd *StringCmd) Float64() (float64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.ParseFloat(cmd.Val(), 64) -} - -func (cmd *StringCmd) Scan(val interface{}) error { - if cmd.err != nil { - return cmd.err - } - return proto.Scan([]byte(cmd.val), val) -} - -func (cmd *StringCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringCmd) readReply(rd *proto.Reader) error { - cmd.val, cmd.err = rd.ReadString() - return cmd.err -} - -//------------------------------------------------------------------------------ - -type FloatCmd struct { - baseCmd - - val float64 -} - -var _ Cmder = (*FloatCmd)(nil) - -func NewFloatCmd(args ...interface{}) *FloatCmd { - return &FloatCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *FloatCmd) Val() float64 { - return cmd.val -} - -func (cmd *FloatCmd) Result() (float64, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *FloatCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *FloatCmd) readReply(rd *proto.Reader) error { - cmd.val, cmd.err = rd.ReadFloatReply() - return cmd.err -} - -//------------------------------------------------------------------------------ - -type StringSliceCmd struct { - baseCmd - - val []string -} - -var _ Cmder = (*StringSliceCmd)(nil) - -func NewStringSliceCmd(args ...interface{}) *StringSliceCmd { - return &StringSliceCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *StringSliceCmd) Val() []string { - return cmd.val -} - -func (cmd *StringSliceCmd) Result() ([]string, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *StringSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringSliceCmd) ScanSlice(container interface{}) error { - return proto.ScanSlice(cmd.Val(), container) -} - -func (cmd *StringSliceCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(stringSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]string) - return nil -} - -// Implements proto.MultiBulkParse -func stringSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - ss := make([]string, 0, n) - for i := int64(0); i < n; i++ { - switch s, err := rd.ReadString(); { - case err == Nil: - ss = append(ss, "") - case err != nil: - return nil, err - default: - ss = append(ss, s) - } - } - return ss, nil -} - -//------------------------------------------------------------------------------ - -type BoolSliceCmd struct { - baseCmd - - val []bool -} - -var _ Cmder = (*BoolSliceCmd)(nil) - -func NewBoolSliceCmd(args ...interface{}) *BoolSliceCmd { - return &BoolSliceCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *BoolSliceCmd) Val() []bool { - return cmd.val -} - -func (cmd *BoolSliceCmd) Result() ([]bool, error) { - return cmd.val, cmd.err -} - -func (cmd *BoolSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *BoolSliceCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(boolSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]bool) - return nil -} - -// Implements proto.MultiBulkParse -func boolSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - bools := make([]bool, 0, n) - for i := int64(0); i < n; i++ { - n, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - bools = append(bools, n == 1) - } - return bools, nil -} - -//------------------------------------------------------------------------------ - -type StringStringMapCmd struct { - baseCmd - - val map[string]string -} - -var _ Cmder = (*StringStringMapCmd)(nil) - -func NewStringStringMapCmd(args ...interface{}) *StringStringMapCmd { - return &StringStringMapCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *StringStringMapCmd) Val() map[string]string { - return cmd.val -} - -func (cmd *StringStringMapCmd) Result() (map[string]string, error) { - return cmd.val, cmd.err -} - -func (cmd *StringStringMapCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringStringMapCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(stringStringMapParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.(map[string]string) - return nil -} - -// Implements proto.MultiBulkParse -func stringStringMapParser(rd *proto.Reader, n int64) (interface{}, error) { - m := make(map[string]string, n/2) - for i := int64(0); i < n; i += 2 { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - value, err := rd.ReadString() - if err != nil { - return nil, err - } - - m[key] = value - } - return m, nil -} - -//------------------------------------------------------------------------------ - -type StringIntMapCmd struct { - baseCmd - - val map[string]int64 -} - -var _ Cmder = (*StringIntMapCmd)(nil) - -func NewStringIntMapCmd(args ...interface{}) *StringIntMapCmd { - return &StringIntMapCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *StringIntMapCmd) Val() map[string]int64 { - return cmd.val -} - -func (cmd *StringIntMapCmd) Result() (map[string]int64, error) { - return cmd.val, cmd.err -} - -func (cmd *StringIntMapCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringIntMapCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(stringIntMapParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.(map[string]int64) - return nil -} - -// Implements proto.MultiBulkParse -func stringIntMapParser(rd *proto.Reader, n int64) (interface{}, error) { - m := make(map[string]int64, n/2) - for i := int64(0); i < n; i += 2 { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - n, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - m[key] = n - } - return m, nil -} - -//------------------------------------------------------------------------------ - -type StringStructMapCmd struct { - baseCmd - - val map[string]struct{} -} - -var _ Cmder = (*StringStructMapCmd)(nil) - -func NewStringStructMapCmd(args ...interface{}) *StringStructMapCmd { - return &StringStructMapCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *StringStructMapCmd) Val() map[string]struct{} { - return cmd.val -} - -func (cmd *StringStructMapCmd) Result() (map[string]struct{}, error) { - return cmd.val, cmd.err -} - -func (cmd *StringStructMapCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringStructMapCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(stringStructMapParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.(map[string]struct{}) - return nil -} - -// Implements proto.MultiBulkParse -func stringStructMapParser(rd *proto.Reader, n int64) (interface{}, error) { - m := make(map[string]struct{}, n) - for i := int64(0); i < n; i++ { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - m[key] = struct{}{} - } - return m, nil -} - -//------------------------------------------------------------------------------ - -type XMessage struct { - ID string - Values map[string]interface{} -} - -type XMessageSliceCmd struct { - baseCmd - - val []XMessage -} - -var _ Cmder = (*XMessageSliceCmd)(nil) - -func NewXMessageSliceCmd(args ...interface{}) *XMessageSliceCmd { - return &XMessageSliceCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *XMessageSliceCmd) Val() []XMessage { - return cmd.val -} - -func (cmd *XMessageSliceCmd) Result() ([]XMessage, error) { - return cmd.val, cmd.err -} - -func (cmd *XMessageSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XMessageSliceCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(xMessageSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]XMessage) - return nil -} - -// Implements proto.MultiBulkParse -func xMessageSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - msgs := make([]XMessage, 0, n) - for i := int64(0); i < n; i++ { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - id, err := rd.ReadString() - if err != nil { - return nil, err - } - - var values map[string]interface{} - - v, err := rd.ReadArrayReply(stringInterfaceMapParser) - if err != nil { - if err != proto.Nil { - return nil, err - } - } else { - values = v.(map[string]interface{}) - } - - msgs = append(msgs, XMessage{ - ID: id, - Values: values, - }) - return nil, nil - }) - if err != nil { - return nil, err - } - } - return msgs, nil -} - -// Implements proto.MultiBulkParse -func stringInterfaceMapParser(rd *proto.Reader, n int64) (interface{}, error) { - m := make(map[string]interface{}, n/2) - for i := int64(0); i < n; i += 2 { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - value, err := rd.ReadString() - if err != nil { - return nil, err - } - - m[key] = value - } - return m, nil -} - -//------------------------------------------------------------------------------ - -type XStream struct { - Stream string - Messages []XMessage -} - -type XStreamSliceCmd struct { - baseCmd - - val []XStream -} - -var _ Cmder = (*XStreamSliceCmd)(nil) - -func NewXStreamSliceCmd(args ...interface{}) *XStreamSliceCmd { - return &XStreamSliceCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *XStreamSliceCmd) Val() []XStream { - return cmd.val -} - -func (cmd *XStreamSliceCmd) Result() ([]XStream, error) { - return cmd.val, cmd.err -} - -func (cmd *XStreamSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XStreamSliceCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(xStreamSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]XStream) - return nil -} - -// Implements proto.MultiBulkParse -func xStreamSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - ret := make([]XStream, 0, n) - for i := int64(0); i < n; i++ { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d, wanted 2", n) - } - - stream, err := rd.ReadString() - if err != nil { - return nil, err - } - - v, err := rd.ReadArrayReply(xMessageSliceParser) - if err != nil { - return nil, err - } - - ret = append(ret, XStream{ - Stream: stream, - Messages: v.([]XMessage), - }) - return nil, nil - }) - if err != nil { - return nil, err - } - } - return ret, nil -} - -//------------------------------------------------------------------------------ - -type XPending struct { - Count int64 - Lower string - Higher string - Consumers map[string]int64 -} - -type XPendingCmd struct { - baseCmd - val *XPending -} - -var _ Cmder = (*XPendingCmd)(nil) - -func NewXPendingCmd(args ...interface{}) *XPendingCmd { - return &XPendingCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *XPendingCmd) Val() *XPending { - return cmd.val -} - -func (cmd *XPendingCmd) Result() (*XPending, error) { - return cmd.val, cmd.err -} - -func (cmd *XPendingCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XPendingCmd) readReply(rd *proto.Reader) error { - var info interface{} - info, cmd.err = rd.ReadArrayReply(xPendingParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = info.(*XPending) - return nil -} - -func xPendingParser(rd *proto.Reader, n int64) (interface{}, error) { - if n != 4 { - return nil, fmt.Errorf("got %d, wanted 4", n) - } - - count, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - lower, err := rd.ReadString() - if err != nil && err != Nil { - return nil, err - } - - higher, err := rd.ReadString() - if err != nil && err != Nil { - return nil, err - } - - pending := &XPending{ - Count: count, - Lower: lower, - Higher: higher, - } - _, err = rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - for i := int64(0); i < n; i++ { - _, err = rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d, wanted 2", n) - } - - consumerName, err := rd.ReadString() - if err != nil { - return nil, err - } - - consumerPending, err := rd.ReadInt() - if err != nil { - return nil, err - } - - if pending.Consumers == nil { - pending.Consumers = make(map[string]int64) - } - pending.Consumers[consumerName] = consumerPending - - return nil, nil - }) - if err != nil { - return nil, err - } - } - return nil, nil - }) - if err != nil && err != Nil { - return nil, err - } - - return pending, nil -} - -//------------------------------------------------------------------------------ - -type XPendingExt struct { - Id string - Consumer string - Idle time.Duration - RetryCount int64 -} - -type XPendingExtCmd struct { - baseCmd - val []XPendingExt -} - -var _ Cmder = (*XPendingExtCmd)(nil) - -func NewXPendingExtCmd(args ...interface{}) *XPendingExtCmd { - return &XPendingExtCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *XPendingExtCmd) Val() []XPendingExt { - return cmd.val -} - -func (cmd *XPendingExtCmd) Result() ([]XPendingExt, error) { - return cmd.val, cmd.err -} - -func (cmd *XPendingExtCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XPendingExtCmd) readReply(rd *proto.Reader) error { - var info interface{} - info, cmd.err = rd.ReadArrayReply(xPendingExtSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = info.([]XPendingExt) - return nil -} - -func xPendingExtSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - ret := make([]XPendingExt, 0, n) - for i := int64(0); i < n; i++ { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 4 { - return nil, fmt.Errorf("got %d, wanted 4", n) - } - - id, err := rd.ReadString() - if err != nil { - return nil, err - } - - consumer, err := rd.ReadString() - if err != nil && err != Nil { - return nil, err - } - - idle, err := rd.ReadIntReply() - if err != nil && err != Nil { - return nil, err - } - - retryCount, err := rd.ReadIntReply() - if err != nil && err != Nil { - return nil, err - } - - ret = append(ret, XPendingExt{ - Id: id, - Consumer: consumer, - Idle: time.Duration(idle) * time.Millisecond, - RetryCount: retryCount, - }) - return nil, nil - }) - if err != nil { - return nil, err - } - } - return ret, nil -} - -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ - -type ZSliceCmd struct { - baseCmd - - val []Z -} - -var _ Cmder = (*ZSliceCmd)(nil) - -func NewZSliceCmd(args ...interface{}) *ZSliceCmd { - return &ZSliceCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *ZSliceCmd) Val() []Z { - return cmd.val -} - -func (cmd *ZSliceCmd) Result() ([]Z, error) { - return cmd.val, cmd.err -} - -func (cmd *ZSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *ZSliceCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(zSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]Z) - return nil -} - -// Implements proto.MultiBulkParse -func zSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - zz := make([]Z, n/2) - for i := int64(0); i < n; i += 2 { - var err error - - z := &zz[i/2] - - z.Member, err = rd.ReadString() - if err != nil { - return nil, err - } - - z.Score, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - } - return zz, nil -} - -//------------------------------------------------------------------------------ - -type ZWithKeyCmd struct { - baseCmd - - val ZWithKey -} - -var _ Cmder = (*ZWithKeyCmd)(nil) - -func NewZWithKeyCmd(args ...interface{}) *ZWithKeyCmd { - return &ZWithKeyCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *ZWithKeyCmd) Val() ZWithKey { - return cmd.val -} - -func (cmd *ZWithKeyCmd) Result() (ZWithKey, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *ZWithKeyCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *ZWithKeyCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(zWithKeyParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.(ZWithKey) - return nil -} - -// Implements proto.MultiBulkParse -func zWithKeyParser(rd *proto.Reader, n int64) (interface{}, error) { - if n != 3 { - return nil, fmt.Errorf("got %d elements, expected 3", n) - } - - var z ZWithKey - var err error - - z.Key, err = rd.ReadString() - if err != nil { - return nil, err - } - z.Member, err = rd.ReadString() - if err != nil { - return nil, err - } - z.Score, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - return z, nil -} - -//------------------------------------------------------------------------------ - -type ScanCmd struct { - baseCmd - - page []string - cursor uint64 - - process func(cmd Cmder) error -} - -var _ Cmder = (*ScanCmd)(nil) - -func NewScanCmd(process func(cmd Cmder) error, args ...interface{}) *ScanCmd { - return &ScanCmd{ - baseCmd: baseCmd{_args: args}, - process: process, - } -} - -func (cmd *ScanCmd) Val() (keys []string, cursor uint64) { - return cmd.page, cmd.cursor -} - -func (cmd *ScanCmd) Result() (keys []string, cursor uint64, err error) { - return cmd.page, cmd.cursor, cmd.err -} - -func (cmd *ScanCmd) String() string { - return cmdString(cmd, cmd.page) -} - -func (cmd *ScanCmd) readReply(rd *proto.Reader) error { - cmd.page, cmd.cursor, cmd.err = rd.ReadScanReply() - return cmd.err -} - -// Iterator creates a new ScanIterator. -func (cmd *ScanCmd) Iterator() *ScanIterator { - return &ScanIterator{ - cmd: cmd, - } -} - -//------------------------------------------------------------------------------ - -type ClusterNode struct { - Id string - Addr string -} - -type ClusterSlot struct { - Start int - End int - Nodes []ClusterNode -} - -type ClusterSlotsCmd struct { - baseCmd - - val []ClusterSlot -} - -var _ Cmder = (*ClusterSlotsCmd)(nil) - -func NewClusterSlotsCmd(args ...interface{}) *ClusterSlotsCmd { - return &ClusterSlotsCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *ClusterSlotsCmd) Val() []ClusterSlot { - return cmd.val -} - -func (cmd *ClusterSlotsCmd) Result() ([]ClusterSlot, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *ClusterSlotsCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *ClusterSlotsCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(clusterSlotsParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.([]ClusterSlot) - return nil -} - -// Implements proto.MultiBulkParse -func clusterSlotsParser(rd *proto.Reader, n int64) (interface{}, error) { - slots := make([]ClusterSlot, n) - for i := 0; i < len(slots); i++ { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n < 2 { - err := fmt.Errorf("redis: got %d elements in cluster info, expected at least 2", n) - return nil, err - } - - start, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - end, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - nodes := make([]ClusterNode, n-2) - for j := 0; j < len(nodes); j++ { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n != 2 && n != 3 { - err := fmt.Errorf("got %d elements in cluster info address, expected 2 or 3", n) - return nil, err - } - - ip, err := rd.ReadString() - if err != nil { - return nil, err - } - - port, err := rd.ReadString() - if err != nil { - return nil, err - } - - nodes[j].Addr = net.JoinHostPort(ip, port) - - if n == 3 { - id, err := rd.ReadString() - if err != nil { - return nil, err - } - nodes[j].Id = id - } - } - - slots[i] = ClusterSlot{ - Start: int(start), - End: int(end), - Nodes: nodes, - } - } - return slots, nil -} - -//------------------------------------------------------------------------------ - -// GeoLocation is used with GeoAdd to add geospatial location. -type GeoLocation struct { - Name string - Longitude, Latitude, Dist float64 - GeoHash int64 -} - -// GeoRadiusQuery is used with GeoRadius to query geospatial index. -type GeoRadiusQuery struct { - Radius float64 - // Can be m, km, ft, or mi. Default is km. - Unit string - WithCoord bool - WithDist bool - WithGeoHash bool - Count int - // Can be ASC or DESC. Default is no sort order. - Sort string - Store string - StoreDist string -} - -type GeoLocationCmd struct { - baseCmd - - q *GeoRadiusQuery - locations []GeoLocation -} - -var _ Cmder = (*GeoLocationCmd)(nil) - -func NewGeoLocationCmd(q *GeoRadiusQuery, args ...interface{}) *GeoLocationCmd { - args = append(args, q.Radius) - if q.Unit != "" { - args = append(args, q.Unit) - } else { - args = append(args, "km") - } - if q.WithCoord { - args = append(args, "withcoord") - } - if q.WithDist { - args = append(args, "withdist") - } - if q.WithGeoHash { - args = append(args, "withhash") - } - if q.Count > 0 { - args = append(args, "count", q.Count) - } - if q.Sort != "" { - args = append(args, q.Sort) - } - if q.Store != "" { - args = append(args, "store") - args = append(args, q.Store) - } - if q.StoreDist != "" { - args = append(args, "storedist") - args = append(args, q.StoreDist) - } - return &GeoLocationCmd{ - baseCmd: baseCmd{_args: args}, - q: q, - } -} - -func (cmd *GeoLocationCmd) Val() []GeoLocation { - return cmd.locations -} - -func (cmd *GeoLocationCmd) Result() ([]GeoLocation, error) { - return cmd.locations, cmd.err -} - -func (cmd *GeoLocationCmd) String() string { - return cmdString(cmd, cmd.locations) -} - -func (cmd *GeoLocationCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(newGeoLocationSliceParser(cmd.q)) - if cmd.err != nil { - return cmd.err - } - cmd.locations = v.([]GeoLocation) - return nil -} - -func newGeoLocationParser(q *GeoRadiusQuery) proto.MultiBulkParse { - return func(rd *proto.Reader, n int64) (interface{}, error) { - var loc GeoLocation - var err error - - loc.Name, err = rd.ReadString() - if err != nil { - return nil, err - } - if q.WithDist { - loc.Dist, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - } - if q.WithGeoHash { - loc.GeoHash, err = rd.ReadIntReply() - if err != nil { - return nil, err - } - } - if q.WithCoord { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n != 2 { - return nil, fmt.Errorf("got %d coordinates, expected 2", n) - } - - loc.Longitude, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - loc.Latitude, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - } - - return &loc, nil - } -} - -func newGeoLocationSliceParser(q *GeoRadiusQuery) proto.MultiBulkParse { - return func(rd *proto.Reader, n int64) (interface{}, error) { - locs := make([]GeoLocation, 0, n) - for i := int64(0); i < n; i++ { - v, err := rd.ReadReply(newGeoLocationParser(q)) - if err != nil { - return nil, err - } - switch vv := v.(type) { - case string: - locs = append(locs, GeoLocation{ - Name: vv, - }) - case *GeoLocation: - locs = append(locs, *vv) - default: - return nil, fmt.Errorf("got %T, expected string or *GeoLocation", v) - } - } - return locs, nil - } -} - -//------------------------------------------------------------------------------ - -type GeoPos struct { - Longitude, Latitude float64 -} - -type GeoPosCmd struct { - baseCmd - - positions []*GeoPos -} - -var _ Cmder = (*GeoPosCmd)(nil) - -func NewGeoPosCmd(args ...interface{}) *GeoPosCmd { - return &GeoPosCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *GeoPosCmd) Val() []*GeoPos { - return cmd.positions -} - -func (cmd *GeoPosCmd) Result() ([]*GeoPos, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *GeoPosCmd) String() string { - return cmdString(cmd, cmd.positions) -} - -func (cmd *GeoPosCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(geoPosSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.positions = v.([]*GeoPos) - return nil -} - -func geoPosSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - positions := make([]*GeoPos, 0, n) - for i := int64(0); i < n; i++ { - v, err := rd.ReadReply(geoPosParser) - if err != nil { - if err == Nil { - positions = append(positions, nil) - continue - } - return nil, err - } - switch v := v.(type) { - case *GeoPos: - positions = append(positions, v) - default: - return nil, fmt.Errorf("got %T, expected *GeoPos", v) - } - } - return positions, nil -} - -func geoPosParser(rd *proto.Reader, n int64) (interface{}, error) { - var pos GeoPos - var err error - - pos.Longitude, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - - pos.Latitude, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - - return &pos, nil -} - -//------------------------------------------------------------------------------ - -type CommandInfo struct { - Name string - Arity int8 - Flags []string - FirstKeyPos int8 - LastKeyPos int8 - StepCount int8 - ReadOnly bool -} - -type CommandsInfoCmd struct { - baseCmd - - val map[string]*CommandInfo -} - -var _ Cmder = (*CommandsInfoCmd)(nil) - -func NewCommandsInfoCmd(args ...interface{}) *CommandsInfoCmd { - return &CommandsInfoCmd{ - baseCmd: baseCmd{_args: args}, - } -} - -func (cmd *CommandsInfoCmd) Val() map[string]*CommandInfo { - return cmd.val -} - -func (cmd *CommandsInfoCmd) Result() (map[string]*CommandInfo, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *CommandsInfoCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *CommandsInfoCmd) readReply(rd *proto.Reader) error { - var v interface{} - v, cmd.err = rd.ReadArrayReply(commandInfoSliceParser) - if cmd.err != nil { - return cmd.err - } - cmd.val = v.(map[string]*CommandInfo) - return nil -} - -// Implements proto.MultiBulkParse -func commandInfoSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - m := make(map[string]*CommandInfo, n) - for i := int64(0); i < n; i++ { - v, err := rd.ReadReply(commandInfoParser) - if err != nil { - return nil, err - } - vv := v.(*CommandInfo) - m[vv.Name] = vv - - } - return m, nil -} - -func commandInfoParser(rd *proto.Reader, n int64) (interface{}, error) { - var cmd CommandInfo - var err error - - if n != 6 { - return nil, fmt.Errorf("redis: got %d elements in COMMAND reply, wanted 6", n) - } - - cmd.Name, err = rd.ReadString() - if err != nil { - return nil, err - } - - arity, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.Arity = int8(arity) - - flags, err := rd.ReadReply(stringSliceParser) - if err != nil { - return nil, err - } - cmd.Flags = flags.([]string) - - firstKeyPos, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.FirstKeyPos = int8(firstKeyPos) - - lastKeyPos, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.LastKeyPos = int8(lastKeyPos) - - stepCount, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.StepCount = int8(stepCount) - - for _, flag := range cmd.Flags { - if flag == "readonly" { - cmd.ReadOnly = true - break - } - } - - return &cmd, nil -} - -//------------------------------------------------------------------------------ - -type cmdsInfoCache struct { - fn func() (map[string]*CommandInfo, error) - - once internal.Once - cmds map[string]*CommandInfo -} - -func newCmdsInfoCache(fn func() (map[string]*CommandInfo, error)) *cmdsInfoCache { - return &cmdsInfoCache{ - fn: fn, - } -} - -func (c *cmdsInfoCache) Get() (map[string]*CommandInfo, error) { - err := c.once.Do(func() error { - cmds, err := c.fn() - if err != nil { - return err - } - c.cmds = cmds - return nil - }) - return c.cmds, err -} diff --git a/vendor/github.com/go-redis/redis/commands.go b/vendor/github.com/go-redis/redis/commands.go deleted file mode 100644 index 653e4abe96..0000000000 --- a/vendor/github.com/go-redis/redis/commands.go +++ /dev/null @@ -1,2583 +0,0 @@ -package redis - -import ( - "errors" - "io" - "time" - - "github.com/go-redis/redis/internal" -) - -func usePrecise(dur time.Duration) bool { - return dur < time.Second || dur%time.Second != 0 -} - -func formatMs(dur time.Duration) int64 { - if dur > 0 && dur < time.Millisecond { - internal.Logf( - "specified duration is %s, but minimal supported value is %s", - dur, time.Millisecond, - ) - } - return int64(dur / time.Millisecond) -} - -func formatSec(dur time.Duration) int64 { - if dur > 0 && dur < time.Second { - internal.Logf( - "specified duration is %s, but minimal supported value is %s", - dur, time.Second, - ) - } - return int64(dur / time.Second) -} - -func appendArgs(dst, src []interface{}) []interface{} { - if len(src) == 1 { - if ss, ok := src[0].([]string); ok { - for _, s := range ss { - dst = append(dst, s) - } - return dst - } - } - - for _, v := range src { - dst = append(dst, v) - } - return dst -} - -type Cmdable interface { - Pipeline() Pipeliner - Pipelined(fn func(Pipeliner) error) ([]Cmder, error) - - TxPipelined(fn func(Pipeliner) error) ([]Cmder, error) - TxPipeline() Pipeliner - - Command() *CommandsInfoCmd - ClientGetName() *StringCmd - Echo(message interface{}) *StringCmd - Ping() *StatusCmd - Quit() *StatusCmd - Del(keys ...string) *IntCmd - Unlink(keys ...string) *IntCmd - Dump(key string) *StringCmd - Exists(keys ...string) *IntCmd - Expire(key string, expiration time.Duration) *BoolCmd - ExpireAt(key string, tm time.Time) *BoolCmd - Keys(pattern string) *StringSliceCmd - Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd - Move(key string, db int64) *BoolCmd - ObjectRefCount(key string) *IntCmd - ObjectEncoding(key string) *StringCmd - ObjectIdleTime(key string) *DurationCmd - Persist(key string) *BoolCmd - PExpire(key string, expiration time.Duration) *BoolCmd - PExpireAt(key string, tm time.Time) *BoolCmd - PTTL(key string) *DurationCmd - RandomKey() *StringCmd - Rename(key, newkey string) *StatusCmd - RenameNX(key, newkey string) *BoolCmd - Restore(key string, ttl time.Duration, value string) *StatusCmd - RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd - Sort(key string, sort *Sort) *StringSliceCmd - SortStore(key, store string, sort *Sort) *IntCmd - SortInterfaces(key string, sort *Sort) *SliceCmd - Touch(keys ...string) *IntCmd - TTL(key string) *DurationCmd - Type(key string) *StatusCmd - Scan(cursor uint64, match string, count int64) *ScanCmd - SScan(key string, cursor uint64, match string, count int64) *ScanCmd - HScan(key string, cursor uint64, match string, count int64) *ScanCmd - ZScan(key string, cursor uint64, match string, count int64) *ScanCmd - Append(key, value string) *IntCmd - BitCount(key string, bitCount *BitCount) *IntCmd - BitOpAnd(destKey string, keys ...string) *IntCmd - BitOpOr(destKey string, keys ...string) *IntCmd - BitOpXor(destKey string, keys ...string) *IntCmd - BitOpNot(destKey string, key string) *IntCmd - BitPos(key string, bit int64, pos ...int64) *IntCmd - Decr(key string) *IntCmd - DecrBy(key string, decrement int64) *IntCmd - Get(key string) *StringCmd - GetBit(key string, offset int64) *IntCmd - GetRange(key string, start, end int64) *StringCmd - GetSet(key string, value interface{}) *StringCmd - Incr(key string) *IntCmd - IncrBy(key string, value int64) *IntCmd - IncrByFloat(key string, value float64) *FloatCmd - MGet(keys ...string) *SliceCmd - MSet(pairs ...interface{}) *StatusCmd - MSetNX(pairs ...interface{}) *BoolCmd - Set(key string, value interface{}, expiration time.Duration) *StatusCmd - SetBit(key string, offset int64, value int) *IntCmd - SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd - SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd - SetRange(key string, offset int64, value string) *IntCmd - StrLen(key string) *IntCmd - HDel(key string, fields ...string) *IntCmd - HExists(key, field string) *BoolCmd - HGet(key, field string) *StringCmd - HGetAll(key string) *StringStringMapCmd - HIncrBy(key, field string, incr int64) *IntCmd - HIncrByFloat(key, field string, incr float64) *FloatCmd - HKeys(key string) *StringSliceCmd - HLen(key string) *IntCmd - HMGet(key string, fields ...string) *SliceCmd - HMSet(key string, fields map[string]interface{}) *StatusCmd - HSet(key, field string, value interface{}) *BoolCmd - HSetNX(key, field string, value interface{}) *BoolCmd - HVals(key string) *StringSliceCmd - BLPop(timeout time.Duration, keys ...string) *StringSliceCmd - BRPop(timeout time.Duration, keys ...string) *StringSliceCmd - BRPopLPush(source, destination string, timeout time.Duration) *StringCmd - LIndex(key string, index int64) *StringCmd - LInsert(key, op string, pivot, value interface{}) *IntCmd - LInsertBefore(key string, pivot, value interface{}) *IntCmd - LInsertAfter(key string, pivot, value interface{}) *IntCmd - LLen(key string) *IntCmd - LPop(key string) *StringCmd - LPush(key string, values ...interface{}) *IntCmd - LPushX(key string, value interface{}) *IntCmd - LRange(key string, start, stop int64) *StringSliceCmd - LRem(key string, count int64, value interface{}) *IntCmd - LSet(key string, index int64, value interface{}) *StatusCmd - LTrim(key string, start, stop int64) *StatusCmd - RPop(key string) *StringCmd - RPopLPush(source, destination string) *StringCmd - RPush(key string, values ...interface{}) *IntCmd - RPushX(key string, value interface{}) *IntCmd - SAdd(key string, members ...interface{}) *IntCmd - SCard(key string) *IntCmd - SDiff(keys ...string) *StringSliceCmd - SDiffStore(destination string, keys ...string) *IntCmd - SInter(keys ...string) *StringSliceCmd - SInterStore(destination string, keys ...string) *IntCmd - SIsMember(key string, member interface{}) *BoolCmd - SMembers(key string) *StringSliceCmd - SMembersMap(key string) *StringStructMapCmd - SMove(source, destination string, member interface{}) *BoolCmd - SPop(key string) *StringCmd - SPopN(key string, count int64) *StringSliceCmd - SRandMember(key string) *StringCmd - SRandMemberN(key string, count int64) *StringSliceCmd - SRem(key string, members ...interface{}) *IntCmd - SUnion(keys ...string) *StringSliceCmd - SUnionStore(destination string, keys ...string) *IntCmd - XAdd(a *XAddArgs) *StringCmd - XDel(stream string, ids ...string) *IntCmd - XLen(stream string) *IntCmd - XRange(stream, start, stop string) *XMessageSliceCmd - XRangeN(stream, start, stop string, count int64) *XMessageSliceCmd - XRevRange(stream string, start, stop string) *XMessageSliceCmd - XRevRangeN(stream string, start, stop string, count int64) *XMessageSliceCmd - XRead(a *XReadArgs) *XStreamSliceCmd - XReadStreams(streams ...string) *XStreamSliceCmd - XGroupCreate(stream, group, start string) *StatusCmd - XGroupCreateMkStream(stream, group, start string) *StatusCmd - XGroupSetID(stream, group, start string) *StatusCmd - XGroupDestroy(stream, group string) *IntCmd - XGroupDelConsumer(stream, group, consumer string) *IntCmd - XReadGroup(a *XReadGroupArgs) *XStreamSliceCmd - XAck(stream, group string, ids ...string) *IntCmd - XPending(stream, group string) *XPendingCmd - XPendingExt(a *XPendingExtArgs) *XPendingExtCmd - XClaim(a *XClaimArgs) *XMessageSliceCmd - XClaimJustID(a *XClaimArgs) *StringSliceCmd - XTrim(key string, maxLen int64) *IntCmd - XTrimApprox(key string, maxLen int64) *IntCmd - BZPopMax(timeout time.Duration, keys ...string) *ZWithKeyCmd - BZPopMin(timeout time.Duration, keys ...string) *ZWithKeyCmd - ZAdd(key string, members ...Z) *IntCmd - ZAddNX(key string, members ...Z) *IntCmd - ZAddXX(key string, members ...Z) *IntCmd - ZAddCh(key string, members ...Z) *IntCmd - ZAddNXCh(key string, members ...Z) *IntCmd - ZAddXXCh(key string, members ...Z) *IntCmd - ZIncr(key string, member Z) *FloatCmd - ZIncrNX(key string, member Z) *FloatCmd - ZIncrXX(key string, member Z) *FloatCmd - ZCard(key string) *IntCmd - ZCount(key, min, max string) *IntCmd - ZLexCount(key, min, max string) *IntCmd - ZIncrBy(key string, increment float64, member string) *FloatCmd - ZInterStore(destination string, store ZStore, keys ...string) *IntCmd - ZPopMax(key string, count ...int64) *ZSliceCmd - ZPopMin(key string, count ...int64) *ZSliceCmd - ZRange(key string, start, stop int64) *StringSliceCmd - ZRangeWithScores(key string, start, stop int64) *ZSliceCmd - ZRangeByScore(key string, opt ZRangeBy) *StringSliceCmd - ZRangeByLex(key string, opt ZRangeBy) *StringSliceCmd - ZRangeByScoreWithScores(key string, opt ZRangeBy) *ZSliceCmd - ZRank(key, member string) *IntCmd - ZRem(key string, members ...interface{}) *IntCmd - ZRemRangeByRank(key string, start, stop int64) *IntCmd - ZRemRangeByScore(key, min, max string) *IntCmd - ZRemRangeByLex(key, min, max string) *IntCmd - ZRevRange(key string, start, stop int64) *StringSliceCmd - ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd - ZRevRangeByScore(key string, opt ZRangeBy) *StringSliceCmd - ZRevRangeByLex(key string, opt ZRangeBy) *StringSliceCmd - ZRevRangeByScoreWithScores(key string, opt ZRangeBy) *ZSliceCmd - ZRevRank(key, member string) *IntCmd - ZScore(key, member string) *FloatCmd - ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd - PFAdd(key string, els ...interface{}) *IntCmd - PFCount(keys ...string) *IntCmd - PFMerge(dest string, keys ...string) *StatusCmd - BgRewriteAOF() *StatusCmd - BgSave() *StatusCmd - ClientKill(ipPort string) *StatusCmd - ClientKillByFilter(keys ...string) *IntCmd - ClientList() *StringCmd - ClientPause(dur time.Duration) *BoolCmd - ClientID() *IntCmd - ConfigGet(parameter string) *SliceCmd - ConfigResetStat() *StatusCmd - ConfigSet(parameter, value string) *StatusCmd - ConfigRewrite() *StatusCmd - DBSize() *IntCmd - FlushAll() *StatusCmd - FlushAllAsync() *StatusCmd - FlushDB() *StatusCmd - FlushDBAsync() *StatusCmd - Info(section ...string) *StringCmd - LastSave() *IntCmd - Save() *StatusCmd - Shutdown() *StatusCmd - ShutdownSave() *StatusCmd - ShutdownNoSave() *StatusCmd - SlaveOf(host, port string) *StatusCmd - Time() *TimeCmd - Eval(script string, keys []string, args ...interface{}) *Cmd - EvalSha(sha1 string, keys []string, args ...interface{}) *Cmd - ScriptExists(hashes ...string) *BoolSliceCmd - ScriptFlush() *StatusCmd - ScriptKill() *StatusCmd - ScriptLoad(script string) *StringCmd - DebugObject(key string) *StringCmd - Publish(channel string, message interface{}) *IntCmd - PubSubChannels(pattern string) *StringSliceCmd - PubSubNumSub(channels ...string) *StringIntMapCmd - PubSubNumPat() *IntCmd - ClusterSlots() *ClusterSlotsCmd - ClusterNodes() *StringCmd - ClusterMeet(host, port string) *StatusCmd - ClusterForget(nodeID string) *StatusCmd - ClusterReplicate(nodeID string) *StatusCmd - ClusterResetSoft() *StatusCmd - ClusterResetHard() *StatusCmd - ClusterInfo() *StringCmd - ClusterKeySlot(key string) *IntCmd - ClusterGetKeysInSlot(slot int, count int) *StringSliceCmd - ClusterCountFailureReports(nodeID string) *IntCmd - ClusterCountKeysInSlot(slot int) *IntCmd - ClusterDelSlots(slots ...int) *StatusCmd - ClusterDelSlotsRange(min, max int) *StatusCmd - ClusterSaveConfig() *StatusCmd - ClusterSlaves(nodeID string) *StringSliceCmd - ClusterFailover() *StatusCmd - ClusterAddSlots(slots ...int) *StatusCmd - ClusterAddSlotsRange(min, max int) *StatusCmd - GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd - GeoPos(key string, members ...string) *GeoPosCmd - GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd - GeoRadiusRO(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd - GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd - GeoRadiusByMemberRO(key, member string, query *GeoRadiusQuery) *GeoLocationCmd - GeoDist(key string, member1, member2, unit string) *FloatCmd - GeoHash(key string, members ...string) *StringSliceCmd - ReadOnly() *StatusCmd - ReadWrite() *StatusCmd - MemoryUsage(key string, samples ...int) *IntCmd -} - -type StatefulCmdable interface { - Cmdable - Auth(password string) *StatusCmd - Select(index int) *StatusCmd - SwapDB(index1, index2 int) *StatusCmd - ClientSetName(name string) *BoolCmd -} - -var _ Cmdable = (*Client)(nil) -var _ Cmdable = (*Tx)(nil) -var _ Cmdable = (*Ring)(nil) -var _ Cmdable = (*ClusterClient)(nil) - -type cmdable struct { - process func(cmd Cmder) error -} - -func (c *cmdable) setProcessor(fn func(Cmder) error) { - c.process = fn -} - -type statefulCmdable struct { - cmdable - process func(cmd Cmder) error -} - -func (c *statefulCmdable) setProcessor(fn func(Cmder) error) { - c.process = fn - c.cmdable.setProcessor(fn) -} - -//------------------------------------------------------------------------------ - -func (c *statefulCmdable) Auth(password string) *StatusCmd { - cmd := NewStatusCmd("auth", password) - c.process(cmd) - return cmd -} - -func (c *cmdable) Echo(message interface{}) *StringCmd { - cmd := NewStringCmd("echo", message) - c.process(cmd) - return cmd -} - -func (c *cmdable) Ping() *StatusCmd { - cmd := NewStatusCmd("ping") - c.process(cmd) - return cmd -} - -func (c *cmdable) Wait(numSlaves int, timeout time.Duration) *IntCmd { - cmd := NewIntCmd("wait", numSlaves, int(timeout/time.Millisecond)) - c.process(cmd) - return cmd -} - -func (c *cmdable) Quit() *StatusCmd { - panic("not implemented") -} - -func (c *statefulCmdable) Select(index int) *StatusCmd { - cmd := NewStatusCmd("select", index) - c.process(cmd) - return cmd -} - -func (c *statefulCmdable) SwapDB(index1, index2 int) *StatusCmd { - cmd := NewStatusCmd("swapdb", index1, index2) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) Command() *CommandsInfoCmd { - cmd := NewCommandsInfoCmd("command") - c.process(cmd) - return cmd -} - -func (c *cmdable) Del(keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "del" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) Unlink(keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "unlink" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) Dump(key string) *StringCmd { - cmd := NewStringCmd("dump", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) Exists(keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "exists" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) Expire(key string, expiration time.Duration) *BoolCmd { - cmd := NewBoolCmd("expire", key, formatSec(expiration)) - c.process(cmd) - return cmd -} - -func (c *cmdable) ExpireAt(key string, tm time.Time) *BoolCmd { - cmd := NewBoolCmd("expireat", key, tm.Unix()) - c.process(cmd) - return cmd -} - -func (c *cmdable) Keys(pattern string) *StringSliceCmd { - cmd := NewStringSliceCmd("keys", pattern) - c.process(cmd) - return cmd -} - -func (c *cmdable) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd { - cmd := NewStatusCmd( - "migrate", - host, - port, - key, - db, - formatMs(timeout), - ) - cmd.setReadTimeout(timeout) - c.process(cmd) - return cmd -} - -func (c *cmdable) Move(key string, db int64) *BoolCmd { - cmd := NewBoolCmd("move", key, db) - c.process(cmd) - return cmd -} - -func (c *cmdable) ObjectRefCount(key string) *IntCmd { - cmd := NewIntCmd("object", "refcount", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) ObjectEncoding(key string) *StringCmd { - cmd := NewStringCmd("object", "encoding", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) ObjectIdleTime(key string) *DurationCmd { - cmd := NewDurationCmd(time.Second, "object", "idletime", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) Persist(key string) *BoolCmd { - cmd := NewBoolCmd("persist", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) PExpire(key string, expiration time.Duration) *BoolCmd { - cmd := NewBoolCmd("pexpire", key, formatMs(expiration)) - c.process(cmd) - return cmd -} - -func (c *cmdable) PExpireAt(key string, tm time.Time) *BoolCmd { - cmd := NewBoolCmd( - "pexpireat", - key, - tm.UnixNano()/int64(time.Millisecond), - ) - c.process(cmd) - return cmd -} - -func (c *cmdable) PTTL(key string) *DurationCmd { - cmd := NewDurationCmd(time.Millisecond, "pttl", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) RandomKey() *StringCmd { - cmd := NewStringCmd("randomkey") - c.process(cmd) - return cmd -} - -func (c *cmdable) Rename(key, newkey string) *StatusCmd { - cmd := NewStatusCmd("rename", key, newkey) - c.process(cmd) - return cmd -} - -func (c *cmdable) RenameNX(key, newkey string) *BoolCmd { - cmd := NewBoolCmd("renamenx", key, newkey) - c.process(cmd) - return cmd -} - -func (c *cmdable) Restore(key string, ttl time.Duration, value string) *StatusCmd { - cmd := NewStatusCmd( - "restore", - key, - formatMs(ttl), - value, - ) - c.process(cmd) - return cmd -} - -func (c *cmdable) RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd { - cmd := NewStatusCmd( - "restore", - key, - formatMs(ttl), - value, - "replace", - ) - c.process(cmd) - return cmd -} - -type Sort struct { - By string - Offset, Count int64 - Get []string - Order string - Alpha bool -} - -func (sort *Sort) args(key string) []interface{} { - args := []interface{}{"sort", key} - if sort.By != "" { - args = append(args, "by", sort.By) - } - if sort.Offset != 0 || sort.Count != 0 { - args = append(args, "limit", sort.Offset, sort.Count) - } - for _, get := range sort.Get { - args = append(args, "get", get) - } - if sort.Order != "" { - args = append(args, sort.Order) - } - if sort.Alpha { - args = append(args, "alpha") - } - return args -} - -func (c *cmdable) Sort(key string, sort *Sort) *StringSliceCmd { - cmd := NewStringSliceCmd(sort.args(key)...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SortStore(key, store string, sort *Sort) *IntCmd { - args := sort.args(key) - if store != "" { - args = append(args, "store", store) - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SortInterfaces(key string, sort *Sort) *SliceCmd { - cmd := NewSliceCmd(sort.args(key)...) - c.process(cmd) - return cmd -} - -func (c *cmdable) Touch(keys ...string) *IntCmd { - args := make([]interface{}, len(keys)+1) - args[0] = "touch" - for i, key := range keys { - args[i+1] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) TTL(key string) *DurationCmd { - cmd := NewDurationCmd(time.Second, "ttl", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) Type(key string) *StatusCmd { - cmd := NewStatusCmd("type", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) Scan(cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"scan", cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(c.process, args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SScan(key string, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"sscan", key, cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(c.process, args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) HScan(key string, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"hscan", key, cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(c.process, args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZScan(key string, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"zscan", key, cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(c.process, args...) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) Append(key, value string) *IntCmd { - cmd := NewIntCmd("append", key, value) - c.process(cmd) - return cmd -} - -type BitCount struct { - Start, End int64 -} - -func (c *cmdable) BitCount(key string, bitCount *BitCount) *IntCmd { - args := []interface{}{"bitcount", key} - if bitCount != nil { - args = append( - args, - bitCount.Start, - bitCount.End, - ) - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) bitOp(op, destKey string, keys ...string) *IntCmd { - args := make([]interface{}, 3+len(keys)) - args[0] = "bitop" - args[1] = op - args[2] = destKey - for i, key := range keys { - args[3+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) BitOpAnd(destKey string, keys ...string) *IntCmd { - return c.bitOp("and", destKey, keys...) -} - -func (c *cmdable) BitOpOr(destKey string, keys ...string) *IntCmd { - return c.bitOp("or", destKey, keys...) -} - -func (c *cmdable) BitOpXor(destKey string, keys ...string) *IntCmd { - return c.bitOp("xor", destKey, keys...) -} - -func (c *cmdable) BitOpNot(destKey string, key string) *IntCmd { - return c.bitOp("not", destKey, key) -} - -func (c *cmdable) BitPos(key string, bit int64, pos ...int64) *IntCmd { - args := make([]interface{}, 3+len(pos)) - args[0] = "bitpos" - args[1] = key - args[2] = bit - switch len(pos) { - case 0: - case 1: - args[3] = pos[0] - case 2: - args[3] = pos[0] - args[4] = pos[1] - default: - panic("too many arguments") - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) Decr(key string) *IntCmd { - cmd := NewIntCmd("decr", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) DecrBy(key string, decrement int64) *IntCmd { - cmd := NewIntCmd("decrby", key, decrement) - c.process(cmd) - return cmd -} - -// Redis `GET key` command. It returns redis.Nil error when key does not exist. -func (c *cmdable) Get(key string) *StringCmd { - cmd := NewStringCmd("get", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) GetBit(key string, offset int64) *IntCmd { - cmd := NewIntCmd("getbit", key, offset) - c.process(cmd) - return cmd -} - -func (c *cmdable) GetRange(key string, start, end int64) *StringCmd { - cmd := NewStringCmd("getrange", key, start, end) - c.process(cmd) - return cmd -} - -func (c *cmdable) GetSet(key string, value interface{}) *StringCmd { - cmd := NewStringCmd("getset", key, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) Incr(key string) *IntCmd { - cmd := NewIntCmd("incr", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) IncrBy(key string, value int64) *IntCmd { - cmd := NewIntCmd("incrby", key, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) IncrByFloat(key string, value float64) *FloatCmd { - cmd := NewFloatCmd("incrbyfloat", key, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) MGet(keys ...string) *SliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "mget" - for i, key := range keys { - args[1+i] = key - } - cmd := NewSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) MSet(pairs ...interface{}) *StatusCmd { - args := make([]interface{}, 1, 1+len(pairs)) - args[0] = "mset" - args = appendArgs(args, pairs) - cmd := NewStatusCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) MSetNX(pairs ...interface{}) *BoolCmd { - args := make([]interface{}, 1, 1+len(pairs)) - args[0] = "msetnx" - args = appendArgs(args, pairs) - cmd := NewBoolCmd(args...) - c.process(cmd) - return cmd -} - -// Redis `SET key value [expiration]` command. -// -// Use expiration for `SETEX`-like behavior. -// Zero expiration means the key has no expiration time. -func (c *cmdable) Set(key string, value interface{}, expiration time.Duration) *StatusCmd { - args := make([]interface{}, 3, 4) - args[0] = "set" - args[1] = key - args[2] = value - if expiration > 0 { - if usePrecise(expiration) { - args = append(args, "px", formatMs(expiration)) - } else { - args = append(args, "ex", formatSec(expiration)) - } - } - cmd := NewStatusCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SetBit(key string, offset int64, value int) *IntCmd { - cmd := NewIntCmd( - "setbit", - key, - offset, - value, - ) - c.process(cmd) - return cmd -} - -// Redis `SET key value [expiration] NX` command. -// -// Zero expiration means the key has no expiration time. -func (c *cmdable) SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd { - var cmd *BoolCmd - if expiration == 0 { - // Use old `SETNX` to support old Redis versions. - cmd = NewBoolCmd("setnx", key, value) - } else { - if usePrecise(expiration) { - cmd = NewBoolCmd("set", key, value, "px", formatMs(expiration), "nx") - } else { - cmd = NewBoolCmd("set", key, value, "ex", formatSec(expiration), "nx") - } - } - c.process(cmd) - return cmd -} - -// Redis `SET key value [expiration] XX` command. -// -// Zero expiration means the key has no expiration time. -func (c *cmdable) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd { - var cmd *BoolCmd - if expiration == 0 { - cmd = NewBoolCmd("set", key, value, "xx") - } else { - if usePrecise(expiration) { - cmd = NewBoolCmd("set", key, value, "px", formatMs(expiration), "xx") - } else { - cmd = NewBoolCmd("set", key, value, "ex", formatSec(expiration), "xx") - } - } - c.process(cmd) - return cmd -} - -func (c *cmdable) SetRange(key string, offset int64, value string) *IntCmd { - cmd := NewIntCmd("setrange", key, offset, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) StrLen(key string) *IntCmd { - cmd := NewIntCmd("strlen", key) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) HDel(key string, fields ...string) *IntCmd { - args := make([]interface{}, 2+len(fields)) - args[0] = "hdel" - args[1] = key - for i, field := range fields { - args[2+i] = field - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) HExists(key, field string) *BoolCmd { - cmd := NewBoolCmd("hexists", key, field) - c.process(cmd) - return cmd -} - -func (c *cmdable) HGet(key, field string) *StringCmd { - cmd := NewStringCmd("hget", key, field) - c.process(cmd) - return cmd -} - -func (c *cmdable) HGetAll(key string) *StringStringMapCmd { - cmd := NewStringStringMapCmd("hgetall", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) HIncrBy(key, field string, incr int64) *IntCmd { - cmd := NewIntCmd("hincrby", key, field, incr) - c.process(cmd) - return cmd -} - -func (c *cmdable) HIncrByFloat(key, field string, incr float64) *FloatCmd { - cmd := NewFloatCmd("hincrbyfloat", key, field, incr) - c.process(cmd) - return cmd -} - -func (c *cmdable) HKeys(key string) *StringSliceCmd { - cmd := NewStringSliceCmd("hkeys", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) HLen(key string) *IntCmd { - cmd := NewIntCmd("hlen", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) HMGet(key string, fields ...string) *SliceCmd { - args := make([]interface{}, 2+len(fields)) - args[0] = "hmget" - args[1] = key - for i, field := range fields { - args[2+i] = field - } - cmd := NewSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) HMSet(key string, fields map[string]interface{}) *StatusCmd { - args := make([]interface{}, 2+len(fields)*2) - args[0] = "hmset" - args[1] = key - i := 2 - for k, v := range fields { - args[i] = k - args[i+1] = v - i += 2 - } - cmd := NewStatusCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) HSet(key, field string, value interface{}) *BoolCmd { - cmd := NewBoolCmd("hset", key, field, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) HSetNX(key, field string, value interface{}) *BoolCmd { - cmd := NewBoolCmd("hsetnx", key, field, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) HVals(key string) *StringSliceCmd { - cmd := NewStringSliceCmd("hvals", key) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "blpop" - for i, key := range keys { - args[1+i] = key - } - args[len(args)-1] = formatSec(timeout) - cmd := NewStringSliceCmd(args...) - cmd.setReadTimeout(timeout) - c.process(cmd) - return cmd -} - -func (c *cmdable) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "brpop" - for i, key := range keys { - args[1+i] = key - } - args[len(keys)+1] = formatSec(timeout) - cmd := NewStringSliceCmd(args...) - cmd.setReadTimeout(timeout) - c.process(cmd) - return cmd -} - -func (c *cmdable) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd { - cmd := NewStringCmd( - "brpoplpush", - source, - destination, - formatSec(timeout), - ) - cmd.setReadTimeout(timeout) - c.process(cmd) - return cmd -} - -func (c *cmdable) LIndex(key string, index int64) *StringCmd { - cmd := NewStringCmd("lindex", key, index) - c.process(cmd) - return cmd -} - -func (c *cmdable) LInsert(key, op string, pivot, value interface{}) *IntCmd { - cmd := NewIntCmd("linsert", key, op, pivot, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) LInsertBefore(key string, pivot, value interface{}) *IntCmd { - cmd := NewIntCmd("linsert", key, "before", pivot, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) LInsertAfter(key string, pivot, value interface{}) *IntCmd { - cmd := NewIntCmd("linsert", key, "after", pivot, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) LLen(key string) *IntCmd { - cmd := NewIntCmd("llen", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) LPop(key string) *StringCmd { - cmd := NewStringCmd("lpop", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) LPush(key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "lpush" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) LPushX(key string, value interface{}) *IntCmd { - cmd := NewIntCmd("lpushx", key, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) LRange(key string, start, stop int64) *StringSliceCmd { - cmd := NewStringSliceCmd( - "lrange", - key, - start, - stop, - ) - c.process(cmd) - return cmd -} - -func (c *cmdable) LRem(key string, count int64, value interface{}) *IntCmd { - cmd := NewIntCmd("lrem", key, count, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) LSet(key string, index int64, value interface{}) *StatusCmd { - cmd := NewStatusCmd("lset", key, index, value) - c.process(cmd) - return cmd -} - -func (c *cmdable) LTrim(key string, start, stop int64) *StatusCmd { - cmd := NewStatusCmd( - "ltrim", - key, - start, - stop, - ) - c.process(cmd) - return cmd -} - -func (c *cmdable) RPop(key string) *StringCmd { - cmd := NewStringCmd("rpop", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) RPopLPush(source, destination string) *StringCmd { - cmd := NewStringCmd("rpoplpush", source, destination) - c.process(cmd) - return cmd -} - -func (c *cmdable) RPush(key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "rpush" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) RPushX(key string, value interface{}) *IntCmd { - cmd := NewIntCmd("rpushx", key, value) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) SAdd(key string, members ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "sadd" - args[1] = key - args = appendArgs(args, members) - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SCard(key string) *IntCmd { - cmd := NewIntCmd("scard", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) SDiff(keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "sdiff" - for i, key := range keys { - args[1+i] = key - } - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SDiffStore(destination string, keys ...string) *IntCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "sdiffstore" - args[1] = destination - for i, key := range keys { - args[2+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SInter(keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "sinter" - for i, key := range keys { - args[1+i] = key - } - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SInterStore(destination string, keys ...string) *IntCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "sinterstore" - args[1] = destination - for i, key := range keys { - args[2+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SIsMember(key string, member interface{}) *BoolCmd { - cmd := NewBoolCmd("sismember", key, member) - c.process(cmd) - return cmd -} - -// Redis `SMEMBERS key` command output as a slice -func (c *cmdable) SMembers(key string) *StringSliceCmd { - cmd := NewStringSliceCmd("smembers", key) - c.process(cmd) - return cmd -} - -// Redis `SMEMBERS key` command output as a map -func (c *cmdable) SMembersMap(key string) *StringStructMapCmd { - cmd := NewStringStructMapCmd("smembers", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) SMove(source, destination string, member interface{}) *BoolCmd { - cmd := NewBoolCmd("smove", source, destination, member) - c.process(cmd) - return cmd -} - -// Redis `SPOP key` command. -func (c *cmdable) SPop(key string) *StringCmd { - cmd := NewStringCmd("spop", key) - c.process(cmd) - return cmd -} - -// Redis `SPOP key count` command. -func (c *cmdable) SPopN(key string, count int64) *StringSliceCmd { - cmd := NewStringSliceCmd("spop", key, count) - c.process(cmd) - return cmd -} - -// Redis `SRANDMEMBER key` command. -func (c *cmdable) SRandMember(key string) *StringCmd { - cmd := NewStringCmd("srandmember", key) - c.process(cmd) - return cmd -} - -// Redis `SRANDMEMBER key count` command. -func (c *cmdable) SRandMemberN(key string, count int64) *StringSliceCmd { - cmd := NewStringSliceCmd("srandmember", key, count) - c.process(cmd) - return cmd -} - -func (c *cmdable) SRem(key string, members ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "srem" - args[1] = key - args = appendArgs(args, members) - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SUnion(keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "sunion" - for i, key := range keys { - args[1+i] = key - } - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) SUnionStore(destination string, keys ...string) *IntCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "sunionstore" - args[1] = destination - for i, key := range keys { - args[2+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -type XAddArgs struct { - Stream string - MaxLen int64 // MAXLEN N - MaxLenApprox int64 // MAXLEN ~ N - ID string - Values map[string]interface{} -} - -func (c *cmdable) XAdd(a *XAddArgs) *StringCmd { - args := make([]interface{}, 0, 6+len(a.Values)*2) - args = append(args, "xadd") - args = append(args, a.Stream) - if a.MaxLen > 0 { - args = append(args, "maxlen", a.MaxLen) - } else if a.MaxLenApprox > 0 { - args = append(args, "maxlen", "~", a.MaxLenApprox) - } - if a.ID != "" { - args = append(args, a.ID) - } else { - args = append(args, "*") - } - for k, v := range a.Values { - args = append(args, k) - args = append(args, v) - } - - cmd := NewStringCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) XDel(stream string, ids ...string) *IntCmd { - args := []interface{}{"xdel", stream} - for _, id := range ids { - args = append(args, id) - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) XLen(stream string) *IntCmd { - cmd := NewIntCmd("xlen", stream) - c.process(cmd) - return cmd -} - -func (c *cmdable) XRange(stream, start, stop string) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd("xrange", stream, start, stop) - c.process(cmd) - return cmd -} - -func (c *cmdable) XRangeN(stream, start, stop string, count int64) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd("xrange", stream, start, stop, "count", count) - c.process(cmd) - return cmd -} - -func (c *cmdable) XRevRange(stream, start, stop string) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd("xrevrange", stream, start, stop) - c.process(cmd) - return cmd -} - -func (c *cmdable) XRevRangeN(stream, start, stop string, count int64) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd("xrevrange", stream, start, stop, "count", count) - c.process(cmd) - return cmd -} - -type XReadArgs struct { - Streams []string - Count int64 - Block time.Duration -} - -func (c *cmdable) XRead(a *XReadArgs) *XStreamSliceCmd { - args := make([]interface{}, 0, 5+len(a.Streams)) - args = append(args, "xread") - if a.Count > 0 { - args = append(args, "count") - args = append(args, a.Count) - } - if a.Block >= 0 { - args = append(args, "block") - args = append(args, int64(a.Block/time.Millisecond)) - } - args = append(args, "streams") - for _, s := range a.Streams { - args = append(args, s) - } - - cmd := NewXStreamSliceCmd(args...) - if a.Block >= 0 { - cmd.setReadTimeout(a.Block) - } - c.process(cmd) - return cmd -} - -func (c *cmdable) XReadStreams(streams ...string) *XStreamSliceCmd { - return c.XRead(&XReadArgs{ - Streams: streams, - Block: -1, - }) -} - -func (c *cmdable) XGroupCreate(stream, group, start string) *StatusCmd { - cmd := NewStatusCmd("xgroup", "create", stream, group, start) - c.process(cmd) - return cmd -} - -func (c *cmdable) XGroupCreateMkStream(stream, group, start string) *StatusCmd { - cmd := NewStatusCmd("xgroup", "create", stream, group, start, "mkstream") - c.process(cmd) - return cmd -} - -func (c *cmdable) XGroupSetID(stream, group, start string) *StatusCmd { - cmd := NewStatusCmd("xgroup", "setid", stream, group, start) - c.process(cmd) - return cmd -} - -func (c *cmdable) XGroupDestroy(stream, group string) *IntCmd { - cmd := NewIntCmd("xgroup", "destroy", stream, group) - c.process(cmd) - return cmd -} - -func (c *cmdable) XGroupDelConsumer(stream, group, consumer string) *IntCmd { - cmd := NewIntCmd("xgroup", "delconsumer", stream, group, consumer) - c.process(cmd) - return cmd -} - -type XReadGroupArgs struct { - Group string - Consumer string - // List of streams and ids. - Streams []string - Count int64 - Block time.Duration - NoAck bool -} - -func (c *cmdable) XReadGroup(a *XReadGroupArgs) *XStreamSliceCmd { - args := make([]interface{}, 0, 8+len(a.Streams)) - args = append(args, "xreadgroup", "group", a.Group, a.Consumer) - if a.Count > 0 { - args = append(args, "count", a.Count) - } - if a.Block >= 0 { - args = append(args, "block", int64(a.Block/time.Millisecond)) - } - if a.NoAck { - args = append(args, "noack") - } - args = append(args, "streams") - for _, s := range a.Streams { - args = append(args, s) - } - - cmd := NewXStreamSliceCmd(args...) - if a.Block >= 0 { - cmd.setReadTimeout(a.Block) - } - c.process(cmd) - return cmd -} - -func (c *cmdable) XAck(stream, group string, ids ...string) *IntCmd { - args := []interface{}{"xack", stream, group} - for _, id := range ids { - args = append(args, id) - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) XPending(stream, group string) *XPendingCmd { - cmd := NewXPendingCmd("xpending", stream, group) - c.process(cmd) - return cmd -} - -type XPendingExtArgs struct { - Stream string - Group string - Start string - End string - Count int64 - Consumer string -} - -func (c *cmdable) XPendingExt(a *XPendingExtArgs) *XPendingExtCmd { - args := make([]interface{}, 0, 7) - args = append(args, "xpending", a.Stream, a.Group, a.Start, a.End, a.Count) - if a.Consumer != "" { - args = append(args, a.Consumer) - } - cmd := NewXPendingExtCmd(args...) - c.process(cmd) - return cmd -} - -type XClaimArgs struct { - Stream string - Group string - Consumer string - MinIdle time.Duration - Messages []string -} - -func (c *cmdable) XClaim(a *XClaimArgs) *XMessageSliceCmd { - args := xClaimArgs(a) - cmd := NewXMessageSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) XClaimJustID(a *XClaimArgs) *StringSliceCmd { - args := xClaimArgs(a) - args = append(args, "justid") - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func xClaimArgs(a *XClaimArgs) []interface{} { - args := make([]interface{}, 0, 4+len(a.Messages)) - args = append(args, - "xclaim", - a.Stream, - a.Group, a.Consumer, - int64(a.MinIdle/time.Millisecond)) - for _, id := range a.Messages { - args = append(args, id) - } - return args -} - -func (c *cmdable) XTrim(key string, maxLen int64) *IntCmd { - cmd := NewIntCmd("xtrim", key, "maxlen", maxLen) - c.process(cmd) - return cmd -} - -func (c *cmdable) XTrimApprox(key string, maxLen int64) *IntCmd { - cmd := NewIntCmd("xtrim", key, "maxlen", "~", maxLen) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -// Z represents sorted set member. -type Z struct { - Score float64 - Member interface{} -} - -// ZWithKey represents sorted set member including the name of the key where it was popped. -type ZWithKey struct { - Z - Key string -} - -// ZStore is used as an arg to ZInterStore and ZUnionStore. -type ZStore struct { - Weights []float64 - // Can be SUM, MIN or MAX. - Aggregate string -} - -// Redis `BZPOPMAX key [key ...] timeout` command. -func (c *cmdable) BZPopMax(timeout time.Duration, keys ...string) *ZWithKeyCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "bzpopmax" - for i, key := range keys { - args[1+i] = key - } - args[len(args)-1] = formatSec(timeout) - cmd := NewZWithKeyCmd(args...) - cmd.setReadTimeout(timeout) - c.process(cmd) - return cmd -} - -// Redis `BZPOPMIN key [key ...] timeout` command. -func (c *cmdable) BZPopMin(timeout time.Duration, keys ...string) *ZWithKeyCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "bzpopmin" - for i, key := range keys { - args[1+i] = key - } - args[len(args)-1] = formatSec(timeout) - cmd := NewZWithKeyCmd(args...) - cmd.setReadTimeout(timeout) - c.process(cmd) - return cmd -} - -func (c *cmdable) zAdd(a []interface{}, n int, members ...Z) *IntCmd { - for i, m := range members { - a[n+2*i] = m.Score - a[n+2*i+1] = m.Member - } - cmd := NewIntCmd(a...) - c.process(cmd) - return cmd -} - -// Redis `ZADD key score member [score member ...]` command. -func (c *cmdable) ZAdd(key string, members ...Z) *IntCmd { - const n = 2 - a := make([]interface{}, n+2*len(members)) - a[0], a[1] = "zadd", key - return c.zAdd(a, n, members...) -} - -// Redis `ZADD key NX score member [score member ...]` command. -func (c *cmdable) ZAddNX(key string, members ...Z) *IntCmd { - const n = 3 - a := make([]interface{}, n+2*len(members)) - a[0], a[1], a[2] = "zadd", key, "nx" - return c.zAdd(a, n, members...) -} - -// Redis `ZADD key XX score member [score member ...]` command. -func (c *cmdable) ZAddXX(key string, members ...Z) *IntCmd { - const n = 3 - a := make([]interface{}, n+2*len(members)) - a[0], a[1], a[2] = "zadd", key, "xx" - return c.zAdd(a, n, members...) -} - -// Redis `ZADD key CH score member [score member ...]` command. -func (c *cmdable) ZAddCh(key string, members ...Z) *IntCmd { - const n = 3 - a := make([]interface{}, n+2*len(members)) - a[0], a[1], a[2] = "zadd", key, "ch" - return c.zAdd(a, n, members...) -} - -// Redis `ZADD key NX CH score member [score member ...]` command. -func (c *cmdable) ZAddNXCh(key string, members ...Z) *IntCmd { - const n = 4 - a := make([]interface{}, n+2*len(members)) - a[0], a[1], a[2], a[3] = "zadd", key, "nx", "ch" - return c.zAdd(a, n, members...) -} - -// Redis `ZADD key XX CH score member [score member ...]` command. -func (c *cmdable) ZAddXXCh(key string, members ...Z) *IntCmd { - const n = 4 - a := make([]interface{}, n+2*len(members)) - a[0], a[1], a[2], a[3] = "zadd", key, "xx", "ch" - return c.zAdd(a, n, members...) -} - -func (c *cmdable) zIncr(a []interface{}, n int, members ...Z) *FloatCmd { - for i, m := range members { - a[n+2*i] = m.Score - a[n+2*i+1] = m.Member - } - cmd := NewFloatCmd(a...) - c.process(cmd) - return cmd -} - -// Redis `ZADD key INCR score member` command. -func (c *cmdable) ZIncr(key string, member Z) *FloatCmd { - const n = 3 - a := make([]interface{}, n+2) - a[0], a[1], a[2] = "zadd", key, "incr" - return c.zIncr(a, n, member) -} - -// Redis `ZADD key NX INCR score member` command. -func (c *cmdable) ZIncrNX(key string, member Z) *FloatCmd { - const n = 4 - a := make([]interface{}, n+2) - a[0], a[1], a[2], a[3] = "zadd", key, "incr", "nx" - return c.zIncr(a, n, member) -} - -// Redis `ZADD key XX INCR score member` command. -func (c *cmdable) ZIncrXX(key string, member Z) *FloatCmd { - const n = 4 - a := make([]interface{}, n+2) - a[0], a[1], a[2], a[3] = "zadd", key, "incr", "xx" - return c.zIncr(a, n, member) -} - -func (c *cmdable) ZCard(key string) *IntCmd { - cmd := NewIntCmd("zcard", key) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZCount(key, min, max string) *IntCmd { - cmd := NewIntCmd("zcount", key, min, max) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZLexCount(key, min, max string) *IntCmd { - cmd := NewIntCmd("zlexcount", key, min, max) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZIncrBy(key string, increment float64, member string) *FloatCmd { - cmd := NewFloatCmd("zincrby", key, increment, member) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd { - args := make([]interface{}, 3+len(keys)) - args[0] = "zinterstore" - args[1] = destination - args[2] = len(keys) - for i, key := range keys { - args[3+i] = key - } - if len(store.Weights) > 0 { - args = append(args, "weights") - for _, weight := range store.Weights { - args = append(args, weight) - } - } - if store.Aggregate != "" { - args = append(args, "aggregate", store.Aggregate) - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZPopMax(key string, count ...int64) *ZSliceCmd { - args := []interface{}{ - "zpopmax", - key, - } - - switch len(count) { - case 0: - break - case 1: - args = append(args, count[0]) - default: - panic("too many arguments") - } - - cmd := NewZSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZPopMin(key string, count ...int64) *ZSliceCmd { - args := []interface{}{ - "zpopmin", - key, - } - - switch len(count) { - case 0: - break - case 1: - args = append(args, count[0]) - default: - panic("too many arguments") - } - - cmd := NewZSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) zRange(key string, start, stop int64, withScores bool) *StringSliceCmd { - args := []interface{}{ - "zrange", - key, - start, - stop, - } - if withScores { - args = append(args, "withscores") - } - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRange(key string, start, stop int64) *StringSliceCmd { - return c.zRange(key, start, stop, false) -} - -func (c *cmdable) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd { - cmd := NewZSliceCmd("zrange", key, start, stop, "withscores") - c.process(cmd) - return cmd -} - -type ZRangeBy struct { - Min, Max string - Offset, Count int64 -} - -func (c *cmdable) zRangeBy(zcmd, key string, opt ZRangeBy, withScores bool) *StringSliceCmd { - args := []interface{}{zcmd, key, opt.Min, opt.Max} - if withScores { - args = append(args, "withscores") - } - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRangeByScore(key string, opt ZRangeBy) *StringSliceCmd { - return c.zRangeBy("zrangebyscore", key, opt, false) -} - -func (c *cmdable) ZRangeByLex(key string, opt ZRangeBy) *StringSliceCmd { - return c.zRangeBy("zrangebylex", key, opt, false) -} - -func (c *cmdable) ZRangeByScoreWithScores(key string, opt ZRangeBy) *ZSliceCmd { - args := []interface{}{"zrangebyscore", key, opt.Min, opt.Max, "withscores"} - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewZSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRank(key, member string) *IntCmd { - cmd := NewIntCmd("zrank", key, member) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRem(key string, members ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "zrem" - args[1] = key - args = appendArgs(args, members) - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRemRangeByRank(key string, start, stop int64) *IntCmd { - cmd := NewIntCmd( - "zremrangebyrank", - key, - start, - stop, - ) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRemRangeByScore(key, min, max string) *IntCmd { - cmd := NewIntCmd("zremrangebyscore", key, min, max) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRemRangeByLex(key, min, max string) *IntCmd { - cmd := NewIntCmd("zremrangebylex", key, min, max) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRevRange(key string, start, stop int64) *StringSliceCmd { - cmd := NewStringSliceCmd("zrevrange", key, start, stop) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd { - cmd := NewZSliceCmd("zrevrange", key, start, stop, "withscores") - c.process(cmd) - return cmd -} - -func (c *cmdable) zRevRangeBy(zcmd, key string, opt ZRangeBy) *StringSliceCmd { - args := []interface{}{zcmd, key, opt.Max, opt.Min} - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewStringSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRevRangeByScore(key string, opt ZRangeBy) *StringSliceCmd { - return c.zRevRangeBy("zrevrangebyscore", key, opt) -} - -func (c *cmdable) ZRevRangeByLex(key string, opt ZRangeBy) *StringSliceCmd { - return c.zRevRangeBy("zrevrangebylex", key, opt) -} - -func (c *cmdable) ZRevRangeByScoreWithScores(key string, opt ZRangeBy) *ZSliceCmd { - args := []interface{}{"zrevrangebyscore", key, opt.Max, opt.Min, "withscores"} - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewZSliceCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZRevRank(key, member string) *IntCmd { - cmd := NewIntCmd("zrevrank", key, member) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZScore(key, member string) *FloatCmd { - cmd := NewFloatCmd("zscore", key, member) - c.process(cmd) - return cmd -} - -func (c *cmdable) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd { - args := make([]interface{}, 3+len(keys)) - args[0] = "zunionstore" - args[1] = dest - args[2] = len(keys) - for i, key := range keys { - args[3+i] = key - } - if len(store.Weights) > 0 { - args = append(args, "weights") - for _, weight := range store.Weights { - args = append(args, weight) - } - } - if store.Aggregate != "" { - args = append(args, "aggregate", store.Aggregate) - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) PFAdd(key string, els ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(els)) - args[0] = "pfadd" - args[1] = key - args = appendArgs(args, els) - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) PFCount(keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "pfcount" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(args...) - c.process(cmd) - return cmd -} - -func (c *cmdable) PFMerge(dest string, keys ...string) *StatusCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "pfmerge" - args[1] = dest - for i, key := range keys { - args[2+i] = key - } - cmd := NewStatusCmd(args...) - c.process(cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c *cmdable) BgRewriteAOF() *StatusCmd { - cmd := NewStatusCmd("bgrewriteaof") - c.process(cmd) - return cmd -} - -func (c *cmdable) BgSave() *StatusCmd { - cmd := NewStatusCmd("bgsave") - c.process(cmd) - return cmd -} - -func (c *cmdable) ClientKill(ipPort string) *StatusCmd { - cmd := NewStatusCmd("client", "kill", ipPort) - c.process(cmd) - return cmd -} - -// ClientKillByFilter is new style synx, while the ClientKill is old -// CLIENT KILL