Compare commits
101
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
818ee18544 | ||
|
|
abf6a37c7a | ||
|
|
c2af71449a | ||
|
|
05eb762273 | ||
|
|
e2419e2c4b | ||
|
|
72afc94782 | ||
|
|
02070b1db1 | ||
|
|
2fc6c7ba91 | ||
|
|
c706d7932d | ||
|
|
62714cdfe1 | ||
|
|
a2c49ac39f | ||
|
|
de55ea643c | ||
|
|
5fb60e14b8 | ||
|
|
02603cb018 | ||
|
|
ffbff595d1 | ||
|
|
989429824e | ||
|
|
a31e6080e2 | ||
|
|
90e05dfb4b | ||
|
|
2af27ddb68 | ||
|
|
d004faa9e0 | ||
|
|
45a4a23112 | ||
|
|
1bb50f8175 | ||
|
|
0cbfcab3f9 | ||
|
|
d4125963b2 | ||
|
|
2e33c2275c | ||
|
|
a5b21198e0 | ||
|
|
e765cda3f9 | ||
|
|
5a91184d6c | ||
|
|
e2094296f4 | ||
|
|
777e856d00 | ||
|
|
c3f419bbc5 | ||
|
|
52705f6982 | ||
|
|
a5134181be | ||
|
|
79c801d493 | ||
|
|
f9823d5303 | ||
|
|
8339591b27 | ||
|
|
17a6e3186d | ||
|
|
213bad9722 | ||
|
|
ef33bd9fd2 | ||
|
|
123de3d452 | ||
|
|
6591bff728 | ||
|
|
88c0779aa2 | ||
|
|
95adcb117c | ||
|
|
372636f43b | ||
|
|
54dae1ab2b | ||
|
|
f0f50a8507 | ||
|
|
c3d0d5be4c | ||
|
|
929132743c | ||
|
|
6643e8937c | ||
|
|
08b4ee461e | ||
|
|
ae501969bf | ||
|
|
c29ed6d41e | ||
|
|
1c28c895b5 | ||
|
|
d9c32437c9 | ||
|
|
0429bed9e3 | ||
|
|
8bdc36a302 | ||
|
|
a3576cc3f4 | ||
|
|
713db0aa4c | ||
|
|
95aae06a41 | ||
|
|
31a4a6f5b8 | ||
|
|
1c66729974 | ||
|
|
6387947b22 | ||
|
|
3a8469c5a9 | ||
|
|
44715591ef | ||
|
|
ceb9d71a1a | ||
|
|
15ad05277b | ||
|
|
14c5b0a678 | ||
|
|
c95964fa3c | ||
|
|
a46f2cee34 | ||
|
|
1764ce9a30 | ||
|
|
384fa0417a | ||
|
|
97ba1050a7 | ||
|
|
628c506e85 | ||
|
|
9226796463 | ||
|
|
83176ba878 | ||
|
|
94cb067214 | ||
|
|
b56b6e0e42 | ||
|
|
28aa3eae33 | ||
|
|
96dee8dee3 | ||
|
|
400410c449 | ||
|
|
ab08abb3f6 | ||
|
|
01e32537a8 | ||
|
|
652d1c8c4f | ||
|
|
64e7792778 | ||
|
|
bfb03c6d1e | ||
|
|
1fa20f9cda | ||
|
|
9d61ec49c3 | ||
|
|
9dc598feff | ||
|
|
49fde946ac | ||
|
|
c4ded39e7c | ||
|
|
c8518e9f35 | ||
|
|
97d3a38ed8 | ||
|
|
e840b53978 | ||
|
|
c43e52e9ad | ||
|
|
2a2bd99fcf | ||
|
|
c4f9fc4585 | ||
|
|
0222dfd865 | ||
|
|
11f91b67a8 | ||
|
|
6e2d485b90 | ||
|
|
e336a57e13 | ||
|
|
29e7c119bd |
No files matched your search
@@ -0,0 +1,23 @@
|
||||
docker-build:
|
||||
image: docker:latest
|
||||
stage: build
|
||||
services:
|
||||
- docker:dind
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||
- export VERSION=`cat .version `
|
||||
- echo $VERSION
|
||||
- echo $CI_DOCKER_FILE
|
||||
- echo $CI_REGISTRY
|
||||
script:
|
||||
- set
|
||||
- mkdir -p migrations
|
||||
- docker build -f "$CI_DOCKER_FILE" --force-rm --build-arg="version=$VERSION" --build-arg="app_name=$CI_PROJECT_NAME" --pull -t "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION" .
|
||||
- |
|
||||
docker tag "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION" "$CI_REGISTRY/$CI_PROJECT_NAME:latest"
|
||||
docker push "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION"
|
||||
docker push "$CI_REGISTRY/$CI_PROJECT_NAME:latest"
|
||||
docker rmi -f "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION"
|
||||
docker rmi -f "$CI_REGISTRY/$CI_PROJECT_NAME:latest"
|
||||
- docker logout $CI_REGISTRY
|
||||
|
||||
@@ -1,3 +1,76 @@
|
||||
* исправлен метод /config/get_config_by_id
|
||||
### v2.4.9
|
||||
* обновлены зависимости (исправляет panic при запуске)
|
||||
### v2.4.8
|
||||
* do not check for instance_uuid anymore
|
||||
### v2.4.7
|
||||
* updated dependencies
|
||||
### v2.4.6
|
||||
* increase default version config count to 15
|
||||
* fix leader address race on leader disconnect (it was possible that after the change of the leader, one of the nodes will not be declared available, although this is not so)
|
||||
* enable metric server
|
||||
* add integration test for multiple config updates
|
||||
* fix service hanging on shutdown
|
||||
* improve raft logging
|
||||
* fix deadlock in cluster client
|
||||
* add timeouts to all websocket emits to prevent connections leakage
|
||||
### v2.4.5
|
||||
* updated isp-lib
|
||||
### v2.4.4
|
||||
* fix marshaling body of `ERROR_CONNECTION` event
|
||||
### v2.4.3
|
||||
* updated isp-lib
|
||||
* updated isp-event-lib
|
||||
### v2.4.2
|
||||
* add db pass part
|
||||
### v2.4.1
|
||||
* updated method `/config/get_configs_by_module_id`
|
||||
### v2.4.0
|
||||
* add method `/config/get_config_by_id`
|
||||
* add method `/config/get_configs_by_module_id`
|
||||
* updated docs
|
||||
### v2.3.1
|
||||
* fix old configs order
|
||||
* add `createdAt` field to config version
|
||||
### v2.3.0
|
||||
* add method `/module/broadcast_event` to broadcast arbitrary event to modules
|
||||
* add module dependencies to response `/module/get_modules_info`
|
||||
* add option to create a new config version instead update it
|
||||
* fix broadcasting config on activating and upserting configs
|
||||
* add saving old configs
|
||||
* add method `/config/delete_version`
|
||||
* add method `/config/get_all_version`
|
||||
* update libs
|
||||
|
||||
### v2.2.1
|
||||
* update deps
|
||||
* fix bug in json schema marshaling/unmarshaling
|
||||
|
||||
### v2.2.0
|
||||
* migrate to go modules
|
||||
* add linter, refactor
|
||||
|
||||
### v2.1.3
|
||||
* improved logging
|
||||
|
||||
### v2.1.2
|
||||
* leader ws client ConnectionReadLimit is now configured by WS.WsConnectionReadLimitKB config param and defaults to 4 MB
|
||||
|
||||
### v2.1.1
|
||||
* update to new endpoint descriptor struct with extra fields introduced in isp-lib v2.1.0
|
||||
|
||||
### v2.1.0
|
||||
* fix panic type casting in snapshot
|
||||
* create empty default config now
|
||||
* add method `/module/get_by_name` to fetch module object by name
|
||||
|
||||
### v2.0.3
|
||||
* fix data race when applyCommandOnLeader in websocket handler
|
||||
* update dependencies
|
||||
|
||||
### v2.0.2
|
||||
* fix raft server address announcing (serverId == serverAddress == cluster.outerAddress)
|
||||
|
||||
### v2.0.1
|
||||
* fix nil pointer dereference in repositories
|
||||
* increase default websocket ConnectionReadLimit to 4 MB, add to configuration
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
FROM dockerhub.mos.ru/mosos/arbat:15.5 as builder
|
||||
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y go1.23 git
|
||||
WORKDIR /build
|
||||
ARG version
|
||||
ENV version_env=$version
|
||||
ARG app_name
|
||||
ENV app_name_env=$app_name
|
||||
COPY . .
|
||||
ENV GOPROXY=https://repo-mirror.mos.ru/repository/go-public
|
||||
RUN go build -ldflags="-X 'main.version=$version_env'" -o /main .
|
||||
|
||||
FROM dockerhub.mos.ru/mosos/arbat:15.5
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
|
||||
RUN echo "Europe/Moscow" > /etc/timezone
|
||||
|
||||
ARG UID=10001
|
||||
RUN useradd \
|
||||
--home "/nonexistent" \
|
||||
--shell "/sbin/nologin" \
|
||||
--no-create-home \
|
||||
--uid "${UID}" \
|
||||
--user-group \
|
||||
appuser
|
||||
|
||||
RUN mkdir -p /app/data
|
||||
RUN chown appuser:appuser /app/data
|
||||
VOLUME /app/data
|
||||
|
||||
USER appuser
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG app_name
|
||||
ENV app_name_env=$app_name
|
||||
COPY --from=builder main /app/$app_name_env
|
||||
COPY /conf/config.yml /app/config.yml
|
||||
COPY /conf/default_remote_config.json* /app/default_remote_config.json
|
||||
COPY /migrations /app/migrations
|
||||
|
||||
ENTRYPOINT /app/$app_name_env
|
||||
Generated
-783
@@ -1,783 +0,0 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
digest = "1:d5e752c67b445baa5b6cb6f8aa706775c2aa8e41aca95a0c651520ff2c80361a"
|
||||
name = "github.com/Microsoft/go-winio"
|
||||
packages = [
|
||||
".",
|
||||
"pkg/guid",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "6c72808b55902eae4c5943626030429ff20f3b63"
|
||||
version = "v0.4.14"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:7a9140c806333a78122763d08ec6c0d7358c7fff1df8cfbb01881c5dc46e24e5"
|
||||
name = "github.com/armon/go-metrics"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "ec5e00d3c878b2a97bbe0884ef45ffd1b4f669f5"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709"
|
||||
name = "github.com/asaskevich/govalidator"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f"
|
||||
version = "v9"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0f98f59e9a2f4070d66f0c9c39561f68fcd1dc837b22a852d28d0003aebd1b1e"
|
||||
name = "github.com/boltdb/bolt"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8"
|
||||
version = "v1.3.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:652880afc6b57ce0a67173f552cb35ccda816493a1da6ca20e5074a66bcd083f"
|
||||
name = "github.com/buaazp/fasthttprouter"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "ade4e2031af3aed7fffd241084aad80a58faf421"
|
||||
version = "v0.1.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c1100fc71e23b6a32b2c68a5202a848fd13811d5a10b12edb8019c3667d1cd9a"
|
||||
name = "github.com/cenkalti/backoff"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "4b4cebaf850ec58f1bb1fec5bdebdf8501c2bc3f"
|
||||
version = "v3.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
|
||||
name = "github.com/davecgh/go-spew"
|
||||
packages = ["spew"]
|
||||
pruneopts = "UT"
|
||||
revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
|
||||
version = "v1.1.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:4ddc17aeaa82cb18c5f0a25d7c253a10682f518f4b2558a82869506eec223d76"
|
||||
name = "github.com/docker/distribution"
|
||||
packages = [
|
||||
"digestset",
|
||||
"reference",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "2461543d988979529609e8cb6fca9ca190dc48da"
|
||||
version = "v2.7.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c4c7064c2c67a0a00815918bae489dd62cd88d859d24c95115d69b00b3d33334"
|
||||
name = "github.com/docker/docker"
|
||||
packages = [
|
||||
"api/types",
|
||||
"api/types/blkiodev",
|
||||
"api/types/container",
|
||||
"api/types/events",
|
||||
"api/types/filters",
|
||||
"api/types/mount",
|
||||
"api/types/network",
|
||||
"api/types/reference",
|
||||
"api/types/registry",
|
||||
"api/types/strslice",
|
||||
"api/types/swarm",
|
||||
"api/types/time",
|
||||
"api/types/versions",
|
||||
"api/types/volume",
|
||||
"client",
|
||||
"pkg/tlsconfig",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "092cba3727bb9b4a2f0e922cd6c0f93ea270e363"
|
||||
version = "v1.13.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:811c86996b1ca46729bad2724d4499014c4b9effd05ef8c71b852aad90deb0ce"
|
||||
name = "github.com/docker/go-connections"
|
||||
packages = [
|
||||
"nat",
|
||||
"sockets",
|
||||
"tlsconfig",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "7395e3f8aa162843a74ed6d48e79627d9792ac55"
|
||||
version = "v0.4.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:e95ef557dc3120984bb66b385ae01b4bb8ff56bcde28e7b0d1beed0cccc4d69f"
|
||||
name = "github.com/docker/go-units"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "519db1ee28dcc9fd2474ae59fca29a810482bfb1"
|
||||
version = "v0.4.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd"
|
||||
name = "github.com/fsnotify/fsnotify"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9"
|
||||
version = "v1.4.7"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:f9448bfab8ebe44e3d91e4e4475cf92d60789a614652f361df4e41972c9d5caf"
|
||||
name = "github.com/go-pg/pg"
|
||||
packages = [
|
||||
".",
|
||||
"internal",
|
||||
"internal/iszero",
|
||||
"internal/parser",
|
||||
"internal/pool",
|
||||
"internal/struct_filter",
|
||||
"internal/tag",
|
||||
"orm",
|
||||
"types",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "1d957cb20f319c4a1e2db7d345824c12aefe5943"
|
||||
version = "v8.0.6"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:07f4fafe81587b642166199f41c3edcca12929fcfcc0261b00be5dea2f968f44"
|
||||
name = "github.com/golang/protobuf"
|
||||
packages = [
|
||||
"proto",
|
||||
"ptypes",
|
||||
"ptypes/any",
|
||||
"ptypes/duration",
|
||||
"ptypes/struct",
|
||||
"ptypes/timestamp",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7"
|
||||
version = "v1.3.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0ade334594e69404d80d9d323445d2297ff8161637f9b2d347cc6973d2d6f05b"
|
||||
name = "github.com/hashicorp/errwrap"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "8a6fb523712970c966eefc6b39ed2c5e74880354"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:cf6b61e1b4c26b0c7526cee4a0cee6d8302b17798af4b2a56a90eedac0aef11a"
|
||||
name = "github.com/hashicorp/go-hclog"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5ccdce08c75b6c7b37af61159f13f6a4f5e2e928"
|
||||
version = "v0.9.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:6e9806a06d00f4d1f90806d7b5cfb11e35dca76503390ca6e704b05ea7051bff"
|
||||
name = "github.com/hashicorp/go-immutable-radix"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "7dd1121b595e4e1bd6dd5caa78e0f5c454740379"
|
||||
version = "v1.1.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:5d8539af558ca2ea960a4c11afb12c75ae9e9dca3560f1103318aaa2030e37e2"
|
||||
name = "github.com/hashicorp/go-msgpack"
|
||||
packages = ["codec"]
|
||||
pruneopts = "UT"
|
||||
revision = "ad60660ecf9c5a1eae0ca32182ed72bab5807961"
|
||||
version = "v0.5.5"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:f668349b83f7d779567c880550534addeca7ebadfdcf44b0b9c39be61864b4b7"
|
||||
name = "github.com/hashicorp/go-multierror"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "886a7fbe3eb1c874d46f623bfa70af45f425b3d1"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:7fae9ec96d10b2afce0da23c378c8b3389319b7f92fa092f2621bba3078cfb4b"
|
||||
name = "github.com/hashicorp/golang-lru"
|
||||
packages = ["simplelru"]
|
||||
pruneopts = "UT"
|
||||
revision = "7f827b33c0f158ec5dfbba01bb0b14a4541fd81d"
|
||||
version = "v0.5.3"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c0d19ab64b32ce9fe5cf4ddceba78d5bc9807f0016db6b1183599da3dcc24d10"
|
||||
name = "github.com/hashicorp/hcl"
|
||||
packages = [
|
||||
".",
|
||||
"hcl/ast",
|
||||
"hcl/parser",
|
||||
"hcl/printer",
|
||||
"hcl/scanner",
|
||||
"hcl/strconv",
|
||||
"hcl/token",
|
||||
"json/parser",
|
||||
"json/scanner",
|
||||
"json/token",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "8cb6e5b959231cc1119e43259c4a608f9c51a241"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:f932a7af1d85151d9a33c8a8917390ddf155e531f4d48e3257604507445dc4e1"
|
||||
name = "github.com/hashicorp/raft"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "a989b09b3c0112332ac6110625f0f06538ca0083"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:8bc6831553a265c699a973640ea48eee53d3878af9013208d20a0c8807fa66ec"
|
||||
name = "github.com/hashicorp/raft-boltdb"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "4207f1bf061751378aee6cdfe697965a13ab49d7"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:2cf4ff28b309c93a52b3329c7a22d5375b137249d4ed63c9d40707a1b253f7df"
|
||||
name = "github.com/integration-system/bellows"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "244325e8836c364c86f308e3aef7e979cb007114"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:c4f3970d1f30f5e9bc1751b62b7ea6127256e59fd63a3d36e166fe1121250c57"
|
||||
name = "github.com/integration-system/go-cmp"
|
||||
packages = [
|
||||
"cmp",
|
||||
"cmp/internal/diff",
|
||||
"cmp/internal/function",
|
||||
"cmp/internal/value",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "ac5582987a2f25e8743e0ebb7259312adda05c23"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:4a70938660ae196961d0285062fa7ae5b8abcf1c800f4c750803c06c2150a716"
|
||||
name = "github.com/integration-system/isp-etp-go"
|
||||
packages = [
|
||||
".",
|
||||
"ack",
|
||||
"bpool",
|
||||
"client",
|
||||
"gen",
|
||||
"parser",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "6e92a3dda2cf7c6ec82fc1a1ae922248754e49d9"
|
||||
version = "v2.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:d30832edf4ae7a45e863e216c89bb5f1d66c10ff5b3255b9e007598a048594d7"
|
||||
name = "github.com/integration-system/isp-lib"
|
||||
packages = [
|
||||
"atomic",
|
||||
"backend",
|
||||
"bootstrap",
|
||||
"config",
|
||||
"config/schema",
|
||||
"database",
|
||||
"metric",
|
||||
"proto/stubs",
|
||||
"streaming",
|
||||
"structure",
|
||||
"utils",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "abfa9a9776d64e6d04d495bfe00db8ca4dcbe7fc"
|
||||
version = "v2.0.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:1562269205ab0c6685c8b0b99511e91b9d3627e4cac3f0288378bc8930e658f1"
|
||||
name = "github.com/integration-system/isp-lib-test"
|
||||
packages = [
|
||||
"ctx",
|
||||
"docker",
|
||||
"utils",
|
||||
"utils/postgres",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "6da4f1fed4b0df648a9b1c4bd4098fdd405695e1"
|
||||
version = "v1.4.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:1789fb6e57949a6e4cacb74023cd30efb04b09dc6111d6ef3718241ebb23ebe9"
|
||||
name = "github.com/integration-system/isp-log"
|
||||
packages = [
|
||||
".",
|
||||
"stdcodes",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "a22bf2e0b56a9ef47db4a98756e39f700a99b688"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:48f3a739fabefebf152d0196277ee89136c1fa6d88fc67fa486fc765a05b1caa"
|
||||
name = "github.com/integration-system/jsonschema"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5475a8b08e62e41fa886641861ac225e7f91e4e5"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:01ed62f8f4f574d8aff1d88caee113700a2b44c42351943fa73cc1808f736a50"
|
||||
name = "github.com/jinzhu/inflection"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "f5c5f50e6090ae76a29240b61ae2a90dd810112e"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:d78015a9da26d37166a2119592019e8bfe9b24bec60aff4a46db6110070fb1b2"
|
||||
name = "github.com/json-iterator/go"
|
||||
packages = [
|
||||
".",
|
||||
"extra",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "03217c3e97663914aec3faafde50d081f197a0a2"
|
||||
version = "1.1.8"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:acfc228fb5fbfb82645c121e3224bd546ed68aef6dfc87f63e2d8de099a3822b"
|
||||
name = "github.com/klauspost/compress"
|
||||
packages = [
|
||||
"flate",
|
||||
"gzip",
|
||||
"zlib",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "a41f1a10bd3b167958ff6df80b800fe2969dd3ca"
|
||||
version = "v1.9.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de"
|
||||
name = "github.com/konsorten/go-windows-terminal-sequences"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e"
|
||||
version = "v1.0.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:12cb143f2148bf54bcd9fe622abac17325e85eeb1d84b8ec6caf1c80232108fd"
|
||||
name = "github.com/lib/pq"
|
||||
packages = [
|
||||
".",
|
||||
"oid",
|
||||
"scram",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "3427c32cb71afc948325f299f040e53c1dd78979"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:5a0ef768465592efca0412f7e838cdc0826712f8447e70e6ccc52eb441e9ab13"
|
||||
name = "github.com/magiconair/properties"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "de8848e004dd33dc07a2947b3d76f618a7fc7ef1"
|
||||
version = "v1.8.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318"
|
||||
name = "github.com/mitchellh/mapstructure"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe"
|
||||
version = "v1.1.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563"
|
||||
name = "github.com/modern-go/concurrent"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"
|
||||
version = "1.0.3"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855"
|
||||
name = "github.com/modern-go/reflect2"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
|
||||
version = "1.0.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:84bd7f8a2e0bcd53ddc33c3b47c34c1fe340c8632cbe928f7f8ae10ec6ecdd62"
|
||||
name = "github.com/mohae/deepcopy"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "c48cc78d482608239f6c4c92a4abd87eb8761c90"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:ee4d4af67d93cc7644157882329023ce9a7bcfce956a079069a9405521c7cc8d"
|
||||
name = "github.com/opencontainers/go-digest"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "279bed98673dd5bef374d3b6e4b09e2af76183bf"
|
||||
version = "v1.0.0-rc1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:bbd3997f0121200f72b64d7a3826eb8a0b910d6a4c19894c9fe2852b9e5eaf3b"
|
||||
name = "github.com/pelletier/go-toml"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "8fe62057ea2d46ce44254c98e84e810044dbe197"
|
||||
version = "v1.5.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
||||
name = "github.com/pkg/errors"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4"
|
||||
version = "v0.8.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
|
||||
name = "github.com/pmezard/go-difflib"
|
||||
packages = ["difflib"]
|
||||
pruneopts = "UT"
|
||||
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:7d99649602f68b73ade640ca6975ccc38735f329e159c6a507b63f00213678c0"
|
||||
name = "github.com/pressly/goose"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "e4b98955473e91a12fc7d8816c28d06376d1d92c"
|
||||
version = "v2.6.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:5bbebe8ac19ecb6c87790a89faa20566e38ed0d6494a1d14c4f5b05d9ce2436c"
|
||||
name = "github.com/rcrowley/go-metrics"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "cac0b30c2563378d434b5af411844adff8e32960"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:274f67cb6fed9588ea2521ecdac05a6d62a8c51c074c1fccc6a49a40ba80e925"
|
||||
name = "github.com/satori/go.uuid"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976"
|
||||
name = "github.com/sirupsen/logrus"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "839c75faf7f98a33d445d181f3018b5c3409a45e"
|
||||
version = "v1.4.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:bb495ec276ab82d3dd08504bbc0594a65de8c3b22c6f2aaa92d05b73fbf3a82e"
|
||||
name = "github.com/spf13/afero"
|
||||
packages = [
|
||||
".",
|
||||
"mem",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "588a75ec4f32903aa5e39a2619ba6a4631e28424"
|
||||
version = "v1.2.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:08d65904057412fc0270fc4812a1c90c594186819243160dc779a402d4b6d0bc"
|
||||
name = "github.com/spf13/cast"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "8c9545af88b134710ab1cd196795e7f2388358d7"
|
||||
version = "v1.3.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:1b753ec16506f5864d26a28b43703c58831255059644351bbcb019b843950900"
|
||||
name = "github.com/spf13/jwalterweatherman"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "94f6ae3ed3bceceafa716478c5fbf8d29ca601a1"
|
||||
version = "v1.1.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:524b71991fc7d9246cc7dc2d9e0886ccb97648091c63e30eef619e6862c955dd"
|
||||
name = "github.com/spf13/pflag"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab"
|
||||
version = "v1.0.5"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0b60fc944fb6a7b6c985832bd341bdb7ed8fe894fea330414e7774bb24652962"
|
||||
name = "github.com/spf13/viper"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "72b022eb357a56469725dcd03918449e2278d02e"
|
||||
version = "v1.5.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:8548c309c65a85933a625be5e7d52b6ac927ca30c56869fae58123b8a77a75e1"
|
||||
name = "github.com/stretchr/testify"
|
||||
packages = ["assert"]
|
||||
pruneopts = "UT"
|
||||
revision = "221dbe5ed46703ee255b1da0dec05086f5035f62"
|
||||
version = "v1.4.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:f4b32291cad5efac2bfdba89ccde6aa04618b62ce06c1a571da2dc4f3f2677fb"
|
||||
name = "github.com/subosito/gotenv"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "2ef7124db659d49edac6aa459693a15ae36c671a"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:d32b64a7a82dd36b674fb73ff767e949eb7155b6b574ff276f49d4edc8af105f"
|
||||
name = "github.com/thecodeteam/goodbye"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "a83968bda2d37294a3541b7d2207fb6f5a3559a3"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c468422f334a6b46a19448ad59aaffdfc0a36b08fdcc1c749a0b29b6453d7e59"
|
||||
name = "github.com/valyala/bytebufferpool"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:77f7e2f75e4c44ede24f47aca6c514f24f06c6a0ee3c47c8d7ce2b77b49ac482"
|
||||
name = "github.com/valyala/fasthttp"
|
||||
packages = [
|
||||
".",
|
||||
"fasthttputil",
|
||||
"stackless",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "9bc6da12192c610a272a9289b9574eb5d8cfdfe1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:87fe9bca786484cef53d52adeec7d1c52bc2bfbee75734eddeb75fc5c7023871"
|
||||
name = "github.com/xeipuuv/gojsonpointer"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "02993c407bfbf5f6dae44c4f4b1cf6a39b5fc5bb"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:dc6a6c28ca45d38cfce9f7cb61681ee38c5b99ec1425339bfc1e1a7ba769c807"
|
||||
name = "github.com/xeipuuv/gojsonreference"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "bd5ef7bd5415a7ac448318e64f11a24cd21e594b"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:a8a0ed98532819a3b0dc5cf3264a14e30aba5284b793ba2850d6f381ada5f987"
|
||||
name = "github.com/xeipuuv/gojsonschema"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "82fcdeb203eb6ab2a67d0a623d9c19e5e5a64927"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:f92f6956e4059f6a3efc14924d2dd58ba90da25cc57fe07ae3779ef2f5e0c5f2"
|
||||
name = "golang.org/x/crypto"
|
||||
packages = ["pbkdf2"]
|
||||
pruneopts = "UT"
|
||||
revision = "87dc89f01550277dc22b74ffcf4cd89fa2f40f4c"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:60dc5bc60f5ec42121f8b90de6f86bd1f708b6422114a02012395d43e377e757"
|
||||
name = "golang.org/x/net"
|
||||
packages = [
|
||||
"context",
|
||||
"context/ctxhttp",
|
||||
"http/httpguts",
|
||||
"http2",
|
||||
"http2/hpack",
|
||||
"idna",
|
||||
"internal/socks",
|
||||
"internal/timeseries",
|
||||
"proxy",
|
||||
"trace",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "ec77196f6094c3492a8b61f2c11cf937f78992ae"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:de0084adc1c0b8cf6fd192d7785b098b155ba355cbeec9ee361aea55b887ab9d"
|
||||
name = "golang.org/x/sys"
|
||||
packages = [
|
||||
"unix",
|
||||
"windows",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "53bf42e6b339f7ed00535fc6915737b3959eac89"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405"
|
||||
name = "golang.org/x/text"
|
||||
packages = [
|
||||
"collate",
|
||||
"collate/build",
|
||||
"internal/colltab",
|
||||
"internal/gen",
|
||||
"internal/language",
|
||||
"internal/language/compact",
|
||||
"internal/tag",
|
||||
"internal/triegen",
|
||||
"internal/ucd",
|
||||
"language",
|
||||
"secure/bidirule",
|
||||
"transform",
|
||||
"unicode/bidi",
|
||||
"unicode/cldr",
|
||||
"unicode/norm",
|
||||
"unicode/rangetable",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475"
|
||||
version = "v0.3.2"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:a910255c3b706b4d8f2b185ed6b40c8f31b805111be240def2bdf2c62b87591b"
|
||||
name = "google.golang.org/genproto"
|
||||
packages = [
|
||||
"googleapis/rpc/errdetails",
|
||||
"googleapis/rpc/status",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "548a555dbc03994223efbaba0090152849259498"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:6cd77d0b616d2dcebd363dfecba593f27b0151fc82cdb5fbfb96c5a7cfbc95b5"
|
||||
name = "google.golang.org/grpc"
|
||||
packages = [
|
||||
".",
|
||||
"balancer",
|
||||
"balancer/base",
|
||||
"balancer/roundrobin",
|
||||
"binarylog/grpc_binarylog_v1",
|
||||
"codes",
|
||||
"connectivity",
|
||||
"credentials",
|
||||
"credentials/internal",
|
||||
"encoding",
|
||||
"encoding/proto",
|
||||
"grpclog",
|
||||
"internal",
|
||||
"internal/backoff",
|
||||
"internal/balancerload",
|
||||
"internal/binarylog",
|
||||
"internal/channelz",
|
||||
"internal/envconfig",
|
||||
"internal/grpcrand",
|
||||
"internal/grpcsync",
|
||||
"internal/syscall",
|
||||
"internal/transport",
|
||||
"keepalive",
|
||||
"metadata",
|
||||
"naming",
|
||||
"peer",
|
||||
"resolver",
|
||||
"resolver/dns",
|
||||
"resolver/passthrough",
|
||||
"serviceconfig",
|
||||
"stats",
|
||||
"status",
|
||||
"tap",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "f6d0f9ee430895e87ef1ceb5ac8f39725bafceef"
|
||||
version = "v1.24.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:59f10c1537d2199d9115d946927fe31165959a95190849c82ff11e05803528b0"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "f221b8435cfb71e54062f6c6e99e9ade30b124d5"
|
||||
version = "v2.2.4"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:999d566ad1ae4303c456af5a155f7b42401cca4fd33552567ed9dd997b107a08"
|
||||
name = "mellium.im/sasl"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "e58e780e1378aa4df5dc705364ff5ae9a4dd1e04"
|
||||
source = "https://github.com/mellium/sasl.git"
|
||||
version = "v0.2.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:25ea8c84118bb09a6ea1fe5d8a2e72d7ead40af714b74d1e849af821f3502414"
|
||||
name = "nhooyr.io/websocket"
|
||||
packages = [
|
||||
".",
|
||||
"internal/bpool",
|
||||
"internal/wsjs",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "edda9c633d5c78c7d38fcc952b4105dd4ccfb619"
|
||||
version = "v1.7.4"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
input-imports = [
|
||||
"github.com/asaskevich/govalidator",
|
||||
"github.com/cenkalti/backoff",
|
||||
"github.com/go-pg/pg",
|
||||
"github.com/hashicorp/go-hclog",
|
||||
"github.com/hashicorp/raft",
|
||||
"github.com/hashicorp/raft-boltdb",
|
||||
"github.com/integration-system/bellows",
|
||||
"github.com/integration-system/isp-etp-go",
|
||||
"github.com/integration-system/isp-etp-go/client",
|
||||
"github.com/integration-system/isp-lib-test/ctx",
|
||||
"github.com/integration-system/isp-lib-test/docker",
|
||||
"github.com/integration-system/isp-lib-test/utils",
|
||||
"github.com/integration-system/isp-lib-test/utils/postgres",
|
||||
"github.com/integration-system/isp-lib/atomic",
|
||||
"github.com/integration-system/isp-lib/backend",
|
||||
"github.com/integration-system/isp-lib/bootstrap",
|
||||
"github.com/integration-system/isp-lib/config",
|
||||
"github.com/integration-system/isp-lib/config/schema",
|
||||
"github.com/integration-system/isp-lib/database",
|
||||
"github.com/integration-system/isp-lib/structure",
|
||||
"github.com/integration-system/isp-lib/utils",
|
||||
"github.com/integration-system/isp-log",
|
||||
"github.com/integration-system/isp-log/stdcodes",
|
||||
"github.com/json-iterator/go",
|
||||
"github.com/mohae/deepcopy",
|
||||
"github.com/pkg/errors",
|
||||
"github.com/satori/go.uuid",
|
||||
"github.com/sirupsen/logrus",
|
||||
"github.com/spf13/cast",
|
||||
"github.com/stretchr/testify/assert",
|
||||
"github.com/thecodeteam/goodbye",
|
||||
"github.com/xeipuuv/gojsonschema",
|
||||
"google.golang.org/grpc",
|
||||
"google.golang.org/grpc/codes",
|
||||
"google.golang.org/grpc/status",
|
||||
]
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
# Gopkg.toml example
|
||||
#
|
||||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
||||
# for detailed Gopkg.toml documentation.
|
||||
#
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project"
|
||||
# version = "1.0.0"
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project2"
|
||||
# branch = "dev"
|
||||
# source = "github.com/myfork/project2"
|
||||
#
|
||||
# [[override]]
|
||||
# name = "github.com/x/y"
|
||||
# version = "2.4.0"
|
||||
#
|
||||
# [prune]
|
||||
# non-go = false
|
||||
# go-tests = true
|
||||
# unused-packages = true
|
||||
|
||||
[prune]
|
||||
go-tests = true
|
||||
unused-packages = true
|
||||
|
||||
[[override]]
|
||||
name = "mellium.im/sasl"
|
||||
source = "https://github.com/mellium/sasl.git"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/valyala/fasthttp"
|
||||
branch = "master"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/hashicorp/raft"
|
||||
branch = "master"
|
||||
+75
-53
@@ -2,16 +2,19 @@ package cluster
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/atomic"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/entity"
|
||||
"isp-config-service/raft"
|
||||
"isp-config-service/store/state"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -30,6 +33,7 @@ type Client struct {
|
||||
r *raft.Raft
|
||||
|
||||
leaderMu sync.RWMutex
|
||||
isLeader *atomic.AtomicBool
|
||||
leaderState leaderState
|
||||
leaderClient *SocketLeaderClient
|
||||
declaration structure.BackendDeclaration
|
||||
@@ -49,10 +53,7 @@ func (client *Client) Shutdown() error {
|
||||
}
|
||||
|
||||
func (client *Client) IsLeader() bool {
|
||||
client.leaderMu.RLock()
|
||||
defer client.leaderMu.RUnlock()
|
||||
|
||||
return client.leaderState.isLeader
|
||||
return client.isLeader.Get()
|
||||
}
|
||||
|
||||
func (client *Client) SyncApply(command []byte) (*ApplyLogResponse, error) {
|
||||
@@ -66,25 +67,27 @@ func (client *Client) SyncApply(command []byte) (*ApplyLogResponse, error) {
|
||||
if client.leaderState.isLeader {
|
||||
apply, err := client.r.SyncApply(command)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("apply to raft as a leader: %v", err)
|
||||
}
|
||||
logResponse := apply.(ApplyLogResponse)
|
||||
return &logResponse, err
|
||||
} else {
|
||||
if client.leaderClient == nil {
|
||||
return nil, ErrLeaderClientNotInitialized
|
||||
}
|
||||
response, err := client.leaderClient.Ack(command, defaultApplyTimeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var logResponse ApplyLogResponse
|
||||
err = json.Unmarshal(response, &logResponse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &logResponse, nil
|
||||
}
|
||||
|
||||
if client.leaderClient == nil {
|
||||
return nil, ErrLeaderClientNotInitialized
|
||||
}
|
||||
response, err := client.leaderClient.Ack(command, defaultApplyTimeout)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("send to leader to apply: %v", err)
|
||||
}
|
||||
|
||||
var logResponse ApplyLogResponse
|
||||
err = json.Unmarshal(response, &logResponse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &logResponse, nil
|
||||
}
|
||||
|
||||
func (client *Client) SyncApplyOnLeader(command []byte) (*ApplyLogResponse, error) {
|
||||
@@ -96,63 +99,76 @@ func (client *Client) SyncApplyOnLeader(command []byte) (*ApplyLogResponse, erro
|
||||
}
|
||||
apply, err := client.r.SyncApply(command)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("apply to raft as a leader: %v", err)
|
||||
}
|
||||
logResponse := apply.(ApplyLogResponse)
|
||||
return &logResponse, err
|
||||
return &logResponse, nil
|
||||
}
|
||||
|
||||
func (client *Client) listenLeader() {
|
||||
for n := range client.r.LeaderCh() {
|
||||
client.leaderMu.Lock()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"leader_elected": n.LeaderElected,
|
||||
"current_leader": n.CurrentLeaderAddress,
|
||||
"is_leader": n.IsLeader,
|
||||
}).Info(codes.LeaderStateChanged, "leader state changed")
|
||||
|
||||
if client.leaderClient != nil {
|
||||
log.Debugf(0, "close previous leader ws connection %s", client.leaderState.leaderAddr)
|
||||
client.leaderClient.Close()
|
||||
client.leaderClient = nil
|
||||
}
|
||||
if n.LeaderElected && !n.IsLeader {
|
||||
leaderClient := NewSocketLeaderClient(n.CurrentLeaderAddress, func() {
|
||||
client.onClientDisconnect(client.leaderState.leaderAddr)
|
||||
leaderAddr := n.CurrentLeaderAddress
|
||||
leaderClient := NewSocketLeaderClient(leaderAddr, func() {
|
||||
client.onClientDisconnect(leaderAddr)
|
||||
})
|
||||
if err := leaderClient.Dial(leaderConnectionTimeout); err != nil {
|
||||
log.Fatalf(codes.LeaderClientConnectionError, "could not connect to leader: %v", err)
|
||||
continue
|
||||
}
|
||||
client.leaderClient = leaderClient
|
||||
|
||||
go func(declaration structure.BackendDeclaration) {
|
||||
response, err := leaderClient.SendDeclaration(declaration, defaultApplyTimeout)
|
||||
if err != nil {
|
||||
log.Warnf(codes.SendDeclarationToLeaderError, "send declaration to leader. err: %v", err)
|
||||
} else if response != utils.WsOkResponse {
|
||||
log.Warnf(codes.SendDeclarationToLeaderError, "send declaration to leader. response: %s", response)
|
||||
}
|
||||
}(client.declaration)
|
||||
log.Info(codes.SendDeclarationToLeader, "sending declaration to leader through websocket")
|
||||
go client.declareMyselfToLeader(leaderClient)
|
||||
} else if n.LeaderElected && n.IsLeader {
|
||||
go func(declaration structure.BackendDeclaration) {
|
||||
now := state.GenerateDate()
|
||||
module := entity.Module{
|
||||
Id: state.GenerateId(),
|
||||
Name: declaration.ModuleName,
|
||||
CreatedAt: now,
|
||||
LastConnectedAt: now,
|
||||
}
|
||||
command := PrepareModuleConnectedCommand(module)
|
||||
syncApplyCommand(client, command, "ModuleConnectedCommand")
|
||||
|
||||
declarationCommand := PrepareUpdateBackendDeclarationCommand(declaration)
|
||||
syncApplyCommand(client, declarationCommand, "UpdateBackendDeclarationCommand")
|
||||
}(client.declaration)
|
||||
go client.declareMyselfToCluster()
|
||||
}
|
||||
client.leaderState = leaderState{
|
||||
leaderElected: n.LeaderElected,
|
||||
isLeader: n.IsLeader,
|
||||
leaderAddr: n.CurrentLeaderAddress,
|
||||
}
|
||||
client.isLeader.Set(n.IsLeader)
|
||||
|
||||
client.leaderMu.Unlock()
|
||||
}
|
||||
}
|
||||
func (client *Client) declareMyselfToLeader(leaderClient *SocketLeaderClient) {
|
||||
response, err := leaderClient.SendDeclaration(client.declaration, defaultApplyTimeout)
|
||||
if err != nil {
|
||||
log.Warnf(codes.SendDeclarationToLeader, "send declaration to leader. err: %v", err)
|
||||
} else if response != utils.WsOkResponse {
|
||||
log.Warnf(codes.SendDeclarationToLeader, "send declaration to leader. error response: '%s'", response)
|
||||
} else {
|
||||
log.Info(codes.SendDeclarationToLeader, "successfully sent my declaration to leader")
|
||||
}
|
||||
}
|
||||
|
||||
// used when a leader need to declare himself to a cluster
|
||||
func (client *Client) declareMyselfToCluster() {
|
||||
now := state.GenerateDate()
|
||||
module := entity.Module{
|
||||
Id: state.GenerateId(),
|
||||
Name: client.declaration.ModuleName,
|
||||
CreatedAt: now,
|
||||
LastConnectedAt: now,
|
||||
}
|
||||
command := PrepareModuleConnectedCommand(module)
|
||||
syncApplyCommand(client, command)
|
||||
|
||||
declarationCommand := PrepareUpdateBackendDeclarationCommand(client.declaration)
|
||||
syncApplyCommand(client, declarationCommand)
|
||||
}
|
||||
|
||||
type leaderState struct {
|
||||
leaderElected bool
|
||||
@@ -166,18 +182,24 @@ func NewRaftClusterClient(r *raft.Raft, declaration structure.BackendDeclaration
|
||||
declaration: declaration,
|
||||
leaderState: leaderState{},
|
||||
onClientDisconnect: onLeaderDisconnect,
|
||||
isLeader: atomic.NewAtomicBool(false),
|
||||
}
|
||||
go client.listenLeader()
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
func syncApplyCommand(clusterClient *Client, command []byte, commandName string) {
|
||||
func syncApplyCommand(clusterClient *Client, command []byte) {
|
||||
applyLogResponse, err := clusterClient.SyncApply(command)
|
||||
if err != nil {
|
||||
log.Warnf(codes.SyncApplyError, "announce myself. apply %s: %v", commandName, err)
|
||||
commandName := ParseCommand(command).String()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"command": string(command),
|
||||
"commandName": commandName,
|
||||
}).Warnf(codes.SyncApplyError, "announce myself. apply command: %v", err)
|
||||
}
|
||||
if applyLogResponse != nil && applyLogResponse.ApplyError != "" {
|
||||
commandName := ParseCommand(command).String()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"result": string(applyLogResponse.Result),
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
|
||||
+31
-8
@@ -3,20 +3,28 @@ package cluster
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/entity"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
ApplyCommandEvent = "CONFIG_CLUSTER:APPLY_COMMAND"
|
||||
CommandSizeBytes = 8
|
||||
|
||||
ClusterParam = "cluster"
|
||||
GETParam = "cluster"
|
||||
)
|
||||
|
||||
type Command uint64
|
||||
|
||||
// needed: go get golang.org/x/tools/cmd/stringer
|
||||
//go:generate stringer -type=Command -output const_string.go
|
||||
|
||||
const (
|
||||
_ = iota
|
||||
_ Command = iota
|
||||
UpdateBackendDeclarationCommand
|
||||
DeleteBackendDeclarationCommand
|
||||
|
||||
@@ -25,6 +33,7 @@ const (
|
||||
ModuleConnectedCommand
|
||||
ModuleDisconnectedCommand
|
||||
DeleteModulesCommand
|
||||
DeleteVersionConfigCommand
|
||||
|
||||
ActivateConfigCommand
|
||||
DeleteConfigsCommand
|
||||
@@ -32,8 +41,14 @@ const (
|
||||
|
||||
DeleteCommonConfigsCommand
|
||||
UpsertCommonConfigCommand
|
||||
|
||||
BroadcastEventCommand
|
||||
)
|
||||
|
||||
func ParseCommand(data []byte) Command {
|
||||
return Command(binary.BigEndian.Uint64(data[:CommandSizeBytes]))
|
||||
}
|
||||
|
||||
func PrepareUpdateBackendDeclarationCommand(backend structure.BackendDeclaration) []byte {
|
||||
return prepareCommand(UpdateBackendDeclarationCommand, backend)
|
||||
}
|
||||
@@ -54,8 +69,8 @@ func PrepareDeleteModulesCommand(ids []string) []byte {
|
||||
return prepareCommand(DeleteModulesCommand, DeleteModules{Ids: ids})
|
||||
}
|
||||
|
||||
func PrepareActivateConfigCommand(configId string, date time.Time) []byte {
|
||||
return prepareCommand(ActivateConfigCommand, ActivateConfig{ConfigId: configId, Date: date})
|
||||
func PrepareActivateConfigCommand(configID string, date time.Time) []byte {
|
||||
return prepareCommand(ActivateConfigCommand, ActivateConfig{ConfigId: configID, Date: date})
|
||||
}
|
||||
|
||||
func PrepareDeleteConfigsCommand(ids []string) []byte {
|
||||
@@ -78,9 +93,17 @@ func PrepareUpsertCommonConfigCommand(config UpsertCommonConfig) []byte {
|
||||
return prepareCommand(UpsertCommonConfigCommand, config)
|
||||
}
|
||||
|
||||
func prepareCommand(command uint64, payload interface{}) []byte {
|
||||
func PrepareBroadcastEventCommand(event BroadcastEvent) []byte {
|
||||
return prepareCommand(BroadcastEventCommand, event)
|
||||
}
|
||||
|
||||
func PrepareDeleteConfigVersionCommand(id string) []byte {
|
||||
return prepareCommand(DeleteVersionConfigCommand, Identity{Id: id})
|
||||
}
|
||||
|
||||
func prepareCommand(command Command, payload interface{}) []byte {
|
||||
cmd := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(cmd, command)
|
||||
binary.BigEndian.PutUint64(cmd, uint64(command))
|
||||
buf := bytes.NewBuffer(cmd)
|
||||
err := json.NewEncoder(buf).Encode(payload)
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Code generated by "stringer -type=Command -output const_string.go"; DO NOT EDIT.
|
||||
|
||||
package cluster
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[UpdateBackendDeclarationCommand-1]
|
||||
_ = x[DeleteBackendDeclarationCommand-2]
|
||||
_ = x[UpdateConfigSchemaCommand-3]
|
||||
_ = x[ModuleConnectedCommand-4]
|
||||
_ = x[ModuleDisconnectedCommand-5]
|
||||
_ = x[DeleteModulesCommand-6]
|
||||
_ = x[DeleteVersionConfigCommand-7]
|
||||
_ = x[ActivateConfigCommand-8]
|
||||
_ = x[DeleteConfigsCommand-9]
|
||||
_ = x[UpsertConfigCommand-10]
|
||||
_ = x[DeleteCommonConfigsCommand-11]
|
||||
_ = x[UpsertCommonConfigCommand-12]
|
||||
_ = x[BroadcastEventCommand-13]
|
||||
}
|
||||
|
||||
const _Command_name = "UpdateBackendDeclarationCommandDeleteBackendDeclarationCommandUpdateConfigSchemaCommandModuleConnectedCommandModuleDisconnectedCommandDeleteModulesCommandDeleteVersionConfigCommandActivateConfigCommandDeleteConfigsCommandUpsertConfigCommandDeleteCommonConfigsCommandUpsertCommonConfigCommandBroadcastEventCommand"
|
||||
|
||||
var _Command_index = [...]uint16{0, 31, 62, 87, 109, 134, 154, 180, 201, 221, 240, 266, 291, 312}
|
||||
|
||||
func (i Command) String() string {
|
||||
i -= 1
|
||||
if i >= Command(len(_Command_index)-1) {
|
||||
return "Command(" + strconv.FormatInt(int64(i+1), 10) + ")"
|
||||
}
|
||||
return _Command_name[_Command_index[i]:_Command_index[i+1]]
|
||||
}
|
||||
+18
-4
@@ -3,9 +3,10 @@ package cluster
|
||||
import (
|
||||
json2 "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
"isp-config-service/entity"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ApplyLogResponse struct {
|
||||
@@ -27,9 +28,11 @@ type ActivateConfig struct {
|
||||
}
|
||||
|
||||
type UpsertConfig struct {
|
||||
Config entity.Config
|
||||
Create bool
|
||||
Unsafe bool
|
||||
Config entity.Config
|
||||
VersionId string
|
||||
VersionCreateAt time.Time
|
||||
Create bool
|
||||
Unsafe bool
|
||||
}
|
||||
|
||||
type DeleteConfigs struct {
|
||||
@@ -40,11 +43,22 @@ type DeleteCommonConfig struct {
|
||||
Id string
|
||||
}
|
||||
|
||||
type Identity struct {
|
||||
Id string
|
||||
}
|
||||
|
||||
type UpsertCommonConfig struct {
|
||||
Config entity.CommonConfig
|
||||
Create bool
|
||||
}
|
||||
|
||||
type BroadcastEvent struct {
|
||||
Event string
|
||||
ModuleNames []string
|
||||
PerformUntil time.Time // stateless events, must be broadcast until this in UTC
|
||||
Payload json2.RawMessage
|
||||
}
|
||||
|
||||
type ResponseWithError struct {
|
||||
Response interface{}
|
||||
Error string
|
||||
|
||||
+36
-21
@@ -3,18 +3,24 @@ package cluster
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/cenkalti/backoff"
|
||||
etp "github.com/integration-system/isp-etp-go/client"
|
||||
"github.com/integration-system/isp-lib/config"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/conf"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
etp "github.com/integration-system/isp-etp-go/v2/client"
|
||||
"github.com/integration-system/isp-lib/v2/config"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/conf"
|
||||
)
|
||||
|
||||
var (
|
||||
// Set from config in main
|
||||
WsConnectionReadLimit int64
|
||||
)
|
||||
|
||||
type SocketLeaderClient struct {
|
||||
@@ -25,7 +31,8 @@ type SocketLeaderClient struct {
|
||||
}
|
||||
|
||||
func (c *SocketLeaderClient) Ack(data []byte, timeout time.Duration) ([]byte, error) {
|
||||
ctx, _ := context.WithTimeout(c.globalCtx, timeout)
|
||||
ctx, cancel := context.WithTimeout(c.globalCtx, timeout)
|
||||
defer cancel()
|
||||
response, err := c.client.EmitWithAck(ctx, ApplyCommandEvent, data)
|
||||
return response, err
|
||||
}
|
||||
@@ -35,7 +42,8 @@ func (c *SocketLeaderClient) SendDeclaration(backend structure.BackendDeclaratio
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
ctx, _ := context.WithTimeout(c.globalCtx, timeout)
|
||||
ctx, cancel := context.WithTimeout(c.globalCtx, timeout)
|
||||
defer cancel()
|
||||
response, err := c.client.EmitWithAck(ctx, utils.ModuleReady, data)
|
||||
return string(response), err
|
||||
}
|
||||
@@ -54,19 +62,22 @@ func (c *SocketLeaderClient) Close() {
|
||||
c.cancel()
|
||||
err := c.client.Close()
|
||||
if err != nil {
|
||||
log.Warnf(codes.LeaderClientConnectionError, "leader client close err: %v", err)
|
||||
log.Warnf(codes.LeaderClientConnectionError, "leader client %s close err: %v", c.url, err)
|
||||
}
|
||||
log.Debug(0, "leader client connection closed")
|
||||
log.Debugf(0, "close previous leader ws connection %s", c.url)
|
||||
}
|
||||
|
||||
func NewSocketLeaderClient(address string, leaderDisconnectionCallback func()) *SocketLeaderClient {
|
||||
etpConfig := etp.Config{
|
||||
HttpClient: http.DefaultClient,
|
||||
HttpClient: &http.Client{},
|
||||
ConnectionReadLimit: WsConnectionReadLimit,
|
||||
WorkersNum: 1,
|
||||
WorkersBufferMultiplier: 1,
|
||||
}
|
||||
client := etp.NewClient(etpConfig)
|
||||
leaderClient := &SocketLeaderClient{
|
||||
client: client,
|
||||
url: getUrl(address),
|
||||
url: getURL(address),
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
leaderClient.globalCtx = ctx
|
||||
@@ -75,20 +86,26 @@ func NewSocketLeaderClient(address string, leaderDisconnectionCallback func()) *
|
||||
leaderClient.client.OnDisconnect(func(err error) {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"leaderAddr": address,
|
||||
}).Warn(codes.LeaderClientDisconnected, "leader client disconnected")
|
||||
"error": err,
|
||||
}).Warn(codes.LeaderClientDisconnected, "disconnected ws from leader")
|
||||
leaderDisconnectionCallback()
|
||||
})
|
||||
|
||||
leaderClient.client.OnError(func(err error) {
|
||||
log.Warnf(codes.LeaderClientConnectionError, "leader client on error: %v", err)
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"leaderAddr": address,
|
||||
"error": err,
|
||||
}).Warn(codes.LeaderClientDisconnected, "leader client on error")
|
||||
})
|
||||
leaderClient.client.OnConnect(func() {
|
||||
log.Debug(0, "leader client connected")
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"leaderAddr": address,
|
||||
}).Info(codes.LeaderClientConnected, "connected to new leader")
|
||||
})
|
||||
return leaderClient
|
||||
}
|
||||
|
||||
func getUrl(address string) string {
|
||||
func getURL(address string) string {
|
||||
addr, err := net.ResolveTCPAddr("tcp", address)
|
||||
if err != nil {
|
||||
panic(err) // must never occurred
|
||||
@@ -96,9 +113,7 @@ func getUrl(address string) string {
|
||||
cfg := config.Get().(*conf.Configuration)
|
||||
|
||||
params := url.Values{}
|
||||
params.Add(ClusterParam, "true")
|
||||
// TODO выпилить instance_uuid ?
|
||||
params.Add(GETParam, "true")
|
||||
params.Add(utils.ModuleNameGetParamKey, cfg.ModuleName)
|
||||
params.Add(utils.InstanceUuidGetParamKey, "9d89354b-c728-4b48-b002-a7d3b229f151")
|
||||
return fmt.Sprintf("ws://%s:%d/isp-etp/?%s", addr.IP.String(), addr.Port, params.Encode())
|
||||
}
|
||||
+6
-3
@@ -25,9 +25,12 @@ const (
|
||||
SyncApplyError = 1015
|
||||
|
||||
// Raft Cluster
|
||||
SendDeclarationToLeaderError = 1016
|
||||
LeaderClientConnectionError = 1017
|
||||
LeaderClientDisconnected = 1018
|
||||
SendDeclarationToLeader = 1016
|
||||
LeaderClientConnectionError = 1017
|
||||
LeaderClientDisconnected = 1018
|
||||
LeaderClientConnected = 1023
|
||||
LeaderStateChanged = 1024
|
||||
LeaderManualDeleteLeader = 1025
|
||||
|
||||
// Services
|
||||
DiscoveryServiceSendModulesError = 1019
|
||||
|
||||
@@ -37,3 +37,5 @@ cluster:
|
||||
bootstrapCluster: true
|
||||
peers:
|
||||
- 127.0.0.1:9001
|
||||
|
||||
versionConfigCount: 15
|
||||
@@ -1,10 +1,7 @@
|
||||
moduleName: config
|
||||
instanceUuid: bf482806-0c3d-4e0d-b9d4-12c037b12d70
|
||||
|
||||
registry:
|
||||
host: nexus.msp.mobi
|
||||
username: mp3deployer
|
||||
password: ScjKLQuvqfAXu2bs8ysLAvRt
|
||||
|
||||
images:
|
||||
module: nexus.msp.mobi/msp2/dev/isp-config-service:latest
|
||||
+10
-8
@@ -1,22 +1,24 @@
|
||||
//nolint:lll
|
||||
package conf
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
)
|
||||
|
||||
type Configuration struct {
|
||||
Database structure.DBConfiguration `valid:"required~Required" schema:"База данных,настройка параметров подключения к базе данных"`
|
||||
GrpcOuterAddress structure.AddressConfiguration `valid:"required~Required" json:"grpcOuterAddress"`
|
||||
ModuleName string `valid:"required~Required"`
|
||||
WS WebService `valid:"required~Required" schema:"Конфигурация веб сервиса"`
|
||||
Metrics structure.MetricConfiguration
|
||||
Cluster ClusterConfiguration `valid:"required~Required"`
|
||||
Database structure.DBConfiguration `valid:"required~Required" schema:"База данных,настройка параметров подключения к базе данных"`
|
||||
GrpcOuterAddress structure.AddressConfiguration `valid:"required~Required" json:"grpcOuterAddress"`
|
||||
ModuleName string `valid:"required~Required"`
|
||||
WS WebService `valid:"required~Required" schema:"Конфигурация веб сервиса"`
|
||||
Metrics structure.MetricConfiguration
|
||||
Cluster ClusterConfiguration `valid:"required~Required"`
|
||||
VersionConfigCount int `schema:"Количество сохраняемых старых версий конфигурации"`
|
||||
}
|
||||
|
||||
type ClusterConfiguration struct {
|
||||
InMemory bool `schema:"Хранить логи и снэпшоты только в памяти"`
|
||||
DataDir string `valid:"required~Required" schema:"Пусть до директории для логов и снэпшотов рафта"`
|
||||
BootstrapCluster bool `schema:"Поднимать кластер и объявлять лидером"`
|
||||
DataDir string `valid:"required~Required" schema:"Пусть до директории для логов и снэпшотов рафта"`
|
||||
Peers []string `valid:"required~Required" schema:"Адреса всех нод в кластере,формат address:port"`
|
||||
OuterAddress string `valid:"required~Required" schema:"Внешний адрес ноды"`
|
||||
ConnectTimeoutSeconds int `valid:"required~Required" schema:"Таймаут подключения"`
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -1,319 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/integration-system/isp-lib-test/ctx"
|
||||
"github.com/integration-system/isp-lib-test/docker"
|
||||
"github.com/integration-system/isp-lib-test/utils"
|
||||
"github.com/integration-system/isp-lib-test/utils/postgres"
|
||||
"github.com/integration-system/isp-lib/backend"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"isp-config-service/conf"
|
||||
"isp-config-service/domain"
|
||||
"log"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
configServiceHttpPort = "9001"
|
||||
configServiceGrpcPort = "9002"
|
||||
configServiceSchema = "config_service"
|
||||
|
||||
configsNumber = 3
|
||||
maxAwaitingTime = 25 * time.Second
|
||||
|
||||
deleteCommonConfigsCommand = "config/common_config/delete_config"
|
||||
getRoutesCommand = "config/routing/get_routes"
|
||||
)
|
||||
|
||||
var (
|
||||
pgCfg structure.DBConfiguration
|
||||
|
||||
configsHttpAddrs = make([]structure.AddressConfiguration, configsNumber)
|
||||
configsGrpcAddrs = make([]structure.AddressConfiguration, configsNumber)
|
||||
configsCtxs = make([]*docker.ContainerContext, configsNumber)
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
cfg := ctx.BaseTestConfiguration{}
|
||||
test, err := ctx.NewIntegrationTest(m, &cfg, setup)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
test.PrepareAndRun()
|
||||
}
|
||||
|
||||
func setup(testCtx *ctx.TestContext, runTest func() int) int {
|
||||
cfg := testCtx.BaseConfiguration()
|
||||
|
||||
cli, err := docker.NewClient()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer cli.Close()
|
||||
env := docker.NewTestEnvironment(testCtx, cli)
|
||||
defer env.Cleanup()
|
||||
|
||||
_, pgCfg = env.RunPGContainer()
|
||||
_, err = postgres.Wait(pgCfg, 10*time.Second)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
pgCfg.Schema = configServiceSchema
|
||||
|
||||
configs := make([]conf.Configuration, configsNumber)
|
||||
peersAddrs := make([]string, configsNumber)
|
||||
|
||||
for i := 0; i < configsNumber; i++ {
|
||||
httpAddr := getConfigServiceAddress(i, configServiceHttpPort)
|
||||
grpcAddr := getConfigServiceAddress(i, configServiceGrpcPort)
|
||||
cfg := conf.Configuration{
|
||||
Database: pgCfg,
|
||||
ModuleName: moduleName,
|
||||
GrpcOuterAddress: grpcAddr,
|
||||
WS: conf.WebService{
|
||||
Rest: httpAddr,
|
||||
Grpc: grpcAddr,
|
||||
},
|
||||
Cluster: conf.ClusterConfiguration{
|
||||
InMemory: false,
|
||||
DataDir: "./data",
|
||||
Peers: nil,
|
||||
OuterAddress: httpAddr.GetAddress(),
|
||||
ConnectTimeoutSeconds: 10,
|
||||
BootstrapCluster: false,
|
||||
},
|
||||
}
|
||||
configsGrpcAddrs[i] = grpcAddr
|
||||
configsHttpAddrs[i] = httpAddr
|
||||
configs[i] = cfg
|
||||
peersAddrs[i] = httpAddr.GetAddress()
|
||||
}
|
||||
|
||||
configs[0].Cluster.BootstrapCluster = true
|
||||
|
||||
for i := 0; i < configsNumber; i++ {
|
||||
c := configs[i]
|
||||
peersAddrsEnv := generatePeersConfigEnv(peersAddrs)
|
||||
peersAddrsEnv["LOG_LEVEL"] = "debug"
|
||||
ctx := env.RunAppContainer(
|
||||
cfg.Images.Module, c, nil,
|
||||
docker.WithName(c.GrpcOuterAddress.IP),
|
||||
docker.WithLogger(NewWriteLogger(strconv.Itoa(i)+"_config:", ioutil.Discard, "DeleteCommonConfigsCommand")),
|
||||
//docker.PullImage(cfg.Registry.Username, cfg.Registry.Password),
|
||||
docker.WithEnv(peersAddrsEnv),
|
||||
)
|
||||
grpcAddr := configsGrpcAddrs[i]
|
||||
grpcAddr.IP = ctx.GetIPAddress()
|
||||
configsGrpcAddrs[i] = grpcAddr
|
||||
|
||||
httpAddr := configsHttpAddrs[i]
|
||||
httpAddr.IP = ctx.GetIPAddress()
|
||||
configsHttpAddrs[i] = httpAddr
|
||||
|
||||
configsCtxs[i] = ctx
|
||||
}
|
||||
|
||||
//time.Sleep(3 * time.Second)
|
||||
return runTest()
|
||||
}
|
||||
|
||||
func TestClusterElection(t *testing.T) {
|
||||
defer func() {
|
||||
err := recover()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}()
|
||||
a := assert.New(t)
|
||||
var ready bool
|
||||
|
||||
ready = testClusterReady(a, -1)
|
||||
if !ready {
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < configsNumber; i++ {
|
||||
fmt.Print("\n\n\n")
|
||||
log.Printf("stopping %d container\n", i)
|
||||
a.NoError(configsCtxs[i].StopContainer(20 * time.Second))
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
fmt.Print("\n\n\n")
|
||||
log.Printf("checking cluster except %d\n", i)
|
||||
ready = testClusterReady(a, i)
|
||||
if !ready {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Print("\n\n\n")
|
||||
log.Printf("starting %d container\n", i)
|
||||
a.NoError(configsCtxs[i].StartContainer())
|
||||
|
||||
log.Printf("checking cluster, iteration %d\n", i+1)
|
||||
ready = testClusterReady(a, -1)
|
||||
if !ready {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getConfigServiceAddress(num int, port string) structure.AddressConfiguration {
|
||||
lastIp := pgCfg.Address
|
||||
ip := net.ParseIP(lastIp).To4()
|
||||
ip[3] = byte(int(ip[3]) + num + 1)
|
||||
return structure.AddressConfiguration{
|
||||
//IP: fmt.Sprintf("%s-%d", "isp-config-service", num),
|
||||
IP: ip.String(),
|
||||
Port: port,
|
||||
}
|
||||
}
|
||||
|
||||
func testClusterReady(a *assert.Assertions, except int) bool {
|
||||
var clients []*backend.InternalGrpcClient
|
||||
defer func() {
|
||||
for _, client := range clients {
|
||||
client.CloseQuietly()
|
||||
}
|
||||
}()
|
||||
|
||||
for j := 0; j < configsNumber; j++ {
|
||||
if j == except {
|
||||
continue
|
||||
}
|
||||
configAddr := configsGrpcAddrs[j]
|
||||
client := testGrpcReady(configAddr, a)
|
||||
if client == nil {
|
||||
a.Fail(fmt.Sprintf("unable to connect to %d config", j))
|
||||
return false
|
||||
}
|
||||
clients = append(clients, client)
|
||||
ready := testRaftReady(client, a)
|
||||
if !ready {
|
||||
return ready
|
||||
}
|
||||
}
|
||||
|
||||
prevRoutes := getRoutes(clients[0], a)
|
||||
routesLen := len(clients)
|
||||
for i := 1; i < len(clients); i++ {
|
||||
routes := getRoutes(clients[i], a)
|
||||
t := a.Len(routes, routesLen, "invalid length")
|
||||
if !t {
|
||||
return t
|
||||
}
|
||||
match := a.ElementsMatch(prevRoutes, routes, "different backend declarations")
|
||||
if !match {
|
||||
return match
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func testGrpcReady(configAddr structure.AddressConfiguration, a *assert.Assertions) *backend.InternalGrpcClient {
|
||||
start := time.Now()
|
||||
var client *backend.InternalGrpcClient
|
||||
var err error
|
||||
_, _ = await(func() (interface{}, error) {
|
||||
client, err = backend.NewGrpcClient(
|
||||
configAddr.GetAddress(),
|
||||
grpc.WithBlock(),
|
||||
grpc.WithInsecure(),
|
||||
)
|
||||
//log.Println("connect to grpc err:", err)
|
||||
return nil, err
|
||||
}, maxAwaitingTime)
|
||||
if !a.NoError(err) {
|
||||
return nil
|
||||
}
|
||||
log.Println("waiting until grpc ready:", time.Now().Sub(start).Round(time.Second))
|
||||
return client
|
||||
}
|
||||
|
||||
func testRaftReady(client *backend.InternalGrpcClient, a *assert.Assertions) bool {
|
||||
var err error
|
||||
req := new(domain.ConfigIdRequest)
|
||||
req.Id = "33"
|
||||
response := new(structure.GrpcError)
|
||||
start := time.Now()
|
||||
f := func() (interface{}, error) {
|
||||
err = client.Invoke(
|
||||
deleteCommonConfigsCommand,
|
||||
-1,
|
||||
req,
|
||||
response,
|
||||
)
|
||||
//log.Println("send grpc request. response: ", response, "err: ", err)
|
||||
return nil, err
|
||||
}
|
||||
_, _ = await(f, maxAwaitingTime)
|
||||
log.Println("waiting until raft ready:", time.Now().Sub(start).Round(time.Second))
|
||||
return a.NoError(err)
|
||||
}
|
||||
|
||||
func getRoutes(client *backend.InternalGrpcClient, a *assert.Assertions) []structure.BackendDeclaration {
|
||||
var response []structure.BackendDeclaration
|
||||
err := client.Invoke(
|
||||
getRoutesCommand,
|
||||
-1,
|
||||
nil,
|
||||
&response,
|
||||
)
|
||||
//log.Println("routes:", response)
|
||||
a.NoError(err)
|
||||
return response
|
||||
}
|
||||
|
||||
func await(dialer func() (interface{}, error), timeout time.Duration) (interface{}, error) {
|
||||
retryer := utils.NewRetryer(dialer, timeout)
|
||||
retryer.AttemptTimeout = 300 * time.Millisecond
|
||||
return retryer.Do()
|
||||
}
|
||||
|
||||
func generatePeersConfigEnv(peers []string) map[string]string {
|
||||
key := "LC_ISP_CLUSTER.PEERS"
|
||||
val := strings.Join(peers, ",")
|
||||
return map[string]string{
|
||||
key: val,
|
||||
}
|
||||
}
|
||||
|
||||
type writeLogger struct {
|
||||
prefix string
|
||||
w io.Writer
|
||||
filter string
|
||||
}
|
||||
|
||||
func (l *writeLogger) Write(p []byte) (int, error) {
|
||||
lines := bytes.SplitAfter(p, []byte("\n"))
|
||||
for _, line := range lines {
|
||||
s := string(line)
|
||||
if l.filter != "" && strings.Contains(s, l.filter) || strings.TrimSpace(s) == "" {
|
||||
continue
|
||||
}
|
||||
_, err := l.w.Write(p)
|
||||
if err != nil {
|
||||
fmt.Printf("%s %s: %v", l.prefix, s, err)
|
||||
} else {
|
||||
fmt.Printf("%s %s", l.prefix, s)
|
||||
}
|
||||
}
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
// NewWriteLogger returns a writer that behaves like w except
|
||||
// that it logs (using fmt.Printf) each write to standard error,
|
||||
// printing the prefix and the string data written.
|
||||
func NewWriteLogger(prefix string, w io.Writer, filter string) io.Writer {
|
||||
return &writeLogger{prefix, w, filter}
|
||||
}
|
||||
+14
-19
@@ -15,12 +15,11 @@ type commonConfig struct {
|
||||
rstore *store.Store
|
||||
}
|
||||
|
||||
// GetConfigs godoc
|
||||
// @Summary Метод получения объектов конфигурации по идентификаторам
|
||||
// @Description Возвращает массив конфигураций по запрошенным идентификаторам (все, если массив пустой)
|
||||
// @Tags Общие конфигурации
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {array} entity.CommonConfig
|
||||
// @Router /common_config/get_configs [POST]
|
||||
func (c *commonConfig) GetConfigs(identities []string) []entity.CommonConfig {
|
||||
@@ -35,13 +34,12 @@ func (c *commonConfig) GetConfigs(identities []string) []entity.CommonConfig {
|
||||
return response
|
||||
}
|
||||
|
||||
// CreateUpdateConfig godoc
|
||||
// @Summary Метод обновления общей конфигурации
|
||||
// @Description Если конфиг с таким id существует, то обновляет данные, если нет, то добавляет данные в базу
|
||||
// В случае обновления рассылает все подключенным модулям актуальную конфигурацию
|
||||
// @Description В случае обновления рассылает всем подключенным модулям актуальную конфигурацию
|
||||
// @Tags Общие конфигурации
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body entity.CommonConfig true "объект для сохранения"
|
||||
// @Success 200 {object} entity.CommonConfig
|
||||
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||
@@ -60,19 +58,18 @@ func (c *commonConfig) CreateUpdateConfig(config entity.CommonConfig) (*entity.C
|
||||
upsertConfig.Create = true
|
||||
}
|
||||
command := cluster.PrepareUpsertCommonConfigCommand(upsertConfig)
|
||||
err := PerformSyncApplyWithError(command, "UpsertCommonConfigCommand", &response)
|
||||
err := PerformSyncApplyWithError(command, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
// DeleteConfigs godoc
|
||||
// @Summary Метод удаления объектов общей конфигурации по идентификаторам
|
||||
// @Description Возвращает флаг удаления и набор связей с модулями и конфигурациями, в случае наличия связей deleted всегда false
|
||||
// @Tags Общие конфигурации
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id общей конфигурации"
|
||||
// @Success 200 {object} domain.DeleteCommonConfigResponse
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
@@ -80,19 +77,18 @@ func (c *commonConfig) CreateUpdateConfig(config entity.CommonConfig) (*entity.C
|
||||
func (c *commonConfig) DeleteConfigs(req domain.ConfigIdRequest) (*domain.DeleteCommonConfigResponse, error) {
|
||||
var response domain.DeleteCommonConfigResponse
|
||||
command := cluster.PrepareDeleteCommonConfigsCommand(req.Id)
|
||||
err := PerformSyncApplyWithError(command, "DeleteCommonConfigsCommand", &response)
|
||||
err := PerformSyncApplyWithError(command, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
// CompileConfigs godoc
|
||||
// @Summary Метод компиляции итоговой конфигурации для модулей
|
||||
// @Description Возвращает скомпилированный объект конфигурации
|
||||
// @Tags Общие конфигурации
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.CompileConfigsRequest true "перечисление идентификаторов общей конфигурации и исхдных конфиг"
|
||||
// @Success 200 {object} domain.CompiledConfigResponse
|
||||
// @Router /common_config/compile [POST]
|
||||
@@ -104,19 +100,18 @@ func (c *commonConfig) CompileConfigs(req domain.CompileConfigsRequest) domain.C
|
||||
return result
|
||||
}
|
||||
|
||||
// GetLinks godoc
|
||||
// @Summary Метод получения связей общей конфигурациями с конфигурацией модулей
|
||||
// @Description Возвращает ассоциативный массив, ключами которого являются название модулей, а значения - название конфигурации модуля
|
||||
// @Tags Общие конфигурации
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id общей конфигурации"
|
||||
// @Success 200 {object} domain.CommonConfigLinks
|
||||
// @Router /common_config/get_links [POST]
|
||||
func (c *commonConfig) GetLinks(req domain.ConfigIdRequest) domain.CommonConfigLinks {
|
||||
var result domain.CommonConfigLinks
|
||||
c.rstore.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
result = service.CommonConfigService.GetCommonConfigLinks(req.Id, state)
|
||||
result = service.CommonConfig.GetCommonConfigLinks(req.Id, state)
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
+131
-28
@@ -1,12 +1,15 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/domain"
|
||||
"isp-config-service/entity"
|
||||
"isp-config-service/service"
|
||||
"isp-config-service/store"
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
@@ -17,38 +20,77 @@ type config struct {
|
||||
rstore *store.Store
|
||||
}
|
||||
|
||||
// GetActiveConfigByModuleName godoc
|
||||
// @Summary Метод получения объекта конфигурации по названию модуля
|
||||
// @Description Возвращает активную конфиграцию по названию модуля
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.GetByModuleNameRequest true "название модуля"
|
||||
// @Success 200 {object} entity.Config
|
||||
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Router /config/get_active_config_by_module_name [POST]
|
||||
func (c *config) GetActiveConfigByModuleName(request domain.GetByModuleNameRequest) (*entity.Config, error) {
|
||||
var response *entity.Config
|
||||
var (
|
||||
module *entity.Module
|
||||
config *entity.Config
|
||||
)
|
||||
c.rstore.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
module := state.Modules().GetByName(request.ModuleName)
|
||||
module = state.Modules().GetByName(request.ModuleName)
|
||||
if module != nil {
|
||||
response = state.Configs().GetActiveByModuleId(module.Id)
|
||||
config = state.Configs().GetActiveByModuleId(module.Id)
|
||||
}
|
||||
})
|
||||
if response == nil {
|
||||
return nil, status.Error(codes.NotFound, utils.ValidationError)
|
||||
if module == nil {
|
||||
return nil, status.Errorf(codes.NotFound, "module with name '%s' not found", request.ModuleName)
|
||||
}
|
||||
return response, nil
|
||||
if config == nil {
|
||||
return nil, status.Errorf(codes.NotFound, "active config for module '%s' not found", request.ModuleName)
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// @Summary Метод получения списка конфигураций по ID модуля
|
||||
// @Description Возвращает список конфиграции по ID модуля
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.GetByModuleIdRequest true "ID модуля"
|
||||
// @Success 200 {array} domain.ConfigModuleInfo
|
||||
// @Failure 400 {object} structure.GrpcError "если идентификатор не указан"
|
||||
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Router /config/get_configs_by_module_id [POST]
|
||||
func (c *config) GetConfigsByModuleId(request domain.GetByModuleIdRequest) ([]domain.ConfigModuleInfo, error) {
|
||||
var config []entity.Config
|
||||
var configInfo []domain.ConfigModuleInfo
|
||||
|
||||
c.rstore.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
config = state.Configs().GetByModuleIds([]string{request.ModuleId})
|
||||
if len(config) == 0 {
|
||||
return
|
||||
}
|
||||
for _, value := range config {
|
||||
configInfo = append(configInfo, domain.ConfigModuleInfo{
|
||||
Config: value,
|
||||
Valid: service.ModuleRegistry.ValidateConfig(value, state),
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
if len(configInfo) == 0 {
|
||||
return nil, status.Errorf(codes.NotFound, "configs for module '%s' not found", request.ModuleId)
|
||||
}
|
||||
|
||||
return configInfo, nil
|
||||
}
|
||||
|
||||
// CreateUpdateConfig godoc
|
||||
// @Summary Метод обновления конфигурации
|
||||
// @Description Если конфиг с таким id существует, то обновляет данные, если нет, то добавляет данные в базу
|
||||
// В случае обновления рассылает все подключенным модулям актуальную конфигурацию
|
||||
// @Description В случае обновления рассылает всем подключенным модулям актуальную конфигурацию
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.CreateUpdateConfigRequest true "объект для сохранения"
|
||||
// @Success 200 {object} domain.ConfigModuleInfo
|
||||
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||
@@ -60,30 +102,31 @@ func (c *config) CreateUpdateConfig(config domain.CreateUpdateConfigRequest) (*d
|
||||
config.CreatedAt = now
|
||||
config.UpdatedAt = now
|
||||
upsertConfig := cluster.UpsertConfig{
|
||||
Config: config.Config,
|
||||
Unsafe: config.Unsafe,
|
||||
Config: config.Config,
|
||||
Unsafe: config.Unsafe,
|
||||
VersionId: state.GenerateId(),
|
||||
VersionCreateAt: time.Now(),
|
||||
}
|
||||
if config.Id == "" {
|
||||
upsertConfig.Config.Id = state.GenerateId()
|
||||
upsertConfig.Create = true
|
||||
}
|
||||
command := cluster.PrepareUpsertConfigCommand(upsertConfig)
|
||||
err := PerformSyncApplyWithError(command, "UpsertConfigCommand", &response)
|
||||
err := PerformSyncApplyWithError(command, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if response.Config != nil {
|
||||
return response.Config, nil
|
||||
} else {
|
||||
} else if response.ErrorDetails != nil {
|
||||
return nil, utils.CreateValidationErrorDetails(codes.InvalidArgument, utils.ValidationError, response.ErrorDetails)
|
||||
}
|
||||
|
||||
return response.Config, nil
|
||||
}
|
||||
|
||||
// MarkConfigAsActive godoc
|
||||
// @Summary Метод активации конфигурации для модуля
|
||||
// @Description Активирует указанную конфигурацию и деактивирует остальные, возвращает активированную конфигурацию
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id конфигурации для изменения"
|
||||
// @Success 200 {object} entity.Config "активированная конфигурация"
|
||||
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||
@@ -92,19 +135,18 @@ func (c *config) CreateUpdateConfig(config domain.CreateUpdateConfigRequest) (*d
|
||||
func (c *config) MarkConfigAsActive(identity domain.ConfigIdRequest) (*entity.Config, error) {
|
||||
var response entity.Config
|
||||
command := cluster.PrepareActivateConfigCommand(identity.Id, state.GenerateDate())
|
||||
err := PerformSyncApplyWithError(command, "ActivateConfigCommand", &response)
|
||||
err := PerformSyncApplyWithError(command, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
// DeleteConfigs godoc
|
||||
// @Summary Метод удаления объектов конфигурации по идентификаторам
|
||||
// @Description Возвращает количество удаленных модулей
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body []string true "массив идентификаторов конфигураций"
|
||||
// @Success 200 {object} domain.DeleteResponse
|
||||
// @Failure 400 {object} structure.GrpcError "если не указан массив идентификаторов"
|
||||
@@ -119,13 +161,74 @@ func (c *config) DeleteConfigs(identities []string) (*domain.DeleteResponse, err
|
||||
}
|
||||
var response domain.DeleteResponse
|
||||
command := cluster.PrepareDeleteConfigsCommand(identities)
|
||||
err := PerformSyncApply(command, "DeleteConfigsCommand", &response)
|
||||
err := PerformSyncApply(command, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
// @Summary Метод удаления версии конфигурации
|
||||
// @Description Возвращает количество удаленных версий
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id версии конфигурации"
|
||||
// @Success 200 {object} domain.DeleteResponse
|
||||
// @Failure 400 {object} structure.GrpcError "если не указан массив идентификаторов"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Router /config/delete_version [POST]
|
||||
func (c *config) DeleteConfigVersion(req domain.ConfigIdRequest) (*domain.DeleteResponse, error) {
|
||||
var response domain.DeleteResponse
|
||||
command := cluster.PrepareDeleteConfigVersionCommand(req.Id)
|
||||
err := PerformSyncApplyWithError(command, &response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
// @Summary Метод получение старых версий конфигурации
|
||||
// @Description Возвращает предыдущие версии конфигураций
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id конфигурации"
|
||||
// @Success 200 {array} entity.VersionConfig
|
||||
// @Failure 400 {object} structure.GrpcError "если не указан массив идентификаторов"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Router /config/get_all_version [POST]
|
||||
func (c *config) GetAllVersion(req domain.ConfigIdRequest) ([]entity.VersionConfig, error) {
|
||||
var response []entity.VersionConfig
|
||||
c.rstore.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
response = state.VersionConfig().GetByConfigId(req.Id)
|
||||
})
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// @Summary Метод получение актуальной конфигурации конфигурации
|
||||
// @Description Возвращает актуальную версию конфигурации без дополнительного содержимого (ConfigData)
|
||||
// @Tags Конфигурация
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.ConfigIdRequest true "id конфигурации"
|
||||
// @Success 200 {object} entity.Config
|
||||
// @Failure 400 {object} structure.GrpcError "если не указан идентификатор конфигурации"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Router /config/get_config_by_id [POST]
|
||||
func (c *config) GetConfigById(req domain.ConfigIdRequest) (entity.Config, error) {
|
||||
var response []entity.Config
|
||||
c.rstore.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
response = state.Configs().GetByIds([]string{req.Id})
|
||||
})
|
||||
|
||||
if len(response) > 0 {
|
||||
return response[0], nil
|
||||
}
|
||||
|
||||
return entity.Config{}, status.Errorf(codes.NotFound, "config with id '%s' not found", req.Id)
|
||||
}
|
||||
|
||||
func NewConfig(rstore *store.Store) *config {
|
||||
return &config{
|
||||
rstore: rstore,
|
||||
|
||||
+14
-8
@@ -1,7 +1,7 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"google.golang.org/grpc/codes"
|
||||
@@ -17,13 +17,15 @@ func unknownError() error {
|
||||
return status.Error(codes.Unknown, utils.ServiceError)
|
||||
}
|
||||
|
||||
func PerformSyncApply(command []byte, commandName string, responsePtr interface{}) error {
|
||||
func PerformSyncApply(command []byte, responsePtr interface{}) error {
|
||||
applyLogResponse, err := holder.ClusterClient.SyncApply(command)
|
||||
if err != nil {
|
||||
log.Warnf(codes2.SyncApplyError, "apply %s: %v", commandName, err)
|
||||
cmd := cluster.ParseCommand(command)
|
||||
log.Warnf(codes2.SyncApplyError, "apply %s: %v", cmd, err)
|
||||
return unknownError()
|
||||
}
|
||||
if applyLogResponse != nil && applyLogResponse.ApplyError != "" {
|
||||
commandName := cluster.ParseCommand(command).String()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"result": string(applyLogResponse.Result),
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
@@ -31,20 +33,24 @@ func PerformSyncApply(command []byte, commandName string, responsePtr interface{
|
||||
}).Warnf(codes2.SyncApplyError, "apply command")
|
||||
return unknownError()
|
||||
}
|
||||
err = json.Unmarshal(applyLogResponse.Result, responsePtr)
|
||||
if err != nil {
|
||||
return unknownError()
|
||||
if responsePtr != nil {
|
||||
err = json.Unmarshal(applyLogResponse.Result, responsePtr)
|
||||
if err != nil {
|
||||
return unknownError()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func PerformSyncApplyWithError(command []byte, commandName string, responsePtr interface{}) error {
|
||||
func PerformSyncApplyWithError(command []byte, responsePtr interface{}) error {
|
||||
applyLogResponse, err := holder.ClusterClient.SyncApply(command)
|
||||
if err != nil {
|
||||
log.Warnf(codes2.SyncApplyError, "apply %s: %v", commandName, err)
|
||||
cmd := cluster.ParseCommand(command)
|
||||
log.Warnf(codes2.SyncApplyError, "apply %s: %v", cmd, err)
|
||||
return unknownError()
|
||||
}
|
||||
if applyLogResponse != nil && applyLogResponse.ApplyError != "" {
|
||||
commandName := cluster.ParseCommand(command).String()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"result": string(applyLogResponse.Result),
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
|
||||
+54
-5
@@ -1,23 +1,29 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc/status"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/domain"
|
||||
"isp-config-service/entity"
|
||||
"isp-config-service/service"
|
||||
"isp-config-service/store"
|
||||
"isp-config-service/store/state"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
"google.golang.org/grpc/codes"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultEventLifetime = 5 * time.Second
|
||||
)
|
||||
|
||||
var Module *module
|
||||
|
||||
type module struct {
|
||||
rstore *store.Store
|
||||
}
|
||||
|
||||
// GetModulesAggregatedInfo godoc
|
||||
// @Summary Метод получения полной информации о состоянии модуля
|
||||
// @Description Возвращает полное состояние всех модулей в кластере (конфигурация, схема конфигурации, подключенные экземпляры)
|
||||
// @Tags Модули
|
||||
@@ -29,12 +35,11 @@ type module struct {
|
||||
func (c *module) GetModulesAggregatedInfo() ([]domain.ModuleInfo, error) {
|
||||
var response []domain.ModuleInfo
|
||||
c.rstore.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
response = service.ModuleRegistryService.GetAggregatedModuleInfo(state)
|
||||
response = service.ModuleRegistry.GetAggregatedModuleInfo(state)
|
||||
})
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// DeleteModules godoc
|
||||
// @Summary Метод удаления объектов модулей по идентификаторам
|
||||
// @Description Возвращает количество удаленных модулей
|
||||
// @Tags Модули
|
||||
@@ -54,13 +59,57 @@ func (*module) DeleteModules(identities []string) (*domain.DeleteResponse, error
|
||||
|
||||
var deleteResponse domain.DeleteResponse
|
||||
command := cluster.PrepareDeleteModulesCommand(identities)
|
||||
err := PerformSyncApply(command, "DeleteCommonConfigsCommand", &deleteResponse)
|
||||
err := PerformSyncApply(command, &deleteResponse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &deleteResponse, err
|
||||
}
|
||||
|
||||
// @Summary Метод получения модуля по имени
|
||||
// @Tags Модули
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.GetByModuleNameRequest true "название модуля"
|
||||
// @Success 200 {object} entity.Module
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Failure 404 {object} structure.GrpcError "модуль с указанным названием не найден"
|
||||
// @Router /module/get_by_name [POST]
|
||||
func (c *module) GetModuleByName(req domain.GetByModuleNameRequest) (*entity.Module, error) {
|
||||
var module *entity.Module
|
||||
c.rstore.VisitReadonlyState(func(readonlyState state.ReadonlyState) {
|
||||
module = readonlyState.Modules().GetByName(req.ModuleName)
|
||||
})
|
||||
if module == nil {
|
||||
return nil, status.Errorf(codes.NotFound, "module with name '%s' not found", req.ModuleName)
|
||||
}
|
||||
return module, nil
|
||||
}
|
||||
|
||||
// @Summary Метод отправки события всем подключенным модулям
|
||||
// @Tags Модули
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.BroadcastEventRequest true "событие"
|
||||
// @Success 200 "OK"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Router /module/broadcast_event [POST]
|
||||
func (c *module) BroadcastEvent(req domain.BroadcastEventRequest) error {
|
||||
cmd := cluster.BroadcastEvent{
|
||||
Event: req.Event,
|
||||
ModuleNames: req.ModuleNames,
|
||||
Payload: req.Payload,
|
||||
PerformUntil: time.Now().UTC().Add(defaultEventLifetime),
|
||||
}
|
||||
command := cluster.PrepareBroadcastEventCommand(cmd)
|
||||
err := PerformSyncApply(command, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewModule(rstore *store.Store) *module {
|
||||
return &module{
|
||||
rstore: rstore,
|
||||
|
||||
+1
-2
@@ -1,7 +1,7 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"isp-config-service/store"
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
@@ -14,7 +14,6 @@ type routes struct {
|
||||
rstore *store.Store
|
||||
}
|
||||
|
||||
// GetRoutes godoc
|
||||
// @Summary Метод получения маршрутов
|
||||
// @Description Возвращает все доступные модули
|
||||
// @Tags Роуты
|
||||
|
||||
@@ -15,12 +15,11 @@ type schema struct {
|
||||
rstore *store.Store
|
||||
}
|
||||
|
||||
// GetByModuleId godoc
|
||||
// @Summary Метод получения схемы конфигурации модуля
|
||||
// @Description Возвращает текущую json схему конфигурации модуля
|
||||
// @Tags Схема
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.GetByModuleIdRequest true "идентификатор модуля"
|
||||
// @Success 200 {object} entity.ConfigSchema
|
||||
// @Failure 404 {object} structure.GrpcError "если схема для модуля не найдена"
|
||||
|
||||
+296
-182
@@ -1,8 +1,22 @@
|
||||
basePath: /api/config
|
||||
definitions:
|
||||
domain.BroadcastEventRequest:
|
||||
properties:
|
||||
event:
|
||||
type: string
|
||||
moduleNames:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
payload:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
type: object
|
||||
domain.CommonConfigLinks:
|
||||
additionalProperties:
|
||||
items: {}
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
domain.CompileConfigsRequest:
|
||||
@@ -12,18 +26,16 @@ definitions:
|
||||
type: string
|
||||
type: array
|
||||
data:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
type: object
|
||||
domain.CompiledConfigResponse:
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
type: object
|
||||
domain.ConfigIdRequest:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
required:
|
||||
- id
|
||||
type: object
|
||||
domain.ConfigModuleInfo:
|
||||
properties:
|
||||
@@ -37,7 +49,6 @@ definitions:
|
||||
type: string
|
||||
data:
|
||||
$ref: '#/definitions/entity.ConfigData'
|
||||
type: object
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
@@ -52,18 +63,14 @@ definitions:
|
||||
type: boolean
|
||||
version:
|
||||
type: integer
|
||||
required:
|
||||
- moduleId
|
||||
- name
|
||||
type: object
|
||||
domain.Connection:
|
||||
properties:
|
||||
address:
|
||||
$ref: '#/definitions/structure.AddressConfiguration'
|
||||
type: object
|
||||
endpoints:
|
||||
items:
|
||||
$ref: '#/definitions/structure.EndpointConfig'
|
||||
$ref: '#/definitions/structure.EndpointDescriptor'
|
||||
type: array
|
||||
establishedAt:
|
||||
type: string
|
||||
@@ -84,7 +91,6 @@ definitions:
|
||||
type: string
|
||||
data:
|
||||
$ref: '#/definitions/entity.ConfigData'
|
||||
type: object
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
@@ -99,9 +105,6 @@ definitions:
|
||||
type: string
|
||||
version:
|
||||
type: integer
|
||||
required:
|
||||
- moduleId
|
||||
- name
|
||||
type: object
|
||||
domain.DeleteCommonConfigResponse:
|
||||
properties:
|
||||
@@ -109,7 +112,6 @@ definitions:
|
||||
type: boolean
|
||||
links:
|
||||
$ref: '#/definitions/domain.CommonConfigLinks'
|
||||
type: object
|
||||
type: object
|
||||
domain.DeleteResponse:
|
||||
properties:
|
||||
@@ -120,15 +122,20 @@ definitions:
|
||||
properties:
|
||||
moduleId:
|
||||
type: string
|
||||
required:
|
||||
- moduleId
|
||||
type: object
|
||||
domain.GetByModuleNameRequest:
|
||||
properties:
|
||||
moduleName:
|
||||
type: string
|
||||
required:
|
||||
- moduleName
|
||||
type: object
|
||||
domain.ModuleDependency:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
required:
|
||||
type: boolean
|
||||
type: object
|
||||
domain.ModuleInfo:
|
||||
properties:
|
||||
@@ -136,7 +143,6 @@ definitions:
|
||||
type: boolean
|
||||
configSchema:
|
||||
$ref: '#/definitions/schema.Schema'
|
||||
type: object
|
||||
configs:
|
||||
items:
|
||||
$ref: '#/definitions/domain.ConfigModuleInfo'
|
||||
@@ -151,6 +157,10 @@ definitions:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
requiredModules:
|
||||
items:
|
||||
$ref: '#/definitions/domain.ModuleDependency'
|
||||
type: array
|
||||
status:
|
||||
items:
|
||||
$ref: '#/definitions/domain.Connection'
|
||||
@@ -162,7 +172,6 @@ definitions:
|
||||
type: string
|
||||
data:
|
||||
$ref: '#/definitions/entity.ConfigData'
|
||||
type: object
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
@@ -171,8 +180,6 @@ definitions:
|
||||
type: string
|
||||
updatedAt:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
entity.Config:
|
||||
properties:
|
||||
@@ -186,7 +193,6 @@ definitions:
|
||||
type: string
|
||||
data:
|
||||
$ref: '#/definitions/entity.ConfigData'
|
||||
type: object
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
@@ -199,13 +205,9 @@ definitions:
|
||||
type: string
|
||||
version:
|
||||
type: integer
|
||||
required:
|
||||
- moduleId
|
||||
- name
|
||||
type: object
|
||||
entity.ConfigData:
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
type: object
|
||||
entity.ConfigSchema:
|
||||
properties:
|
||||
@@ -217,132 +219,40 @@ definitions:
|
||||
type: string
|
||||
schema:
|
||||
$ref: '#/definitions/schema.Schema'
|
||||
type: object
|
||||
updatedAt:
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
type: object
|
||||
jsonschema.Definitions:
|
||||
additionalProperties: {}
|
||||
type: object
|
||||
jsonschema.Schema:
|
||||
entity.Module:
|
||||
properties:
|
||||
$ref:
|
||||
description: section 7
|
||||
createdAt:
|
||||
type: string
|
||||
$schema:
|
||||
description: RFC draft-wright-json-schema-00
|
||||
id:
|
||||
type: string
|
||||
additionalItems:
|
||||
description: section 5.9
|
||||
type: integer
|
||||
additionalProperties:
|
||||
description: section 5.18
|
||||
lastConnectedAt:
|
||||
type: string
|
||||
allOf:
|
||||
description: section 5.22
|
||||
items:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
type: array
|
||||
anyOf:
|
||||
description: section 5.23
|
||||
items:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
type: array
|
||||
binaryEncoding:
|
||||
description: section 4.3
|
||||
lastDisconnectedAt:
|
||||
type: string
|
||||
default:
|
||||
description: section 6.2
|
||||
type: object
|
||||
definitions:
|
||||
$ref: '#/definitions/jsonschema.Definitions'
|
||||
type: object
|
||||
dependencies:
|
||||
description: section 5.19
|
||||
type: object
|
||||
description:
|
||||
description: section 6.1
|
||||
name:
|
||||
type: string
|
||||
enum:
|
||||
description: section 5.20
|
||||
items:
|
||||
type: object
|
||||
type: array
|
||||
exclusiveMaximum:
|
||||
description: section 5.3
|
||||
type: boolean
|
||||
exclusiveMinimum:
|
||||
description: section 5.5
|
||||
type: boolean
|
||||
format:
|
||||
description: section 7
|
||||
type: object
|
||||
entity.VersionConfig:
|
||||
properties:
|
||||
configId:
|
||||
type: string
|
||||
items:
|
||||
description: section 5.9
|
||||
configVersion:
|
||||
type: integer
|
||||
maxItems:
|
||||
description: section 5.10
|
||||
type: integer
|
||||
maxLength:
|
||||
description: section 5.6
|
||||
type: integer
|
||||
maxProperties:
|
||||
description: section 5.13
|
||||
type: integer
|
||||
maximum:
|
||||
description: section 5.2
|
||||
type: integer
|
||||
media:
|
||||
description: RFC draft-wright-json-schema-hyperschema-00, section 4
|
||||
type: integer
|
||||
minItems:
|
||||
description: section 5.11
|
||||
type: integer
|
||||
minLength:
|
||||
description: section 5.7
|
||||
type: integer
|
||||
minProperties:
|
||||
description: section 5.14
|
||||
type: integer
|
||||
minimum:
|
||||
description: section 5.4
|
||||
type: integer
|
||||
multipleOf:
|
||||
description: RFC draft-wright-json-schema-validation-00, section 5
|
||||
type: integer
|
||||
not:
|
||||
description: section 5.25
|
||||
type: integer
|
||||
oneOf:
|
||||
description: section 5.24
|
||||
items:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
type: array
|
||||
pattern:
|
||||
description: section 5.8
|
||||
createdAt:
|
||||
type: string
|
||||
patternProperties:
|
||||
description: section 5.17
|
||||
type: object
|
||||
properties:
|
||||
description: section 5.16
|
||||
type: object
|
||||
required:
|
||||
description: section 5.15
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
title:
|
||||
description: RFC draft-wright-json-schema-validation-00, section 6, 7
|
||||
data:
|
||||
$ref: '#/definitions/entity.ConfigData'
|
||||
id:
|
||||
type: string
|
||||
type:
|
||||
description: section 5.21
|
||||
type: string
|
||||
uniqueItems:
|
||||
description: section 5.12
|
||||
type: boolean
|
||||
type: object
|
||||
jsonschema.Definitions:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
type: object
|
||||
jsonschema.Type:
|
||||
properties:
|
||||
@@ -353,11 +263,14 @@ definitions:
|
||||
description: RFC draft-wright-json-schema-00
|
||||
type: string
|
||||
additionalItems:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.9
|
||||
type: integer
|
||||
additionalProperties:
|
||||
description: section 5.18
|
||||
type: string
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
allOf:
|
||||
description: section 5.22
|
||||
items:
|
||||
@@ -373,12 +286,13 @@ definitions:
|
||||
type: string
|
||||
default:
|
||||
description: section 6.2
|
||||
type: object
|
||||
definitions:
|
||||
$ref: '#/definitions/jsonschema.Definitions'
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Definitions'
|
||||
description: section 5.26
|
||||
type: object
|
||||
dependencies:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.19
|
||||
type: object
|
||||
description:
|
||||
@@ -386,8 +300,7 @@ definitions:
|
||||
type: string
|
||||
enum:
|
||||
description: section 5.20
|
||||
items:
|
||||
type: object
|
||||
items: {}
|
||||
type: array
|
||||
exclusiveMaximum:
|
||||
description: section 5.3
|
||||
@@ -399,8 +312,9 @@ definitions:
|
||||
description: section 7
|
||||
type: string
|
||||
items:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.9
|
||||
type: integer
|
||||
maxItems:
|
||||
description: section 5.10
|
||||
type: integer
|
||||
@@ -414,8 +328,9 @@ definitions:
|
||||
description: section 5.2
|
||||
type: integer
|
||||
media:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: RFC draft-wright-json-schema-hyperschema-00, section 4
|
||||
type: integer
|
||||
minItems:
|
||||
description: section 5.11
|
||||
type: integer
|
||||
@@ -432,8 +347,9 @@ definitions:
|
||||
description: RFC draft-wright-json-schema-validation-00, section 5
|
||||
type: integer
|
||||
not:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.25
|
||||
type: integer
|
||||
oneOf:
|
||||
description: section 5.24
|
||||
items:
|
||||
@@ -443,9 +359,13 @@ definitions:
|
||||
description: section 5.8
|
||||
type: string
|
||||
patternProperties:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.17
|
||||
type: object
|
||||
properties:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.16
|
||||
type: object
|
||||
required:
|
||||
@@ -472,11 +392,14 @@ definitions:
|
||||
description: RFC draft-wright-json-schema-00
|
||||
type: string
|
||||
additionalItems:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.9
|
||||
type: integer
|
||||
additionalProperties:
|
||||
description: section 5.18
|
||||
type: string
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
allOf:
|
||||
description: section 5.22
|
||||
items:
|
||||
@@ -492,11 +415,11 @@ definitions:
|
||||
type: string
|
||||
default:
|
||||
description: section 6.2
|
||||
type: object
|
||||
definitions:
|
||||
$ref: '#/definitions/jsonschema.Definitions'
|
||||
type: object
|
||||
dependencies:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.19
|
||||
type: object
|
||||
description:
|
||||
@@ -504,8 +427,7 @@ definitions:
|
||||
type: string
|
||||
enum:
|
||||
description: section 5.20
|
||||
items:
|
||||
type: object
|
||||
items: {}
|
||||
type: array
|
||||
exclusiveMaximum:
|
||||
description: section 5.3
|
||||
@@ -517,8 +439,9 @@ definitions:
|
||||
description: section 7
|
||||
type: string
|
||||
items:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.9
|
||||
type: integer
|
||||
maxItems:
|
||||
description: section 5.10
|
||||
type: integer
|
||||
@@ -532,8 +455,9 @@ definitions:
|
||||
description: section 5.2
|
||||
type: integer
|
||||
media:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: RFC draft-wright-json-schema-hyperschema-00, section 4
|
||||
type: integer
|
||||
minItems:
|
||||
description: section 5.11
|
||||
type: integer
|
||||
@@ -550,8 +474,9 @@ definitions:
|
||||
description: RFC draft-wright-json-schema-validation-00, section 5
|
||||
type: integer
|
||||
not:
|
||||
allOf:
|
||||
- $ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.25
|
||||
type: integer
|
||||
oneOf:
|
||||
description: section 5.24
|
||||
items:
|
||||
@@ -561,9 +486,13 @@ definitions:
|
||||
description: section 5.8
|
||||
type: string
|
||||
patternProperties:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.17
|
||||
type: object
|
||||
properties:
|
||||
additionalProperties:
|
||||
$ref: '#/definitions/jsonschema.Type'
|
||||
description: section 5.16
|
||||
type: object
|
||||
required:
|
||||
@@ -592,40 +521,50 @@ definitions:
|
||||
properties:
|
||||
address:
|
||||
$ref: '#/definitions/structure.AddressConfiguration'
|
||||
type: object
|
||||
endpoints:
|
||||
items:
|
||||
$ref: '#/definitions/structure.EndpointConfig'
|
||||
$ref: '#/definitions/structure.EndpointDescriptor'
|
||||
type: array
|
||||
libVersion:
|
||||
type: string
|
||||
moduleName:
|
||||
type: string
|
||||
requiredModules:
|
||||
items:
|
||||
$ref: '#/definitions/structure.ModuleDependency'
|
||||
type: array
|
||||
version:
|
||||
type: string
|
||||
type: object
|
||||
structure.EndpointConfig:
|
||||
structure.EndpointDescriptor:
|
||||
properties:
|
||||
ignoreOnRouter:
|
||||
type: boolean
|
||||
extra:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
inner:
|
||||
type: boolean
|
||||
path:
|
||||
type: string
|
||||
required:
|
||||
- path
|
||||
userAuthRequired:
|
||||
type: boolean
|
||||
type: object
|
||||
structure.GrpcError:
|
||||
properties:
|
||||
details:
|
||||
items:
|
||||
type: object
|
||||
items: {}
|
||||
type: array
|
||||
errorCode:
|
||||
type: string
|
||||
errorMessage:
|
||||
type: string
|
||||
type: object
|
||||
structure.ModuleDependency:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
required:
|
||||
type: boolean
|
||||
type: object
|
||||
host: localhost:9003
|
||||
info:
|
||||
contact: {}
|
||||
@@ -633,7 +572,7 @@ info:
|
||||
license:
|
||||
name: GNU GPL v3.0
|
||||
title: ISP configuration service
|
||||
version: 2.0.0
|
||||
version: 2.4.1
|
||||
paths:
|
||||
/common_config/compile:
|
||||
post:
|
||||
@@ -647,7 +586,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.CompileConfigsRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -662,8 +600,9 @@ paths:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Если конфиг с таким id существует, то обновляет данные, если нет,
|
||||
то добавляет данные в базу
|
||||
description: |-
|
||||
Если конфиг с таким id существует, то обновляет данные, если нет, то добавляет данные в базу
|
||||
В случае обновления рассылает всем подключенным модулям актуальную конфигурацию
|
||||
parameters:
|
||||
- description: объект для сохранения
|
||||
in: body
|
||||
@@ -671,7 +610,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/entity.CommonConfig'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -703,7 +641,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.ConfigIdRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -749,7 +686,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.ConfigIdRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -764,8 +700,9 @@ paths:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Если конфиг с таким id существует, то обновляет данные, если нет,
|
||||
то добавляет данные в базу
|
||||
description: |-
|
||||
Если конфиг с таким id существует, то обновляет данные, если нет, то добавляет данные в базу
|
||||
В случае обновления рассылает всем подключенным модулям актуальную конфигурацию
|
||||
parameters:
|
||||
- description: объект для сохранения
|
||||
in: body
|
||||
@@ -773,7 +710,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.CreateUpdateConfigRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -824,6 +760,36 @@ paths:
|
||||
summary: Метод удаления объектов конфигурации по идентификаторам
|
||||
tags:
|
||||
- Конфигурация
|
||||
/config/delete_version:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Возвращает количество удаленных версий
|
||||
parameters:
|
||||
- description: id версии конфигурации
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.ConfigIdRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/domain.DeleteResponse'
|
||||
"400":
|
||||
description: если не указан массив идентификаторов
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Метод удаления версии конфигурации
|
||||
tags:
|
||||
- Конфигурация
|
||||
/config/get_active_config_by_module_name:
|
||||
post:
|
||||
consumes:
|
||||
@@ -836,7 +802,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.GetByModuleNameRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -855,6 +820,105 @@ paths:
|
||||
summary: Метод получения объекта конфигурации по названию модуля
|
||||
tags:
|
||||
- Конфигурация
|
||||
/config/get_all_version:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Возвращает предыдущие версии конфигураций
|
||||
parameters:
|
||||
- description: id конфигурации
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.ConfigIdRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/entity.VersionConfig'
|
||||
type: array
|
||||
"400":
|
||||
description: если не указан массив идентификаторов
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Метод получение старых версий конфигурации
|
||||
tags:
|
||||
- Конфигурация
|
||||
/config/get_config_by_id:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Возвращает актуальную версию конфигурации без дополнительного содержимого
|
||||
(ConfigData)
|
||||
parameters:
|
||||
- description: id конфигурации
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.ConfigIdRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/entity.Config'
|
||||
"400":
|
||||
description: если не указан идентификатор конфигурации
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Метод получение актуальной конфигурации конфигурации
|
||||
tags:
|
||||
- Конфигурация
|
||||
/config/get_configs_by_module_id:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Возвращает список конфиграции по ID модуля
|
||||
parameters:
|
||||
- description: ID модуля
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.GetByModuleIdRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/domain.ConfigModuleInfo'
|
||||
type: array
|
||||
"400":
|
||||
description: если идентификатор не указан
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"404":
|
||||
description: если конфигурация не найдена
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Метод получения списка конфигураций по ID модуля
|
||||
tags:
|
||||
- Конфигурация
|
||||
/config/mark_config_as_active:
|
||||
post:
|
||||
consumes:
|
||||
@@ -868,7 +932,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.ConfigIdRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@@ -887,6 +950,29 @@ paths:
|
||||
summary: Метод активации конфигурации для модуля
|
||||
tags:
|
||||
- Конфигурация
|
||||
/module/broadcast_event:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: событие
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.BroadcastEventRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Метод отправки события всем подключенным модулям
|
||||
tags:
|
||||
- Модули
|
||||
/module/delete_module:
|
||||
post:
|
||||
consumes:
|
||||
@@ -915,6 +1001,35 @@ paths:
|
||||
summary: Метод удаления объектов модулей по идентификаторам
|
||||
tags:
|
||||
- Модули
|
||||
/module/get_by_name:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: название модуля
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.GetByModuleNameRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/entity.Module'
|
||||
"404":
|
||||
description: модуль с указанным названием не найден
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/structure.GrpcError'
|
||||
summary: Метод получения модуля по имени
|
||||
tags:
|
||||
- Модули
|
||||
/module/get_modules_info:
|
||||
post:
|
||||
consumes:
|
||||
@@ -966,7 +1081,6 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/domain.GetByModuleIdRequest'
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
|
||||
+11
-1
@@ -1,6 +1,10 @@
|
||||
package domain
|
||||
|
||||
import "isp-config-service/entity"
|
||||
import (
|
||||
json2 "encoding/json"
|
||||
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
type ConfigIdRequest struct {
|
||||
Id string `json:"id" valid:"required~Required"`
|
||||
@@ -19,6 +23,12 @@ type GetByModuleNameRequest struct {
|
||||
ModuleName string `valid:"required~Required"`
|
||||
}
|
||||
|
||||
type BroadcastEventRequest struct {
|
||||
ModuleNames []string `valid:"required~Required"`
|
||||
Event string `valid:"required~Required"`
|
||||
Payload json2.RawMessage
|
||||
}
|
||||
|
||||
type CreateUpdateConfigRequest struct {
|
||||
entity.Config
|
||||
Unsafe bool
|
||||
|
||||
+15
-7
@@ -1,10 +1,11 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/config/schema"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"isp-config-service/entity"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/config/schema"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
type DeleteResponse struct {
|
||||
@@ -18,19 +19,26 @@ type ModuleInfo struct {
|
||||
CreatedAt time.Time
|
||||
LastConnectedAt time.Time
|
||||
LastDisconnectedAt time.Time
|
||||
Configs []ConfigModuleInfo `json:",omitempty"`
|
||||
ConfigSchema *schema.Schema `json:",omitempty"`
|
||||
Status []Connection `json:",omitempty"`
|
||||
Configs []ConfigModuleInfo
|
||||
ConfigSchema *schema.Schema
|
||||
Status []Connection
|
||||
RequiredModules []ModuleDependency
|
||||
}
|
||||
|
||||
type Connection struct {
|
||||
LibVersion string
|
||||
Version string
|
||||
Address structure.AddressConfiguration
|
||||
Endpoints []structure.EndpointConfig `json:",omitempty"`
|
||||
Endpoints []structure.EndpointDescriptor
|
||||
EstablishedAt time.Time
|
||||
}
|
||||
|
||||
type ModuleDependency struct {
|
||||
Id string
|
||||
Name string
|
||||
Required bool
|
||||
}
|
||||
|
||||
type CommonConfigLinks map[string][]string
|
||||
|
||||
type CompiledConfigResponse map[string]interface{}
|
||||
|
||||
+16
-12
@@ -1,38 +1,42 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/config/schema"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/config/schema"
|
||||
)
|
||||
|
||||
type ConfigData map[string]interface{}
|
||||
|
||||
type Config struct {
|
||||
tableName string `sql:"?db_schema.configs" json:"-"`
|
||||
//nolint
|
||||
tableName string `pg:"?db_schema.configs" json:"-"`
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name" valid:"required~Required"`
|
||||
CommonConfigs []string `json:"commonConfigs" pg:",array"`
|
||||
Description string `json:"description"`
|
||||
ModuleId string `json:"moduleId" valid:"required~Required"`
|
||||
Version int32 `json:"version" sql:",null"`
|
||||
Active bool `json:"active" sql:",null"`
|
||||
CreatedAt time.Time `json:"createdAt" sql:",null"`
|
||||
UpdatedAt time.Time `json:"updatedAt" sql:",null"`
|
||||
Data ConfigData `json:"data" sql:",notnull"`
|
||||
Version int32 `json:"version" pg:",null"`
|
||||
Active bool `json:"active" pg:",null"`
|
||||
CreatedAt time.Time `json:"createdAt" pg:",null"`
|
||||
UpdatedAt time.Time `json:"updatedAt" pg:",null"`
|
||||
Data ConfigData `json:"data,omitempty" pg:",notnull"`
|
||||
}
|
||||
|
||||
type CommonConfig struct {
|
||||
tableName string `sql:"?db_schema.common_configs" json:"-"`
|
||||
//nolint
|
||||
tableName string `pg:"?db_schema.common_configs" json:"-"`
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name" valid:"required~Required"`
|
||||
Description string `json:"description"`
|
||||
CreatedAt time.Time `json:"createdAt" sql:",null"`
|
||||
UpdatedAt time.Time `json:"updatedAt" sql:",null"`
|
||||
Data ConfigData `json:"data" sql:",notnull"`
|
||||
CreatedAt time.Time `json:"createdAt" pg:",null"`
|
||||
UpdatedAt time.Time `json:"updatedAt" pg:",null"`
|
||||
Data ConfigData `json:"data" pg:",notnull"`
|
||||
}
|
||||
|
||||
type ConfigSchema struct {
|
||||
tableName string `sql:"?db_schema.config_schemas" json:"-"`
|
||||
//nolint
|
||||
tableName string `pg:"?db_schema.config_schemas" json:"-"`
|
||||
Id string `json:"id"`
|
||||
Version string
|
||||
ModuleId string
|
||||
|
||||
+3
-2
@@ -3,10 +3,11 @@ package entity
|
||||
import "time"
|
||||
|
||||
type Module struct {
|
||||
tableName string `sql:"?db_schema.modules" json:"-"`
|
||||
//nolint
|
||||
tableName string `pg:"?db_schema.modules" json:"-"`
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name" valid:"required~Required"`
|
||||
CreatedAt time.Time `json:"createdAt" sql:",null"`
|
||||
CreatedAt time.Time `json:"createdAt" pg:",null"`
|
||||
LastConnectedAt time.Time `json:"lastConnectedAt"`
|
||||
LastDisconnectedAt time.Time `json:"lastDisconnectedAt"`
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type VersionConfig struct {
|
||||
//nolint
|
||||
tableName string `pg:"?db_schema.version_config" json:"-"`
|
||||
Id string
|
||||
ConfigId string
|
||||
ConfigVersion int32
|
||||
Data ConfigData `json:"data,omitempty" pg:",notnull"`
|
||||
CreatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
module isp-config-service
|
||||
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
|
||||
github.com/cenkalti/backoff/v4 v4.2.0
|
||||
github.com/go-pg/pg/v9 v9.2.1
|
||||
github.com/hashicorp/raft v1.3.11
|
||||
github.com/hashicorp/raft-boltdb/v2 v2.2.2
|
||||
github.com/integration-system/bellows v1.0.1
|
||||
github.com/integration-system/isp-etp-go/v2 v2.1.3
|
||||
github.com/integration-system/isp-lib/v2 v2.11.0
|
||||
github.com/integration-system/isp-log v1.2.0
|
||||
github.com/integration-system/net-mux v1.0.1
|
||||
github.com/json-iterator/go v1.1.12
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
google.golang.org/grpc v1.51.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||
github.com/armon/go-metrics v0.4.1 // indirect
|
||||
github.com/boltdb/bolt v1.3.1 // indirect
|
||||
github.com/buaazp/fasthttprouter v0.1.1 // indirect
|
||||
github.com/codemodus/kace v0.5.1 // indirect
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.0 // indirect
|
||||
github.com/go-openapi/spec v0.20.7 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/go-pg/zerochecker v0.2.0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/gorilla/websocket v1.4.2 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-hclog v1.3.1 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-msgpack v0.5.5 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.1 // indirect
|
||||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f // indirect
|
||||
github.com/integration-system/jsonschema v1.0.1 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.15.12 // indirect
|
||||
github.com/lib/pq v1.10.7 // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.16 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/onsi/ginkgo v1.15.0 // indirect
|
||||
github.com/onsi/gomega v1.10.5 // indirect
|
||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
|
||||
github.com/pressly/goose v2.7.0+incompatible // indirect
|
||||
github.com/profefe/profefe v0.0.0-20210412073930-18342f204d75 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/segmentio/asm v1.2.0 // indirect
|
||||
github.com/segmentio/encoding v0.3.6 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/spf13/afero v1.9.3 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.14.0 // indirect
|
||||
github.com/subosito/gotenv v1.4.1 // indirect
|
||||
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect
|
||||
github.com/swaggo/http-swagger v1.3.3 // indirect
|
||||
github.com/swaggo/swag v1.8.8 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.43.0 // indirect
|
||||
github.com/vmihailenco/bufpool v0.1.11 // indirect
|
||||
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
|
||||
github.com/vmihailenco/tagparser v0.1.2 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
go.etcd.io/bbolt v1.3.6 // indirect
|
||||
golang.org/x/crypto v0.3.0 // indirect
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
|
||||
golang.org/x/net v0.2.0 // indirect
|
||||
golang.org/x/sys v0.2.0 // indirect
|
||||
golang.org/x/text v0.4.0 // indirect
|
||||
golang.org/x/tools v0.3.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
mellium.im/sasl v0.3.0 // indirect
|
||||
nhooyr.io/websocket v1.8.7 // indirect
|
||||
)
|
||||
@@ -0,0 +1,876 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||
cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko=
|
||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||
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/ClickHouse/clickhouse-go v1.4.0/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
|
||||
github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
|
||||
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
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/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
|
||||
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg=
|
||||
github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
|
||||
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
|
||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/aws/aws-sdk-go v1.29.9/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
|
||||
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
|
||||
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
|
||||
github.com/buaazp/fasthttprouter v0.1.1 h1:4oAnN0C3xZjylvZJdP35cxfclyn4TYkW6Y+DSvS+h8Q=
|
||||
github.com/buaazp/fasthttprouter v0.1.1/go.mod h1:h/Ap5oRVLeItGKTVBb+heQPks+HdIUtGmI4H5WCYijM=
|
||||
github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
|
||||
github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/codemodus/kace v0.5.1 h1:4OCsBlE2c/rSJo375ggfnucv9eRzge/U5LrrOZd47HA=
|
||||
github.com/codemodus/kace v0.5.1/go.mod h1:coddaHoX1ku1YFSe4Ip0mL9kQjJvKkzb9CfIdG1YR04=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
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/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4=
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
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.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||
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.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
|
||||
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
|
||||
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
|
||||
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-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
|
||||
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||
github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
|
||||
github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
|
||||
github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI=
|
||||
github.com/go-openapi/spec v0.20.7/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
|
||||
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
github.com/go-pg/pg/v9 v9.2.1 h1:4rWNJkj+aPuDFqgieTzNhHBuYaXREh3yaB9NlBerFys=
|
||||
github.com/go-pg/pg/v9 v9.2.1/go.mod h1:fG8qbL+ei4e/fCZLHK+Z+/7b9B+pliZtbpaucG4/YNQ=
|
||||
github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
|
||||
github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
||||
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
||||
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
|
||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
|
||||
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
|
||||
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
||||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||
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/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
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/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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.4.1/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.1/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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
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/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
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/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
||||
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/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo=
|
||||
github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
|
||||
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
|
||||
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/raft v1.1.0/go.mod h1:4Ak7FSPnuvmb0GV6vgIAJ4vYT4bek9bb6Q+7HVbyzqM=
|
||||
github.com/hashicorp/raft v1.3.11 h1:p3v6gf6l3S797NnK5av3HcczOC1T5CLoaRvg0g9ys4A=
|
||||
github.com/hashicorp/raft v1.3.11/go.mod h1:J8naEwc6XaaCfts7+28whSeRvCqTd6e20BlCU3LtEO4=
|
||||
github.com/hashicorp/raft-boltdb v0.0.0-20210409134258-03c10cc3d4ea h1:RxcPJuutPRM8PUOyiweMmkuNO+RJyfy2jds2gfvgNmU=
|
||||
github.com/hashicorp/raft-boltdb v0.0.0-20210409134258-03c10cc3d4ea/go.mod h1:qRd6nFJYYS6Iqnc/8HcUmko2/2Gw8qTFEmxDLii6W5I=
|
||||
github.com/hashicorp/raft-boltdb/v2 v2.2.2 h1:rlkPtOllgIcKLxVT4nutqlTH2NRFn+tO1wwZk/4Dxqw=
|
||||
github.com/hashicorp/raft-boltdb/v2 v2.2.2/go.mod h1:N8YgaZgNJLpZC+h+by7vDu5rzsRgONThTEeUS3zWbfY=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/integration-system/bellows v1.0.1 h1:7g1lhD/6EcvsSo9iuiFqw98XGS78Sko6kUKPzfte/SY=
|
||||
github.com/integration-system/bellows v1.0.1/go.mod h1:qHPg1ptN3AHHr0f/wvoicfA2LOCprOyrbXnIa5QIRe0=
|
||||
github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f h1:52UOJguw5yqe1y2JjmyVxGcZf3kv2BQeUodR363MkiQ=
|
||||
github.com/integration-system/go-cmp v0.0.0-20190131081942-ac5582987a2f/go.mod h1:w+dmaWojuIwNujSYg6qt1wKHhSdorLOivCEl/XuLzbM=
|
||||
github.com/integration-system/isp-etp-go/v2 v2.1.3 h1:vcHP/PE7p1G3rxqoVKrKtXzoSxFA4ryxigd+zPkAb3w=
|
||||
github.com/integration-system/isp-etp-go/v2 v2.1.3/go.mod h1:ZpB+FIH3hy7md+f8ylVSQx5zwZVjczhkc45f1B2z9nw=
|
||||
github.com/integration-system/isp-lib/v2 v2.11.0 h1:5vlgSgTvPY2Q3/ucTZ/572GPeJsVGqz+y74VhKZ2LKU=
|
||||
github.com/integration-system/isp-lib/v2 v2.11.0/go.mod h1:9u47SFT0sTAZM5rkqeV88HNTiExgZWrRFoAQpjC68Wc=
|
||||
github.com/integration-system/isp-log v1.2.0 h1:kYAP8LH2ttDk9lElKNoxGvLAKh94kesfnAkQVCjbc5s=
|
||||
github.com/integration-system/isp-log v1.2.0/go.mod h1:ri19IsCkLbxPWS1KFNHlLpg88IdYF5EHm8JH+xULLQ0=
|
||||
github.com/integration-system/jsonschema v1.0.1 h1:nR78BEDG9djX2uXQ1YP66a/9yQOMmp2HFmw8VPUdAa8=
|
||||
github.com/integration-system/jsonschema v1.0.1/go.mod h1:EoqDH7RmC8Epg5EgjboIxDo7Udv3WX2exGqtIVB4hI0=
|
||||
github.com/integration-system/net-mux v1.0.1 h1:UKHdt1UxNJXwroeLdhYQeUah/aizcqx6hS1SOdfx7pg=
|
||||
github.com/integration-system/net-mux v1.0.1/go.mod h1:0iEskyZB58/VwtFu8BATYMmPse2ZU9WWv6agidMEAs0=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
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.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
|
||||
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
|
||||
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
|
||||
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/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/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/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.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
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/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
|
||||
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
|
||||
github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pressly/goose v2.7.0+incompatible h1:PWejVEv07LCerQEzMMeAtjuyCKbyprZ/LBa6K5P0OCQ=
|
||||
github.com/pressly/goose v2.7.0+incompatible/go.mod h1:m+QHWCqxR3k8D9l7qfzuC/djtlfzxr34mozWDYEu1z8=
|
||||
github.com/profefe/profefe v0.0.0-20210412073930-18342f204d75 h1:L2ySMPFVEjnQA+CcPdG4/j+R+7tH95MtB3Y0Wynktes=
|
||||
github.com/profefe/profefe v0.0.0-20210412073930-18342f204d75/go.mod h1:64I4nyfqy58IxcBlDQ+SgtwdAF0m9yVxfCiVKVwag/k=
|
||||
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 v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
|
||||
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
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.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
|
||||
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.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/prometheus/procfs v0.0.9/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rs/xid v1.2.2-0.20200205151950-d13a6085d55c/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg=
|
||||
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/segmentio/encoding v0.1.15/go.mod h1:RWhr02uzMB9gQC1x+MfYxedtmBibb9cZ6Vv9VxRSSbw=
|
||||
github.com/segmentio/encoding v0.3.6 h1:E6lVLyDPseWEulBmCmAKPanDd3jiyGDo5gMcugCRwZQ=
|
||||
github.com/segmentio/encoding v0.3.6/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
|
||||
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
||||
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
|
||||
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.3/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.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU=
|
||||
github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
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/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
|
||||
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
||||
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY=
|
||||
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
|
||||
github.com/swaggo/http-swagger v1.3.3 h1:Hu5Z0L9ssyBLofaama21iYaF2VbWyA8jdohaaCGpHsc=
|
||||
github.com/swaggo/http-swagger v1.3.3/go.mod h1:sE+4PjD89IxMPm77FnkDz0sdO+p5lbXzrVWT6OTVVGo=
|
||||
github.com/swaggo/swag v1.8.8 h1:/GgJmrJ8/c0z4R4hoEPZ5UeEhVGdvsII4JbVDLbR7Xc=
|
||||
github.com/swaggo/swag v1.8.8/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk=
|
||||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
||||
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
|
||||
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=
|
||||
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.43.0 h1:Gy4sb32C98fbzVWZlTM1oTMdLWGyvxR03VhM6cBIU4g=
|
||||
github.com/valyala/fasthttp v1.43.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY=
|
||||
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||
github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
|
||||
github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
|
||||
github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U=
|
||||
github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
|
||||
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
|
||||
github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc=
|
||||
github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
|
||||
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
|
||||
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.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
|
||||
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A=
|
||||
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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-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/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
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/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/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
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.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-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-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/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-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/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-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-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73/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-20201031054903-ff519b6c9102/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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
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=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/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-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/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=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/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-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/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-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
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/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
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-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
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-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||
golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
|
||||
golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
|
||||
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=
|
||||
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
|
||||
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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
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=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
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/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||
google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo=
|
||||
google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.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/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/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-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
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=
|
||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
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-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c=
|
||||
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
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/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=
|
||||
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
|
||||
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/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
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/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.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/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
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/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ=
|
||||
mellium.im/sasl v0.3.0 h1:0qoaTCTo5Py7u/g0cBIQZcMOgG/5LM71nshbXwznBh8=
|
||||
mellium.im/sasl v0.3.0/go.mod h1:xm59PUYpZHhgQ9ZqoJ5QaCqzWMi8IeS49dhp6plPCzw=
|
||||
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
|
||||
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
+18
-5
@@ -1,7 +1,8 @@
|
||||
//nolint:lll
|
||||
package helper
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"isp-config-service/controller"
|
||||
"isp-config-service/domain"
|
||||
"isp-config-service/entity"
|
||||
@@ -9,14 +10,20 @@ import (
|
||||
|
||||
type Handlers struct {
|
||||
// ===== MODULE =====
|
||||
DeleteModules func(identities []string) (*domain.DeleteResponse, error) `method:"delete_module" group:"module" inner:"true"`
|
||||
GetModulesInfo func() ([]domain.ModuleInfo, error) `method:"get_modules_info" group:"module" inner:"true"`
|
||||
DeleteModules func(identities []string) (*domain.DeleteResponse, error) `method:"delete_module" group:"module" inner:"true"`
|
||||
GetModulesInfo func() ([]domain.ModuleInfo, error) `method:"get_modules_info" group:"module" inner:"true"`
|
||||
GetModuleByName func(req domain.GetByModuleNameRequest) (*entity.Module, error) `method:"get_by_name" group:"module" inner:"true"`
|
||||
BroadcastEvent func(req domain.BroadcastEventRequest) error `method:"broadcast_event" group:"module" inner:"true"`
|
||||
|
||||
// ===== CONFIG =====
|
||||
GetActiveConfigByModuleName func(request domain.GetByModuleNameRequest) (*entity.Config, error) `method:"get_active_config_by_module_name" group:"config" inner:"true"`
|
||||
GetConfigsByModuleId func(request domain.GetByModuleIdRequest) ([]domain.ConfigModuleInfo, error) `method:"get_configs_by_module_id" group:"config" inner:"true"`
|
||||
CreateUpdateConfig func(config domain.CreateUpdateConfigRequest) (*domain.ConfigModuleInfo, error) `method:"create_update_config" group:"config" inner:"true"`
|
||||
MarkConfigAsActive func(identity domain.ConfigIdRequest) (*entity.Config, error) `method:"mark_config_as_active" group:"config" inner:"true"`
|
||||
DeleteConfig func(identities []string) (*domain.DeleteResponse, error) `method:"delete_config" group:"config" inner:"true"`
|
||||
DeleteVersion func(identity domain.ConfigIdRequest) (*domain.DeleteResponse, error) `method:"delete_version" group:"config" inner:"true"`
|
||||
GetAllVersion func(identity domain.ConfigIdRequest) ([]entity.VersionConfig, error) `method:"get_all_version" group:"config" inner:"true"`
|
||||
GetConfigByID func(identity domain.ConfigIdRequest) (entity.Config, error) `method:"get_config_by_id" group:"config" inner:"true"`
|
||||
|
||||
// ===== COMMON CONFIG =====
|
||||
GetCommonConfigs func(identities []string) []entity.CommonConfig `method:"get_configs" group:"common_config" inner:"true"`
|
||||
@@ -34,13 +41,19 @@ type Handlers struct {
|
||||
|
||||
func GetHandlers() *Handlers {
|
||||
return &Handlers{
|
||||
DeleteModules: controller.Module.DeleteModules,
|
||||
GetModulesInfo: controller.Module.GetModulesAggregatedInfo,
|
||||
DeleteModules: controller.Module.DeleteModules,
|
||||
GetModulesInfo: controller.Module.GetModulesAggregatedInfo,
|
||||
GetModuleByName: controller.Module.GetModuleByName,
|
||||
BroadcastEvent: controller.Module.BroadcastEvent,
|
||||
|
||||
GetActiveConfigByModuleName: controller.Config.GetActiveConfigByModuleName,
|
||||
GetConfigsByModuleId: controller.Config.GetConfigsByModuleId,
|
||||
CreateUpdateConfig: controller.Config.CreateUpdateConfig,
|
||||
MarkConfigAsActive: controller.Config.MarkConfigAsActive,
|
||||
DeleteConfig: controller.Config.DeleteConfigs,
|
||||
DeleteVersion: controller.Config.DeleteConfigVersion,
|
||||
GetAllVersion: controller.Config.GetAllVersion,
|
||||
GetConfigByID: controller.Config.GetConfigById,
|
||||
|
||||
GetCommonConfigs: controller.CommonConfig.GetConfigs,
|
||||
CreateUpdateCommonConfig: controller.CommonConfig.CreateUpdateConfig,
|
||||
|
||||
+4
-3
@@ -1,13 +1,14 @@
|
||||
package holder
|
||||
|
||||
import (
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"isp-config-service/cluster"
|
||||
"net/http"
|
||||
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"isp-config-service/cluster"
|
||||
)
|
||||
|
||||
var (
|
||||
ClusterClient *cluster.Client
|
||||
EtpServer etp.Server
|
||||
HttpServer *http.Server
|
||||
HTTPServer *http.Server
|
||||
)
|
||||
@@ -3,14 +3,22 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/integration-system/isp-etp-go"
|
||||
"github.com/integration-system/isp-lib/backend"
|
||||
"github.com/integration-system/isp-lib/bootstrap"
|
||||
"github.com/integration-system/isp-lib/config"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/backend"
|
||||
"github.com/integration-system/isp-lib/v2/bootstrap"
|
||||
"github.com/integration-system/isp-lib/v2/config"
|
||||
"github.com/integration-system/isp-lib/v2/metric"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"github.com/thecodeteam/goodbye"
|
||||
mux "github.com/integration-system/net-mux"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/conf"
|
||||
@@ -18,15 +26,11 @@ import (
|
||||
"isp-config-service/helper"
|
||||
"isp-config-service/holder"
|
||||
"isp-config-service/model"
|
||||
"isp-config-service/mux"
|
||||
"isp-config-service/raft"
|
||||
"isp-config-service/service"
|
||||
"isp-config-service/store"
|
||||
"isp-config-service/store/state"
|
||||
"isp-config-service/subs"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -36,10 +40,8 @@ const (
|
||||
|
||||
var (
|
||||
version = "0.1.0"
|
||||
date = "undefined"
|
||||
|
||||
shutdownChan = make(chan struct{})
|
||||
muxer mux.Mux
|
||||
muxer mux.Mux
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -50,21 +52,23 @@ func init() {
|
||||
}
|
||||
|
||||
// @title ISP configuration service
|
||||
// @version 2.0.0
|
||||
// @version 2.4.1
|
||||
// @description Сервис управления конфигурацией модулей ISP кластера
|
||||
|
||||
// @license.name GNU GPL v3.0
|
||||
|
||||
// @host localhost:9003
|
||||
// @BasePath /api/config
|
||||
|
||||
//go:generate swag init --parseDependency
|
||||
//go:generate rm -f docs/swagger.json
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
cfg := config.Get().(*conf.Configuration)
|
||||
handlers := helper.GetHandlers()
|
||||
endpoints := backend.GetEndpoints(cfg.ModuleName, handlers)
|
||||
address := cfg.GrpcOuterAddress
|
||||
if address.IP == "" {
|
||||
ip, err := getOutboundIp()
|
||||
ip, err := getOutboundIP()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -78,6 +82,14 @@ func main() {
|
||||
Address: address,
|
||||
}
|
||||
|
||||
connectionReadLimit := defaultWsConnectionReadLimit
|
||||
if cfg.WS.WsConnectionReadLimitKB > 0 {
|
||||
//nolint:gomnd
|
||||
connectionReadLimit = cfg.WS.WsConnectionReadLimitKB << 10
|
||||
}
|
||||
cluster.WsConnectionReadLimit = connectionReadLimit
|
||||
|
||||
cfg.Database.Password = fmt.Sprintf("%s%s", cfg.Database.Password, os.Getenv("DB_PASSPART"))
|
||||
model.DbClient.ReceiveConfiguration(cfg.Database)
|
||||
|
||||
httpListener, raftListener, err := initMultiplexer(cfg.WS.Rest)
|
||||
@@ -86,14 +98,14 @@ func main() {
|
||||
}
|
||||
|
||||
_, raftStore := initRaft(raftListener, cfg.Cluster, declaration)
|
||||
initWebsocket(ctx, cfg.WS.WsConnectionReadLimitKB, httpListener, raftStore)
|
||||
initWebsocket(connectionReadLimit, httpListener, raftStore)
|
||||
initGrpc(cfg.WS.Grpc, raftStore)
|
||||
|
||||
defer goodbye.Exit(ctx, -1)
|
||||
goodbye.Notify(ctx)
|
||||
goodbye.Register(onShutdown)
|
||||
metric.InitProfiling(cfg.ModuleName)
|
||||
metric.InitCollectors(cfg.Metrics, structure.MetricConfiguration{})
|
||||
metric.InitHttpServer(cfg.Metrics)
|
||||
|
||||
<-shutdownChan
|
||||
gracefulShutdown()
|
||||
}
|
||||
|
||||
func initMultiplexer(addressConfiguration structure.AddressConfiguration) (net.Listener, net.Listener, error) {
|
||||
@@ -118,16 +130,12 @@ func initMultiplexer(addressConfiguration structure.AddressConfiguration) (net.L
|
||||
return httpListener, raftListener, nil
|
||||
}
|
||||
|
||||
func initWebsocket(ctx context.Context, wsConnectionReadLimitKB int64, listener net.Listener, raftStore *store.Store) {
|
||||
connectionReadLimit := defaultWsConnectionReadLimit
|
||||
if wsConnectionReadLimitKB > 0 {
|
||||
connectionReadLimit = wsConnectionReadLimitKB << 10
|
||||
}
|
||||
func initWebsocket(connectionReadLimit int64, listener net.Listener, raftStore *store.Store) {
|
||||
etpConfig := etp.ServerConfig{
|
||||
InsecureSkipVerify: true,
|
||||
ConnectionReadLimit: connectionReadLimit,
|
||||
}
|
||||
etpServer := etp.NewServer(ctx, etpConfig)
|
||||
etpServer := etp.NewServer(context.Background(), etpConfig)
|
||||
subs.NewSocketEventHandler(etpServer, raftStore).SubscribeAll()
|
||||
|
||||
mux := http.NewServeMux()
|
||||
@@ -139,10 +147,11 @@ func initWebsocket(ctx context.Context, wsConnectionReadLimitKB int64, listener
|
||||
}
|
||||
}()
|
||||
holder.EtpServer = etpServer
|
||||
holder.HttpServer = httpServer
|
||||
holder.HTTPServer = httpServer
|
||||
}
|
||||
|
||||
func initRaft(listener net.Listener, clusterCfg conf.ClusterConfiguration, declaration structure.BackendDeclaration) (*cluster.Client, *store.Store) {
|
||||
func initRaft(listener net.Listener, clusterCfg conf.ClusterConfiguration,
|
||||
declaration structure.BackendDeclaration) (*cluster.Client, *store.Store) {
|
||||
raftState, err := store.NewStateFromRepository()
|
||||
if err != nil {
|
||||
log.Fatal(codes.RestoreFromRepositoryError, err)
|
||||
@@ -155,18 +164,18 @@ func initRaft(listener net.Listener, clusterCfg conf.ClusterConfiguration, decla
|
||||
return nil, nil
|
||||
}
|
||||
clusterClient := cluster.NewRaftClusterClient(r, declaration, func(address string) {
|
||||
raftStore.VisitState(func(s state.WritableState) {
|
||||
go raftStore.VisitState(func(s state.WritableState) {
|
||||
cfg := config.Get().(*conf.Configuration)
|
||||
addr, err := net.ResolveTCPAddr("tcp", address)
|
||||
if err != nil {
|
||||
panic(err) // must never occured
|
||||
panic(err) // must never occurred
|
||||
}
|
||||
port := cfg.GrpcOuterAddress.Port
|
||||
addressConfiguration := structure.AddressConfiguration{Port: port, IP: addr.IP.String()}
|
||||
back := structure.BackendDeclaration{ModuleName: cfg.ModuleName, Address: addressConfiguration}
|
||||
log.WithMetadata(map[string]interface{}{"declaration": back}).
|
||||
Debugf(0, "delete disconnected leader's declaration")
|
||||
service.ClusterMeshService.HandleDeleteBackendDeclarationCommand(back, s)
|
||||
Infof(codes.LeaderManualDeleteLeader, "manually delete disconnected leader's declaration")
|
||||
service.ClusterMesh.HandleDeleteBackendDeclarationCommand(back, s)
|
||||
})
|
||||
})
|
||||
holder.ClusterClient = clusterClient
|
||||
@@ -190,17 +199,45 @@ func initGrpc(bindAddress structure.AddressConfiguration, raftStore *store.Store
|
||||
backend.StartBackendGrpcServer(bindAddress, defaultService)
|
||||
}
|
||||
|
||||
func onShutdown(ctx context.Context, _ os.Signal) {
|
||||
defer close(shutdownChan)
|
||||
func gracefulShutdown() {
|
||||
const (
|
||||
gracefulTimeout = 10 * time.Second
|
||||
terminateTimeout = 11 * time.Second
|
||||
)
|
||||
|
||||
signalsCh := make(chan os.Signal, 1)
|
||||
signal.Notify(signalsCh, os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT)
|
||||
sig := <-signalsCh
|
||||
log.Infof(0, "received signal '%s'", sig)
|
||||
|
||||
finishedCh := make(chan struct{})
|
||||
go func() {
|
||||
select {
|
||||
case <-time.After(terminateTimeout):
|
||||
log.Fatal(0, "exit timeout reached: terminating")
|
||||
case <-finishedCh:
|
||||
// ok
|
||||
case sig := <-signalsCh:
|
||||
log.Fatalf(0, "received duplicate exit signal '%s': terminating", sig)
|
||||
}
|
||||
}()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), gracefulTimeout)
|
||||
defer cancel()
|
||||
onShutdown(ctx)
|
||||
finishedCh <- struct{}{}
|
||||
log.Info(0, "application exited normally")
|
||||
}
|
||||
|
||||
func onShutdown(ctx context.Context) {
|
||||
backend.StopGrpcServer()
|
||||
holder.EtpServer.Close()
|
||||
|
||||
if err := holder.HttpServer.Shutdown(ctx); err != nil {
|
||||
if err := holder.HTTPServer.Shutdown(ctx); err != nil {
|
||||
log.Warnf(codes.ShutdownHttpServerError, "http server shutdown err: %v", err)
|
||||
} else {
|
||||
log.Info(codes.ShutdownHttpServerInfo, "http server shutdown success")
|
||||
}
|
||||
holder.EtpServer.Close()
|
||||
|
||||
if err := holder.ClusterClient.Shutdown(); err != nil {
|
||||
log.Warnf(codes.RaftShutdownError, "raft shutdown err: %v", err)
|
||||
@@ -208,10 +245,14 @@ func onShutdown(ctx context.Context, _ os.Signal) {
|
||||
log.Info(codes.RaftShutdownInfo, "raft shutdown success")
|
||||
}
|
||||
|
||||
if err := model.DbClient.Close(); err != nil {
|
||||
log.Warnf(0, "database shutdown err: %v", err)
|
||||
}
|
||||
|
||||
_ = muxer.Close()
|
||||
}
|
||||
|
||||
func getOutboundIp() (string, error) {
|
||||
func getOutboundIP() (string, error) {
|
||||
conn, err := net.Dial("udp", "9.9.9.9:80")
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE version_config
|
||||
(
|
||||
id VARCHAR(255) NOT NULL PRIMARY KEY,
|
||||
config_id VARCHAR(255) NOT NULL,
|
||||
config_version INT4 NOT NULL,
|
||||
data JSONB NOT NULL DEFAULT '{}',
|
||||
created_at TIMESTAMP NOT NULL DEFAULT (now() at time zone 'utc')
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE version_config;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE version_config
|
||||
ADD COLUMN IF NOT EXISTS created_at TIMESTAMP NOT NULL DEFAULT (now() at time zone 'utc');
|
||||
|
||||
-- +goose Down
|
||||
|
||||
|
||||
+6
-5
@@ -1,7 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/database"
|
||||
"github.com/integration-system/isp-lib/v2/database"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"github.com/integration-system/isp-log/stdcodes"
|
||||
)
|
||||
@@ -15,8 +15,9 @@ var (
|
||||
log.Fatal(stdcodes.InitializingDbError, err.Error())
|
||||
}),
|
||||
)
|
||||
ConfigRep ConfigRepository = &configRepPg{rxClient: DbClient}
|
||||
CommonConfigRep CommonConfigRepository = &commonConfigRepPg{rxClient: DbClient}
|
||||
SchemaRep SchemaRepository = &schemaRepPg{rxClient: DbClient}
|
||||
ModuleRep ModulesRepository = &modulesRepPg{rxClient: DbClient}
|
||||
ConfigRep ConfigRepository = &configRepPg{rxClient: DbClient}
|
||||
CommonConfigRep CommonConfigRepository = &commonConfigRepPg{rxClient: DbClient}
|
||||
SchemaRep SchemaRepository = &schemaRepPg{rxClient: DbClient}
|
||||
ModuleRep ModulesRepository = &modulesRepPg{rxClient: DbClient}
|
||||
VersionStoreRep VersionConfigRepository = &versionConfigRepPg{rxClient: DbClient}
|
||||
)
|
||||
@@ -1,8 +1,9 @@
|
||||
//nolint: dupl
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/go-pg/pg"
|
||||
"github.com/integration-system/isp-lib/database"
|
||||
"github.com/go-pg/pg/v9"
|
||||
"github.com/integration-system/isp-lib/v2/database"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
|
||||
+3
-2
@@ -1,8 +1,9 @@
|
||||
//nolint:dupl
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/go-pg/pg"
|
||||
"github.com/integration-system/isp-lib/database"
|
||||
"github.com/go-pg/pg/v9"
|
||||
"github.com/integration-system/isp-lib/v2/database"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
|
||||
+3
-2
@@ -1,8 +1,9 @@
|
||||
//nolint:dupl
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/go-pg/pg"
|
||||
"github.com/integration-system/isp-lib/database"
|
||||
"github.com/go-pg/pg/v9"
|
||||
"github.com/integration-system/isp-lib/v2/database"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
|
||||
+3
-2
@@ -1,8 +1,9 @@
|
||||
//nolint:dupl
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/go-pg/pg"
|
||||
"github.com/integration-system/isp-lib/database"
|
||||
"github.com/go-pg/pg/v9"
|
||||
"github.com/integration-system/isp-lib/v2/database"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/go-pg/pg/v9"
|
||||
"github.com/integration-system/isp-lib/v2/database"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
type VersionConfigRepository interface {
|
||||
Snapshot() ([]entity.VersionConfig, error)
|
||||
Upsert(model entity.VersionConfig) (*entity.VersionConfig, error)
|
||||
Delete(identities string) (int, error)
|
||||
}
|
||||
|
||||
type versionConfigRepPg struct {
|
||||
rxClient *database.RxDbClient
|
||||
}
|
||||
|
||||
func (r *versionConfigRepPg) Snapshot() ([]entity.VersionConfig, error) {
|
||||
modules := make([]entity.VersionConfig, 0)
|
||||
err := r.rxClient.Visit(func(db *pg.DB) error {
|
||||
return db.Model(&modules).Select()
|
||||
})
|
||||
return modules, err
|
||||
}
|
||||
|
||||
func (r *versionConfigRepPg) Upsert(module entity.VersionConfig) (*entity.VersionConfig, error) {
|
||||
err := r.rxClient.Visit(func(db *pg.DB) error {
|
||||
_, err := db.Model(&module).
|
||||
OnConflict("(id) DO UPDATE").
|
||||
Returning("*").
|
||||
Insert()
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &module, err
|
||||
}
|
||||
|
||||
func (r *versionConfigRepPg) Delete(id string) (int, error) {
|
||||
var err error
|
||||
var res pg.Result
|
||||
err = r.rxClient.Visit(func(db *pg.DB) error {
|
||||
res, err = db.Model(&entity.VersionConfig{}).
|
||||
Where("id = ?", id).Delete()
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return res.RowsAffected(), err
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package mux
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
|
||||
type Matcher func([]byte) bool
|
||||
|
||||
// Any is a Matcher that matches any connection.
|
||||
func Any() Matcher {
|
||||
return func(_ []byte) bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
var httpMethods = map[string]struct{}{
|
||||
"OPTIONS": {},
|
||||
"HEAD": {},
|
||||
"GET": {},
|
||||
"POST": {},
|
||||
"PUT": {},
|
||||
"PATCH": {},
|
||||
"DELETE": {},
|
||||
"TRACE": {},
|
||||
"CONNECT": {},
|
||||
}
|
||||
|
||||
// HTTP1 only matches the methods in the HTTP request.
|
||||
func HTTP1() Matcher {
|
||||
return func(data []byte) bool {
|
||||
// max length of method
|
||||
l := 7
|
||||
if len(data) < l {
|
||||
l = len(data)
|
||||
}
|
||||
methodB := data[:l]
|
||||
words := bytes.Split(methodB, []byte(" "))
|
||||
if len(words) == 0 {
|
||||
return false
|
||||
}
|
||||
_, ok := httpMethods[string(words[0])]
|
||||
return ok
|
||||
}
|
||||
}
|
||||
-186
@@ -1,186 +0,0 @@
|
||||
package mux
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/integration-system/isp-lib/atomic"
|
||||
"net"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrListenerClosed = errors.New("mux: listener closed")
|
||||
ErrNotMatched = errors.New("mux: connection not matched by a matcher")
|
||||
)
|
||||
|
||||
type Mux interface {
|
||||
Match(Matcher) net.Listener
|
||||
Serve() error
|
||||
OnError(func(error))
|
||||
Close() error
|
||||
}
|
||||
|
||||
type matchersListener struct {
|
||||
matcher Matcher
|
||||
listener *muxListener
|
||||
}
|
||||
|
||||
type mux struct {
|
||||
listener net.Listener
|
||||
ml []matchersListener
|
||||
connBufLen int
|
||||
doneCh chan struct{}
|
||||
errHandler func(error)
|
||||
}
|
||||
|
||||
func (m *mux) Match(matcher Matcher) net.Listener {
|
||||
ml := newMuxListener(m.listener, m.connBufLen)
|
||||
m.ml = append(m.ml, matchersListener{matcher: matcher, listener: ml})
|
||||
return ml
|
||||
}
|
||||
|
||||
func (m *mux) Serve() error {
|
||||
var wg sync.WaitGroup
|
||||
|
||||
defer func() {
|
||||
close(m.doneCh)
|
||||
wg.Wait()
|
||||
|
||||
for _, sl := range m.ml {
|
||||
_ = sl.listener.Close()
|
||||
for c := range sl.listener.connCh {
|
||||
_ = c.Close()
|
||||
}
|
||||
close(sl.listener.connCh)
|
||||
}
|
||||
}()
|
||||
|
||||
for {
|
||||
c, err := m.listener.Accept()
|
||||
if err != nil {
|
||||
if ne, ok := err.(net.Error); ok && ne.Temporary() {
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
wg.Add(1)
|
||||
go m.serve(c, &wg)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *mux) Close() error {
|
||||
return m.listener.Close()
|
||||
}
|
||||
|
||||
func (m *mux) OnError(f func(error)) {
|
||||
m.errHandler = f
|
||||
}
|
||||
|
||||
func (m *mux) serve(c net.Conn, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
|
||||
buf := getBuffer()
|
||||
n, err := c.Read(buf)
|
||||
data := buf[:n]
|
||||
for _, matcher := range m.ml {
|
||||
matched := matcher.matcher(data)
|
||||
if matched {
|
||||
if matcher.listener.closed.Get() {
|
||||
break
|
||||
}
|
||||
muc := newMuxConn(c, data, err)
|
||||
select {
|
||||
case matcher.listener.connCh <- muc:
|
||||
case <-m.doneCh:
|
||||
putBuffer(buf)
|
||||
_ = c.Close()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
putBuffer(buf)
|
||||
_ = c.Close()
|
||||
if m.errHandler != nil {
|
||||
m.errHandler(ErrNotMatched)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *mux) handleErr(err error) bool {
|
||||
if ne, ok := err.(net.Error); ok {
|
||||
return ne.Temporary()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func New(l net.Listener) Mux {
|
||||
return &mux{
|
||||
listener: l,
|
||||
connBufLen: 1024,
|
||||
doneCh: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
type muxListener struct {
|
||||
root net.Listener
|
||||
connCh chan net.Conn
|
||||
closed *atomic.AtomicBool
|
||||
}
|
||||
|
||||
func (l *muxListener) Accept() (net.Conn, error) {
|
||||
if l.closed.Get() {
|
||||
return nil, ErrListenerClosed
|
||||
}
|
||||
c, ok := <-l.connCh
|
||||
if !ok || l.closed.Get() {
|
||||
return nil, ErrListenerClosed
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// Close stops listening on address.
|
||||
// Already Accepted connections are not closed.
|
||||
func (l *muxListener) Close() error {
|
||||
l.closed.Set(true)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *muxListener) Addr() net.Addr {
|
||||
return l.root.Addr()
|
||||
}
|
||||
|
||||
func newMuxListener(root net.Listener, connBufLen int) *muxListener {
|
||||
return &muxListener{
|
||||
root: root,
|
||||
connCh: make(chan net.Conn, connBufLen),
|
||||
closed: atomic.NewAtomicBool(false),
|
||||
}
|
||||
}
|
||||
|
||||
type muxConn struct {
|
||||
net.Conn
|
||||
buf []byte
|
||||
lastErr error
|
||||
}
|
||||
|
||||
func newMuxConn(c net.Conn, buf []byte, lastErr error) *muxConn {
|
||||
return &muxConn{
|
||||
Conn: c,
|
||||
buf: buf,
|
||||
lastErr: lastErr,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *muxConn) Read(p []byte) (int, error) {
|
||||
if m.buf != nil {
|
||||
n := copy(p, m.buf)
|
||||
if len(m.buf) == n {
|
||||
putBuffer(m.buf)
|
||||
m.buf = nil
|
||||
} else {
|
||||
m.buf = m.buf[n:]
|
||||
}
|
||||
return n, m.lastErr
|
||||
}
|
||||
return m.Conn.Read(p)
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
package mux
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestHTTP1(t *testing.T) {
|
||||
a := assert.New(t)
|
||||
path := "/test/"
|
||||
method := "GET"
|
||||
mockResData := []byte("948 res")
|
||||
var responseData []byte
|
||||
|
||||
rootListener := newLocalListener()
|
||||
mux := New(rootListener)
|
||||
httpListener := mux.Match(HTTP1())
|
||||
mux.OnError(func(err error) {
|
||||
a.Fail("connection not matched by a http matcher")
|
||||
})
|
||||
|
||||
go func() {
|
||||
err := mux.Serve()
|
||||
log.Println(err)
|
||||
}()
|
||||
|
||||
handler := func(writer http.ResponseWriter, request *http.Request) {
|
||||
var err error
|
||||
a.Equal(method, request.Method)
|
||||
n, err := writer.Write(mockResData)
|
||||
a.NoError(err)
|
||||
a.Len(mockResData, n)
|
||||
}
|
||||
httpMux := http.NewServeMux()
|
||||
httpMux.HandleFunc(path, handler)
|
||||
httpServer := httptest.NewUnstartedServer(httpMux)
|
||||
httpServer.Listener = httpListener
|
||||
httpServer.Start()
|
||||
|
||||
url := httpServer.URL + path
|
||||
httpClient := httpServer.Client()
|
||||
req, _ := http.NewRequest(method, url, nil)
|
||||
res, err := httpClient.Do(req)
|
||||
a.NoError(err)
|
||||
if a.NotNil(res) {
|
||||
a.Equal(200, res.StatusCode)
|
||||
responseData, err = ioutil.ReadAll(res.Body)
|
||||
}
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
a.Equal(mockResData, responseData)
|
||||
}
|
||||
|
||||
func TestAny(t *testing.T) {
|
||||
a := assert.New(t)
|
||||
mockReqData := []byte("1 somre")
|
||||
requestData := make([]byte, len(mockReqData))
|
||||
|
||||
rootListener := newLocalListener()
|
||||
mux := New(rootListener)
|
||||
httpListener := mux.Match(HTTP1())
|
||||
tcpListener := mux.Match(Any())
|
||||
go func() {
|
||||
err := mux.Serve()
|
||||
log.Println(err)
|
||||
}()
|
||||
|
||||
handler := func(writer http.ResponseWriter, request *http.Request) {
|
||||
a.Fail("matched http handler")
|
||||
}
|
||||
httpMux := http.NewServeMux()
|
||||
httpMux.HandleFunc("/", handler)
|
||||
httpServer := httptest.NewUnstartedServer(httpMux)
|
||||
httpServer.Listener = httpListener
|
||||
httpServer.Start()
|
||||
|
||||
hadTcpConn := false
|
||||
go func() {
|
||||
for {
|
||||
conn, err := tcpListener.Accept()
|
||||
if hadTcpConn {
|
||||
a.Fail("more than one tcp conn")
|
||||
return
|
||||
}
|
||||
hadTcpConn = true
|
||||
a.NoError(err)
|
||||
_, err = conn.Read(requestData)
|
||||
a.NoError(err)
|
||||
a.Equal(mockReqData, requestData)
|
||||
}
|
||||
}()
|
||||
|
||||
tcpAddr := tcpListener.Addr().String()
|
||||
conn, err := net.Dial("tcp", tcpAddr)
|
||||
a.NoError(err)
|
||||
n, err := conn.Write(mockReqData)
|
||||
a.Len(mockReqData, n)
|
||||
a.NoError(err)
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
a.Equal(mockReqData, requestData)
|
||||
a.True(hadTcpConn)
|
||||
}
|
||||
|
||||
func newLocalListener() net.Listener {
|
||||
l, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to listen on a port: %v", err))
|
||||
}
|
||||
return l
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package mux
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// could be increased if needed for new matchers
|
||||
const bufferSize = 10
|
||||
|
||||
var pool sync.Pool
|
||||
|
||||
func getBuffer() []byte {
|
||||
b, ok := pool.Get().([]byte)
|
||||
if !ok {
|
||||
b = make([]byte, bufferSize)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func putBuffer(b []byte) {
|
||||
pool.Put(b[:cap(b)])
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
package raft
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
isplog "github.com/integration-system/isp-log"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
"io"
|
||||
"isp-config-service/codes"
|
||||
"log"
|
||||
)
|
||||
|
||||
type LoggerAdapter struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Log(level logrus.Level, msg string, args ...interface{}) {
|
||||
if l.name != "" {
|
||||
msg = fmt.Sprintf("%s:%s", l.name, msg)
|
||||
}
|
||||
if len(args) != 0 {
|
||||
metadata := make(map[string]interface{}, len(args)/2)
|
||||
for i := 0; i < len(args)-1; i += 2 {
|
||||
k := cast.ToString(args[i])
|
||||
metadata[k] = args[i+1]
|
||||
}
|
||||
isplog.WithMetadata(metadata).Log(level, codes.RaftLoggerCode, msg)
|
||||
} else {
|
||||
isplog.Log(level, codes.RaftLoggerCode, msg)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Trace(msg string, args ...interface{}) {
|
||||
l.Log(logrus.TraceLevel, msg, args...)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Debug(msg string, args ...interface{}) {
|
||||
l.Log(logrus.DebugLevel, msg, args...)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Info(msg string, args ...interface{}) {
|
||||
l.Log(logrus.InfoLevel, msg, args...)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Warn(msg string, args ...interface{}) {
|
||||
l.Log(logrus.WarnLevel, msg, args...)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Error(msg string, args ...interface{}) {
|
||||
l.Log(logrus.ErrorLevel, msg, args...)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) IsTrace() bool {
|
||||
return isplog.IsLevelEnabled(logrus.TraceLevel)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) IsDebug() bool {
|
||||
return isplog.IsLevelEnabled(logrus.DebugLevel)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) IsInfo() bool {
|
||||
return isplog.IsLevelEnabled(logrus.InfoLevel)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) IsWarn() bool {
|
||||
return isplog.IsLevelEnabled(logrus.WarnLevel)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) IsError() bool {
|
||||
return isplog.IsLevelEnabled(logrus.ErrorLevel)
|
||||
}
|
||||
|
||||
// No need to implement that as Raft doesn't use this method.
|
||||
func (l *LoggerAdapter) With(args ...interface{}) hclog.Logger {
|
||||
return l
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) Named(name string) hclog.Logger {
|
||||
sl := *l
|
||||
if sl.name != "" {
|
||||
sl.name = sl.name + "." + name
|
||||
} else {
|
||||
sl.name = name
|
||||
}
|
||||
return &sl
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) ResetNamed(name string) hclog.Logger {
|
||||
sl := *l
|
||||
sl.name = name
|
||||
return &sl
|
||||
}
|
||||
|
||||
// Skip
|
||||
func (l *LoggerAdapter) SetLevel(level hclog.Level) {
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger {
|
||||
return log.New(isplog.GetOutput(), "", 0)
|
||||
}
|
||||
|
||||
func (l *LoggerAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer {
|
||||
return isplog.GetOutput()
|
||||
}
|
||||
+27
-11
@@ -1,24 +1,28 @@
|
||||
package raft
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/raft"
|
||||
raftboltdb "github.com/hashicorp/raft-boltdb"
|
||||
"github.com/pkg/errors"
|
||||
"isp-config-service/conf"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/raft"
|
||||
"github.com/hashicorp/raft-boltdb/v2"
|
||||
"github.com/integration-system/isp-log/adapter"
|
||||
"github.com/pkg/errors"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/conf"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultSyncTimeout = 3 * time.Second
|
||||
dbFile = "raft_db"
|
||||
defaultSyncTimeout = 3 * time.Second
|
||||
leaderNotificationChBuffer = 10
|
||||
dbFile = "raft_db"
|
||||
)
|
||||
|
||||
type ChangeLeaderNotification struct {
|
||||
IsLeader bool
|
||||
CurrentLeaderAddress string
|
||||
IsLeader bool
|
||||
LeaderElected bool
|
||||
}
|
||||
|
||||
@@ -55,11 +59,13 @@ func (r *Raft) LeaderCh() <-chan ChangeLeaderNotification {
|
||||
func (r *Raft) GracefulShutdown() error {
|
||||
r.r.DeregisterObserver(r.leaderObs)
|
||||
close(r.closer)
|
||||
close(r.changeLeaderCh)
|
||||
close(r.leaderObsCh)
|
||||
return r.r.Shutdown().Error()
|
||||
}
|
||||
|
||||
func (r *Raft) listenLeader() {
|
||||
defer close(r.changeLeaderCh)
|
||||
|
||||
for {
|
||||
select {
|
||||
case _, ok := <-r.leaderObsCh:
|
||||
@@ -73,6 +79,8 @@ func (r *Raft) listenLeader() {
|
||||
CurrentLeaderAddress: string(currentLeader),
|
||||
LeaderElected: currentLeader != "",
|
||||
}:
|
||||
case <-r.closer:
|
||||
return
|
||||
default:
|
||||
continue
|
||||
}
|
||||
@@ -88,12 +96,20 @@ func NewRaft(tcpListener net.Listener, configuration conf.ClusterConfiguration,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
netLogger := adapter.NewHcLogger("RAFT-NET", codes.RaftLoggerCode)
|
||||
streamLayer := &StreamLayer{Listener: tcpListener}
|
||||
timeout := time.Duration(configuration.ConnectTimeoutSeconds) * time.Second
|
||||
trans := raft.NewNetworkTransport(streamLayer, len(configuration.Peers), timeout, os.Stdout)
|
||||
config := &raft.NetworkTransportConfig{
|
||||
Stream: streamLayer,
|
||||
MaxPool: len(configuration.Peers),
|
||||
Timeout: timeout,
|
||||
Logger: netLogger,
|
||||
ServerAddressProvider: transparentAddressProvider{},
|
||||
}
|
||||
trans := raft.NewNetworkTransportWithConfig(config)
|
||||
|
||||
cfg := raft.DefaultConfig()
|
||||
cfg.Logger = &LoggerAdapter{name: "RAFT"}
|
||||
cfg.Logger = adapter.NewHcLogger("RAFT", codes.RaftLoggerCode)
|
||||
cfg.NoSnapshotRestoreOnStart = true
|
||||
cfg.LocalID = raft.ServerID(configuration.OuterAddress)
|
||||
r, err := raft.NewRaft(cfg, state, logStore, store, snapshotStore, trans)
|
||||
@@ -108,7 +124,7 @@ func NewRaft(tcpListener net.Listener, configuration conf.ClusterConfiguration,
|
||||
cfg: configuration,
|
||||
leaderObs: leaderObs,
|
||||
leaderObsCh: leaderObsCh,
|
||||
changeLeaderCh: make(chan ChangeLeaderNotification, 10),
|
||||
changeLeaderCh: make(chan ChangeLeaderNotification, leaderNotificationChBuffer),
|
||||
closer: make(chan struct{}),
|
||||
}
|
||||
go raft.listenLeader()
|
||||
|
||||
@@ -13,3 +13,10 @@ type StreamLayer struct {
|
||||
func (r *StreamLayer) Dial(address raft.ServerAddress, timeout time.Duration) (net.Conn, error) {
|
||||
return net.DialTimeout("tcp", string(address), timeout)
|
||||
}
|
||||
|
||||
type transparentAddressProvider struct {
|
||||
}
|
||||
|
||||
func (t transparentAddressProvider) ServerAddr(id raft.ServerID) (raft.ServerAddress, error) {
|
||||
return raft.ServerAddress(id), nil
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
|
||||
var (
|
||||
ClusterMeshService clusterMeshService
|
||||
ClusterMesh clusterMeshService
|
||||
)
|
||||
|
||||
type clusterMeshService struct{}
|
||||
@@ -14,15 +14,15 @@ type clusterMeshService struct{}
|
||||
func (clusterMeshService) HandleUpdateBackendDeclarationCommand(declaration structure.BackendDeclaration, state state.WritableState) {
|
||||
changed := state.WritableMesh().UpsertBackend(declaration)
|
||||
if changed {
|
||||
DiscoveryService.BroadcastModuleAddresses(declaration.ModuleName, state.Mesh())
|
||||
RoutesService.BroadcastRoutes(state.Mesh())
|
||||
Discovery.BroadcastModuleAddresses(declaration.ModuleName, state.Mesh())
|
||||
Routes.BroadcastRoutes(state.Mesh())
|
||||
}
|
||||
}
|
||||
|
||||
func (clusterMeshService) HandleDeleteBackendDeclarationCommand(declaration structure.BackendDeclaration, state state.WritableState) {
|
||||
deleted := state.WritableMesh().DeleteBackend(declaration)
|
||||
if deleted {
|
||||
DiscoveryService.BroadcastModuleAddresses(declaration.ModuleName, state.Mesh())
|
||||
RoutesService.BroadcastRoutes(state.Mesh())
|
||||
Discovery.BroadcastModuleAddresses(declaration.ModuleName, state.Mesh())
|
||||
Routes.BroadcastRoutes(state.Mesh())
|
||||
}
|
||||
}
|
||||
+16
-15
@@ -12,12 +12,13 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
CommonConfigService = commonConfigService{}
|
||||
CommonConfig = commonConfigService{}
|
||||
)
|
||||
|
||||
type commonConfigService struct{}
|
||||
|
||||
func (s commonConfigService) HandleDeleteConfigsCommand(deleteCommonConfig cluster.DeleteCommonConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
func (s commonConfigService) HandleDeleteConfigsCommand(
|
||||
deleteCommonConfig cluster.DeleteCommonConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
links := s.GetCommonConfigLinks(deleteCommonConfig.Id, state)
|
||||
if len(links) > 0 {
|
||||
return cluster.NewResponse(domain.DeleteCommonConfigResponse{Deleted: false, Links: links})
|
||||
@@ -36,12 +37,14 @@ func (s commonConfigService) HandleDeleteConfigsCommand(deleteCommonConfig clust
|
||||
return cluster.NewResponse(domain.DeleteCommonConfigResponse{Deleted: deleted > 0})
|
||||
}
|
||||
|
||||
func (s commonConfigService) HandleUpsertConfigCommand(upsertConfig cluster.UpsertCommonConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
func (s commonConfigService) HandleUpsertConfigCommand(
|
||||
upsertConfig cluster.UpsertCommonConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
config := upsertConfig.Config
|
||||
configsByName := state.CommonConfigs().GetByName(config.Name)
|
||||
if upsertConfig.Create {
|
||||
if len(configsByName) > 0 {
|
||||
return cluster.NewResponseErrorf(codes2.AlreadyExists, "common config with name %s already exists", upsertConfig.Config.Name)
|
||||
return cluster.NewResponseErrorf(codes2.AlreadyExists,
|
||||
"common config with name %s already exists", upsertConfig.Config.Name)
|
||||
}
|
||||
config = state.WritableCommonConfigs().Create(config)
|
||||
} else {
|
||||
@@ -51,7 +54,8 @@ func (s commonConfigService) HandleUpsertConfigCommand(upsertConfig cluster.Upse
|
||||
return cluster.NewResponseErrorf(codes2.NotFound, "common config with id %s not found", config.Id)
|
||||
}
|
||||
if len(configsByName) > 0 && configs[0].Id != configsByName[0].Id {
|
||||
return cluster.NewResponseErrorf(codes2.AlreadyExists, "common config with name %s already exists", upsertConfig.Config.Name)
|
||||
return cluster.NewResponseErrorf(codes2.AlreadyExists,
|
||||
"common config with name %s already exists", upsertConfig.Config.Name)
|
||||
}
|
||||
config.CreatedAt = configs[0].CreatedAt
|
||||
state.WritableCommonConfigs().UpdateById(config)
|
||||
@@ -68,23 +72,20 @@ func (s commonConfigService) HandleUpsertConfigCommand(upsertConfig cluster.Upse
|
||||
}
|
||||
if !upsertConfig.Create {
|
||||
configsToBroadcast := state.Configs().FilterByCommonConfigs([]string{config.Id})
|
||||
ConfigService.BroadcastNewConfig(state, configsToBroadcast...)
|
||||
ConfigService.BroadcastActiveConfigs(state, configsToBroadcast...)
|
||||
}
|
||||
return cluster.NewResponse(config)
|
||||
}
|
||||
|
||||
func (s commonConfigService) GetCommonConfigLinks(commonConfigId string, state state.ReadonlyState) domain.CommonConfigLinks {
|
||||
configs := state.Configs().FilterByCommonConfigs([]string{commonConfigId})
|
||||
func (s commonConfigService) GetCommonConfigLinks(commonConfigID string, state state.ReadonlyState) domain.CommonConfigLinks {
|
||||
configs := state.Configs().FilterByCommonConfigs([]string{commonConfigID})
|
||||
result := make(domain.CommonConfigLinks)
|
||||
for _, c := range configs {
|
||||
module := state.Modules().GetById(c.ModuleId)
|
||||
for i := range configs {
|
||||
module := state.Modules().GetById(configs[i].ModuleId)
|
||||
if module != nil {
|
||||
if configs, ok := result[module.Name]; ok {
|
||||
result[module.Name] = append(configs, c.Name)
|
||||
} else {
|
||||
result[module.Name] = []string{c.Name}
|
||||
}
|
||||
result[module.Name] = append(result[module.Name], configs[i].Name)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
+46
-28
@@ -3,8 +3,9 @@ package service
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/integration-system/bellows"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/xeipuuv/gojsonschema"
|
||||
@@ -22,8 +23,6 @@ var (
|
||||
ConfigService = configService{}
|
||||
)
|
||||
|
||||
const ConfigWatchersRoomSuffix = "_config"
|
||||
|
||||
type configService struct{}
|
||||
|
||||
type validationSchemaError struct {
|
||||
@@ -51,7 +50,8 @@ func (cs configService) GetCompiledConfig(moduleName string, state state.Readonl
|
||||
return cs.CompileConfig(config.Data, state, config.CommonConfigs...), nil
|
||||
}
|
||||
|
||||
func (configService) CompileConfig(data map[string]interface{}, state state.ReadonlyState, commonConfigsIds ...string) map[string]interface{} {
|
||||
func (configService) CompileConfig(
|
||||
data map[string]interface{}, state state.ReadonlyState, commonConfigsIds ...string) map[string]interface{} {
|
||||
commonConfigs := state.CommonConfigs().GetByIds(commonConfigsIds)
|
||||
configsToMerge := make([]map[string]interface{}, 0, len(commonConfigs))
|
||||
for _, common := range commonConfigs {
|
||||
@@ -62,7 +62,8 @@ func (configService) CompileConfig(data map[string]interface{}, state state.Read
|
||||
return mergeNestedMaps(configsToMerge...)
|
||||
}
|
||||
|
||||
func (configService) HandleActivateConfigCommand(activateConfig cluster.ActivateConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
func (cs configService) HandleActivateConfigCommand(
|
||||
activateConfig cluster.ActivateConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
configs := state.Configs().GetByIds([]string{activateConfig.ConfigId})
|
||||
if len(configs) == 0 {
|
||||
return cluster.NewResponseErrorf(codes2.NotFound, "config with id %s not found", activateConfig.ConfigId)
|
||||
@@ -70,9 +71,9 @@ func (configService) HandleActivateConfigCommand(activateConfig cluster.Activate
|
||||
config := configs[0]
|
||||
affected := state.WritableConfigs().Activate(config, activateConfig.Date)
|
||||
if holder.ClusterClient.IsLeader() {
|
||||
for _, c := range affected {
|
||||
for i := range affected {
|
||||
// TODO handle db errors
|
||||
_, err := model.ConfigRep.Upsert(c)
|
||||
_, err := model.ConfigRep.Upsert(affected[i])
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"config": config,
|
||||
@@ -80,7 +81,9 @@ func (configService) HandleActivateConfigCommand(activateConfig cluster.Activate
|
||||
}
|
||||
}
|
||||
}
|
||||
return cluster.NewResponse(affected[len(affected)-1])
|
||||
config = affected[len(affected)-1]
|
||||
cs.BroadcastActiveConfigs(state, config)
|
||||
return cluster.NewResponse(config)
|
||||
}
|
||||
|
||||
func (configService) HandleDeleteConfigsCommand(deleteConfigs cluster.DeleteConfigs, state state.WritableState) int {
|
||||
@@ -98,7 +101,8 @@ func (configService) HandleDeleteConfigsCommand(deleteConfigs cluster.DeleteConf
|
||||
return deleted
|
||||
}
|
||||
|
||||
func (cs configService) HandleUpsertConfigCommand(upsertConfig cluster.UpsertConfig, state state.WritableState) cluster.ResponseWithError {
|
||||
func (cs configService) HandleUpsertConfigCommand(upsertConfig cluster.UpsertConfig,
|
||||
state state.WritableState) cluster.ResponseWithError {
|
||||
config := upsertConfig.Config
|
||||
module := state.Modules().GetById(config.ModuleId)
|
||||
if module == nil {
|
||||
@@ -133,8 +137,13 @@ func (cs configService) HandleUpsertConfigCommand(upsertConfig cluster.UpsertCon
|
||||
if len(configs) == 0 {
|
||||
return cluster.NewResponseErrorf(codes2.NotFound, "config with id %s not found", config.Id)
|
||||
}
|
||||
config.CreatedAt = configs[0].CreatedAt
|
||||
oldCfg := configs[0]
|
||||
config.CreatedAt = oldCfg.CreatedAt
|
||||
config.Active = oldCfg.Active
|
||||
config.Version = oldCfg.Version + 1
|
||||
state.WritableConfigs().UpdateById(config)
|
||||
|
||||
ConfigHistory.SaveConfigVersion(upsertConfig.VersionId, oldCfg, state, upsertConfig.VersionCreateAt)
|
||||
}
|
||||
|
||||
if holder.ClusterClient.IsLeader() {
|
||||
@@ -146,7 +155,8 @@ func (cs configService) HandleUpsertConfigCommand(upsertConfig cluster.UpsertCon
|
||||
}).Errorf(codes.DatabaseOperationError, "upsert config: %v", err)
|
||||
}
|
||||
}
|
||||
cs.BroadcastNewConfig(state, config)
|
||||
|
||||
cs.BroadcastActiveConfigs(state, config)
|
||||
return cluster.NewResponse(domain.CreateUpdateConfigResponse{
|
||||
Config: &domain.ConfigModuleInfo{
|
||||
Config: config,
|
||||
@@ -156,12 +166,16 @@ func (cs configService) HandleUpsertConfigCommand(upsertConfig cluster.UpsertCon
|
||||
})
|
||||
}
|
||||
|
||||
func (cs configService) BroadcastNewConfig(state state.ReadonlyState, configs ...entity.Config) {
|
||||
for _, cfg := range configs {
|
||||
moduleId := cfg.ModuleId
|
||||
module := state.Modules().GetById(moduleId)
|
||||
func (cs configService) BroadcastActiveConfigs(state state.ReadonlyState, configs ...entity.Config) {
|
||||
for i := range configs {
|
||||
cfg := &configs[i]
|
||||
if !cfg.Active {
|
||||
continue
|
||||
}
|
||||
moduleID := cfg.ModuleId
|
||||
module := state.Modules().GetById(moduleID)
|
||||
moduleName := module.Name
|
||||
room := moduleName + ConfigWatchersRoomSuffix
|
||||
room := Room.Module(moduleName)
|
||||
|
||||
compiledConfig, err := cs.GetCompiledConfig(moduleName, state)
|
||||
if err != nil {
|
||||
@@ -173,31 +187,35 @@ func (cs configService) BroadcastNewConfig(state state.ReadonlyState, configs ..
|
||||
go cs.broadcast(room, utils.ConfigError, []byte(err.Error()))
|
||||
continue
|
||||
}
|
||||
go cs.broadcast(room, utils.ConfigSendConfigWhenConnected, data)
|
||||
go cs.broadcast(room, utils.ConfigSendConfigChanged, data)
|
||||
}
|
||||
}
|
||||
|
||||
func (cs configService) broadcast(room, event string, data []byte) {
|
||||
err := holder.EtpServer.BroadcastToRoom(room, utils.ConfigSendConfigWhenConnected, data)
|
||||
if err != nil {
|
||||
log.Errorf(codes.ConfigServiceBroadcastConfigError, "broadcast %s err: %v", event, err)
|
||||
func (cs configService) broadcast(room, event string, body []byte) {
|
||||
conns := holder.EtpServer.Rooms().ToBroadcast(room)
|
||||
for _, conn := range conns {
|
||||
err := EmitConnWithTimeout(conn, event, body)
|
||||
if err != nil {
|
||||
log.Errorf(codes.ConfigServiceBroadcastConfigError, "broadcast '%s' to %s: %v", event, conn.RemoteAddr(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (configService) validateSchema(schema entity.ConfigSchema, data map[string]interface{}) (bool, error) {
|
||||
schemaLoader := gojsonschema.NewGoLoader(schema.Schema)
|
||||
documentLoader := gojsonschema.NewGoLoader(data)
|
||||
if result, err := gojsonschema.Validate(schemaLoader, documentLoader); err != nil {
|
||||
result, err := gojsonschema.Validate(schemaLoader, documentLoader)
|
||||
if err != nil {
|
||||
return false, err
|
||||
} else if result.Valid() {
|
||||
return true, nil
|
||||
} else {
|
||||
desc := make(map[string]string)
|
||||
for _, value := range result.Errors() {
|
||||
desc[value.Field()] = value.Description()
|
||||
}
|
||||
return false, validationSchemaError{Description: desc}
|
||||
}
|
||||
|
||||
desc := make(map[string]string)
|
||||
for _, value := range result.Errors() {
|
||||
desc[value.Field()] = value.Description()
|
||||
}
|
||||
return false, validationSchemaError{Description: desc}
|
||||
}
|
||||
|
||||
func mergeNestedMaps(maps ...map[string]interface{}) map[string]interface{} {
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"isp-config-service/entity"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestConfigService_validateSchema(t *testing.T) {
|
||||
var (
|
||||
a = assert.New(t)
|
||||
|
||||
schemaDesc = []byte(`{"schema":{"properties":{"configuration":{"required":["address","token"],"properties":{"address":{"type":"string","title":"Адрес"},"token":{"type":"string","title":"Токен"}},"additionalProperties":false,"type":"object"}},"additionalProperties":false,"type":"object","title":"Remote config"},"title":"module_name"}`)
|
||||
validData = map[string]interface{}{"configuration": map[string]interface{}{"address": "127.0.0.1", "token": "token"}}
|
||||
invalidValue = map[string]interface{}{"configuration": map[string]interface{}{"address": 127001, "token": "token"}}
|
||||
invalidName = map[string]interface{}{"config": map[string]interface{}{"test": "127.0.0.1", "token": "token"}}
|
||||
|
||||
schema entity.ConfigSchema
|
||||
valid bool
|
||||
err error
|
||||
)
|
||||
|
||||
a.NoError(json.Unmarshal(schemaDesc, &schema))
|
||||
|
||||
valid, err = ConfigService.validateSchema(schema, validData)
|
||||
a.NoError(err)
|
||||
a.True(valid)
|
||||
|
||||
valid, err = ConfigService.validateSchema(schema, invalidValue)
|
||||
a.Error(err)
|
||||
a.False(valid)
|
||||
|
||||
valid, err = ConfigService.validateSchema(schema, invalidName)
|
||||
a.Error(err)
|
||||
a.False(valid)
|
||||
}
|
||||
+77
-51
@@ -1,22 +1,27 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/cenkalti/backoff"
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
"sync"
|
||||
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/holder"
|
||||
"isp-config-service/store/state"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
AllModules = "*"
|
||||
)
|
||||
|
||||
var (
|
||||
DiscoveryService = NewDiscoveryService()
|
||||
Discovery = &discoveryService{
|
||||
subs: make(map[string][]string),
|
||||
}
|
||||
)
|
||||
|
||||
type discoveryService struct {
|
||||
@@ -24,12 +29,12 @@ type discoveryService struct {
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
func (ds *discoveryService) HandleDisconnect(connId string) {
|
||||
func (ds *discoveryService) HandleDisconnect(connID string) {
|
||||
ds.lock.Lock()
|
||||
defer ds.lock.Unlock()
|
||||
if events, ok := ds.subs[connId]; ok {
|
||||
holder.EtpServer.Rooms().LeaveByConnId(connId, events...)
|
||||
delete(ds.subs, connId)
|
||||
if rooms, ok := ds.subs[connID]; ok {
|
||||
holder.EtpServer.Rooms().LeaveByConnId(connID, rooms...)
|
||||
delete(ds.subs, connID)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,70 +45,91 @@ func (ds *discoveryService) Subscribe(conn etp.Conn, modules []string, mesh stat
|
||||
ds.lock.Lock()
|
||||
defer ds.lock.Unlock()
|
||||
eventsAddresses := make([][]structure.AddressConfiguration, 0, len(modules))
|
||||
events := make([]string, 0, len(modules))
|
||||
rooms := make([]string, 0, len(modules))
|
||||
for _, module := range modules {
|
||||
event := utils.ModuleConnected(module)
|
||||
room := Room.AddressListener(module)
|
||||
addressList := mesh.GetModuleAddresses(module)
|
||||
eventsAddresses = append(eventsAddresses, addressList)
|
||||
events = append(events, event)
|
||||
rooms = append(rooms, room)
|
||||
}
|
||||
ds.subs[conn.ID()] = events
|
||||
holder.EtpServer.Rooms().Join(conn, events...)
|
||||
ds.subs[conn.ID()] = rooms
|
||||
holder.EtpServer.Rooms().Join(conn, rooms...)
|
||||
|
||||
go func(events []string, eventsAddresses [][]structure.AddressConfiguration, conn etp.Conn) {
|
||||
for i := range events {
|
||||
event := events[i]
|
||||
addressList := eventsAddresses[i]
|
||||
err := ds.sendAddrList(conn, event, addressList)
|
||||
body, err := json.Marshal(addressList)
|
||||
if err != nil {
|
||||
log.Errorf(codes.DiscoveryServiceSendModulesError, "send module connected %v", err)
|
||||
panic(err)
|
||||
}
|
||||
err = EmitConnWithTimeout(conn, event, body)
|
||||
if err != nil {
|
||||
log.Errorf(codes.DiscoveryServiceSendModulesError, "send module connected to %s: %v", conn.RemoteAddr(), err)
|
||||
}
|
||||
}
|
||||
}(events, eventsAddresses, conn)
|
||||
}(rooms, eventsAddresses, conn)
|
||||
}
|
||||
|
||||
func (ds *discoveryService) BroadcastModuleAddresses(moduleName string, mesh state.ReadonlyMesh) {
|
||||
ds.lock.RLock()
|
||||
defer ds.lock.RUnlock()
|
||||
room := Room.AddressListener(moduleName)
|
||||
event := utils.ModuleConnected(moduleName)
|
||||
addressList := mesh.GetModuleAddresses(moduleName)
|
||||
go func(room, event string, addressList []structure.AddressConfiguration) {
|
||||
err := ds.broadcastAddrList(room, event, addressList)
|
||||
if err != nil {
|
||||
log.Errorf(codes.DiscoveryServiceSendModulesError, "broadcast module connected %v", err)
|
||||
}
|
||||
}(event, event, addressList)
|
||||
go ds.broadcastModuleAddrList(room, event, addressList)
|
||||
}
|
||||
|
||||
func (ds *discoveryService) broadcastAddrList(room string, event string, addressList []structure.AddressConfiguration) error {
|
||||
if bytes, err := json.Marshal(addressList); err != nil {
|
||||
return err
|
||||
} else {
|
||||
err = holder.EtpServer.BroadcastToRoom(room, event, bytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
func (ds *discoveryService) BroadcastEvent(event cluster.BroadcastEvent) {
|
||||
eventName := event.Event
|
||||
payload := make([]byte, len(event.Payload))
|
||||
copy(payload, event.Payload) // TODO а тут точно нужно копирование ?
|
||||
|
||||
if len(event.ModuleNames) == 1 && event.ModuleNames[0] == AllModules {
|
||||
go func() {
|
||||
conns := holder.EtpServer.Rooms().AllConns()
|
||||
for _, conn := range conns {
|
||||
err := EmitConnWithTimeout(conn, eventName, payload)
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"eventName": eventName,
|
||||
"remote_address": conn.RemoteAddr(),
|
||||
}).Errorf(codes.DiscoveryServiceSendModulesError, "broadcast event to all modules: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
return
|
||||
}
|
||||
return nil
|
||||
|
||||
rooms := make([]string, 0, len(event.ModuleNames))
|
||||
for _, moduleName := range event.ModuleNames {
|
||||
room := Room.Module(moduleName)
|
||||
rooms = append(rooms, room)
|
||||
}
|
||||
go func(rooms []string) {
|
||||
conns := holder.EtpServer.Rooms().ToBroadcast(rooms...)
|
||||
for _, conn := range conns {
|
||||
err := EmitConnWithTimeout(conn, eventName, payload)
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"eventName": eventName,
|
||||
"remote_address": conn.RemoteAddr(),
|
||||
}).Errorf(codes.DiscoveryServiceSendModulesError, "broadcast event: %v", err)
|
||||
}
|
||||
}
|
||||
}(rooms)
|
||||
}
|
||||
|
||||
func (ds *discoveryService) sendAddrList(conn etp.Conn, event string, addressList []structure.AddressConfiguration) error {
|
||||
if bytes, err := json.Marshal(addressList); err != nil {
|
||||
return err
|
||||
} else {
|
||||
bf := backoff.WithMaxRetries(backoff.NewConstantBackOff(100*time.Millisecond), 3)
|
||||
err := backoff.Retry(func() error {
|
||||
return conn.Emit(context.Background(), event, bytes)
|
||||
}, bf)
|
||||
func (ds *discoveryService) broadcastModuleAddrList(room string, event string, addressList []structure.AddressConfiguration) {
|
||||
body, err := json.Marshal(addressList)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
conns := holder.EtpServer.Rooms().ToBroadcast(room)
|
||||
for _, conn := range conns {
|
||||
err := EmitConnWithTimeout(conn, event, body)
|
||||
if err != nil {
|
||||
return err
|
||||
log.Errorf(codes.DiscoveryServiceSendModulesError, "broadcast module connected to %s: %v", conn.RemoteAddr(), err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewDiscoveryService() *discoveryService {
|
||||
return &discoveryService{
|
||||
subs: make(map[string][]string),
|
||||
}
|
||||
}
|
||||
+48
-15
@@ -1,7 +1,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"sort"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
@@ -10,11 +12,10 @@ import (
|
||||
"isp-config-service/holder"
|
||||
"isp-config-service/model"
|
||||
"isp-config-service/store/state"
|
||||
"sort"
|
||||
)
|
||||
|
||||
var (
|
||||
ModuleRegistryService = moduleRegistryService{}
|
||||
ModuleRegistry = moduleRegistryService{}
|
||||
)
|
||||
|
||||
type moduleRegistryService struct{}
|
||||
@@ -67,8 +68,8 @@ func (moduleRegistryService) HandleDeleteModulesCommand(deleteModules cluster.De
|
||||
|
||||
configsToDelete := state.WritableConfigs().GetByModuleIds(ids)
|
||||
confIds := make([]string, 0, len(configsToDelete))
|
||||
for _, conf := range configsToDelete {
|
||||
confIds = append(confIds, conf.Id)
|
||||
for i := range configsToDelete {
|
||||
confIds = append(confIds, configsToDelete[i].Id)
|
||||
}
|
||||
state.WritableConfigs().DeleteByIds(confIds)
|
||||
|
||||
@@ -103,44 +104,58 @@ func (moduleRegistryService) HandleDeleteModulesCommand(deleteModules cluster.De
|
||||
return len(deletedModules)
|
||||
}
|
||||
|
||||
func (moduleRegistryService) ValidateConfig(config entity.Config, state state.ReadonlyState) bool {
|
||||
schemas := state.Schemas().GetByModuleIds([]string{config.ModuleId})
|
||||
valid := false
|
||||
|
||||
for _, s := range schemas {
|
||||
dataForValidate := ConfigService.CompileConfig(config.Data, state, config.CommonConfigs...)
|
||||
valid, _ = ConfigService.validateSchema(s, dataForValidate)
|
||||
}
|
||||
|
||||
return valid
|
||||
}
|
||||
|
||||
//nolint:funlen
|
||||
func (moduleRegistryService) GetAggregatedModuleInfo(state state.ReadonlyState) []domain.ModuleInfo {
|
||||
modules := state.Modules().GetAll()
|
||||
modulesLen := len(modules)
|
||||
result := make([]domain.ModuleInfo, 0, modulesLen)
|
||||
resMap := make(map[string]domain.ModuleInfo, modulesLen)
|
||||
nameIdMap := make(map[string]string)
|
||||
idList := make([]string, modulesLen)
|
||||
|
||||
for i, module := range modules {
|
||||
idList[i] = module.Id
|
||||
active := state.Mesh().BackendExist(structure.BackendDeclaration{ModuleName: module.Name})
|
||||
info := domain.ModuleInfo{
|
||||
Id: module.Id,
|
||||
Name: module.Name,
|
||||
Active: active,
|
||||
CreatedAt: module.CreatedAt,
|
||||
LastConnectedAt: module.LastConnectedAt,
|
||||
LastDisconnectedAt: module.LastDisconnectedAt,
|
||||
}
|
||||
resMap[module.Id] = info
|
||||
nameIdMap[module.Name] = module.Id
|
||||
}
|
||||
|
||||
configs := state.Configs().GetByModuleIds(idList)
|
||||
for _, cfg := range configs {
|
||||
info := resMap[cfg.ModuleId]
|
||||
for i := range configs {
|
||||
info := resMap[configs[i].ModuleId]
|
||||
info.Configs = append(info.Configs, domain.ConfigModuleInfo{
|
||||
Config: cfg,
|
||||
Config: configs[i],
|
||||
Valid: false,
|
||||
})
|
||||
|
||||
resMap[cfg.ModuleId] = info
|
||||
resMap[configs[i].ModuleId] = info
|
||||
}
|
||||
|
||||
schemas := state.Schemas().GetByModuleIds(idList)
|
||||
for _, s := range schemas {
|
||||
info := resMap[s.ModuleId]
|
||||
schema := s.Schema
|
||||
info.ConfigSchema = &schema
|
||||
|
||||
for i, config := range info.Configs {
|
||||
dataForValidate := ConfigService.CompileConfig(config.Data, state, config.CommonConfigs...)
|
||||
for i := range info.Configs {
|
||||
dataForValidate := ConfigService.CompileConfig(info.Configs[i].Data, state, info.Configs[i].CommonConfigs...)
|
||||
info.Configs[i].Valid, _ = ConfigService.validateSchema(s, dataForValidate)
|
||||
}
|
||||
|
||||
@@ -152,23 +167,41 @@ func (moduleRegistryService) GetAggregatedModuleInfo(state state.ReadonlyState)
|
||||
backends := state.Mesh().GetBackends(info.Name)
|
||||
conns := make([]domain.Connection, 0, len(backends))
|
||||
|
||||
if len(backends) > 0 {
|
||||
back := backends[0]
|
||||
requiredModules := make([]domain.ModuleDependency, 0, len(back.RequiredModules))
|
||||
for _, dep := range back.RequiredModules {
|
||||
requiredModules = append(requiredModules, domain.ModuleDependency{
|
||||
Name: dep.Name,
|
||||
Id: nameIdMap[dep.Name],
|
||||
Required: dep.Required,
|
||||
})
|
||||
}
|
||||
info.RequiredModules = requiredModules
|
||||
}
|
||||
|
||||
for _, back := range backends {
|
||||
con := domain.Connection{
|
||||
Version: back.Version,
|
||||
LibVersion: back.LibVersion,
|
||||
Address: back.Address,
|
||||
Endpoints: back.Endpoints,
|
||||
Endpoints: make([]structure.EndpointDescriptor, len(back.Endpoints)),
|
||||
}
|
||||
copy(con.Endpoints, back.Endpoints)
|
||||
sort.Slice(con.Endpoints, func(i, j int) bool {
|
||||
return con.Endpoints[i].Path < con.Endpoints[j].Path
|
||||
})
|
||||
con.EstablishedAt = info.LastConnectedAt
|
||||
conns = append(conns, con)
|
||||
}
|
||||
sort.Slice(info.Configs, func(i, j int) bool {
|
||||
return info.Configs[i].Version < info.Configs[j].Version
|
||||
})
|
||||
sort.Slice(conns, func(i, j int) bool {
|
||||
return conns[i].EstablishedAt.Before(conns[j].EstablishedAt)
|
||||
})
|
||||
info.Status = conns
|
||||
info.Active = len(conns) > 0
|
||||
result = append(result, info)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
configWatchersRoomSuffix = "_config"
|
||||
routesSubscribersRoom = "__routesSubscribers"
|
||||
)
|
||||
|
||||
const wsWriteTimeout = time.Second
|
||||
|
||||
var (
|
||||
Room = roomService{}
|
||||
)
|
||||
|
||||
type roomService struct{}
|
||||
|
||||
func (s roomService) Module(moduleName string) string {
|
||||
return moduleName + configWatchersRoomSuffix
|
||||
}
|
||||
|
||||
func (s roomService) RoutesSubscribers() string {
|
||||
return routesSubscribersRoom
|
||||
}
|
||||
|
||||
func (s roomService) AddressListener(moduleName string) string {
|
||||
return utils.ModuleConnected(moduleName)
|
||||
}
|
||||
|
||||
func EmitConnWithTimeout(conn etp.Conn, event string, body []byte) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), wsWriteTimeout)
|
||||
defer cancel()
|
||||
return conn.Emit(ctx, event, body)
|
||||
}
|
||||
+27
-48
@@ -1,75 +1,54 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/cenkalti/backoff"
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/holder"
|
||||
"isp-config-service/store/state"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
RoutesSubscribersRoom = "__routesSubscribers"
|
||||
)
|
||||
|
||||
var RoutesService routesService
|
||||
var Routes routesService
|
||||
|
||||
type routesService struct{}
|
||||
|
||||
func (rs *routesService) HandleDisconnect(connId string) {
|
||||
holder.EtpServer.Rooms().LeaveByConnId(connId, RoutesSubscribersRoom)
|
||||
func (rs *routesService) HandleDisconnect(connID string) {
|
||||
holder.EtpServer.Rooms().LeaveByConnId(connID, Room.RoutesSubscribers())
|
||||
}
|
||||
|
||||
func (rs *routesService) SubscribeRoutes(conn etp.Conn, mesh state.ReadonlyMesh) {
|
||||
holder.EtpServer.Rooms().Join(conn, RoutesSubscribersRoom)
|
||||
holder.EtpServer.Rooms().Join(conn, Room.RoutesSubscribers())
|
||||
routes := mesh.GetRoutes()
|
||||
go func(conn etp.Conn, routes structure.RoutingConfig) {
|
||||
err := rs.sendRoutes(conn, utils.ConfigSendRoutesWhenConnected, routes)
|
||||
body, err := json.Marshal(routes)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
go func() {
|
||||
err := EmitConnWithTimeout(conn, utils.ConfigSendRoutesWhenConnected, body)
|
||||
if err != nil {
|
||||
log.Errorf(codes.RoutesServiceSendRoutesError, "send routes %v", err)
|
||||
log.Errorf(codes.RoutesServiceSendRoutesError, "send routes to %s: %v", conn.RemoteAddr(), err)
|
||||
}
|
||||
}(conn, routes)
|
||||
}()
|
||||
}
|
||||
|
||||
func (rs *routesService) BroadcastRoutes(mesh state.ReadonlyMesh) {
|
||||
routes := mesh.GetRoutes()
|
||||
go func(routes structure.RoutingConfig) {
|
||||
err := rs.broadcastRoutes(utils.ConfigSendRoutesChanged, routes)
|
||||
if err != nil {
|
||||
log.Errorf(codes.RoutesServiceSendRoutesError, "broadcast routes %v", err)
|
||||
}
|
||||
}(routes)
|
||||
}
|
||||
|
||||
func (rs *routesService) broadcastRoutes(event string, routes structure.RoutingConfig) error {
|
||||
if bytes, err := json.Marshal(routes); err != nil {
|
||||
return err
|
||||
} else {
|
||||
err = holder.EtpServer.BroadcastToRoom(RoutesSubscribersRoom, event, bytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
body, err := json.Marshal(routes)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rs *routesService) sendRoutes(conn etp.Conn, event string, routes structure.RoutingConfig) error {
|
||||
if bytes, err := json.Marshal(routes); err != nil {
|
||||
return err
|
||||
} else {
|
||||
bf := backoff.WithMaxRetries(backoff.NewConstantBackOff(100*time.Millisecond), 3)
|
||||
err := backoff.Retry(func() error {
|
||||
return conn.Emit(context.Background(), event, bytes)
|
||||
}, bf)
|
||||
if err != nil {
|
||||
return err
|
||||
go func() {
|
||||
conns := holder.EtpServer.Rooms().ToBroadcast(Room.RoutesSubscribers())
|
||||
for _, conn := range conns {
|
||||
err := EmitConnWithTimeout(conn, utils.ConfigSendRoutesChanged, body)
|
||||
if err != nil {
|
||||
log.Errorf(codes.RoutesServiceSendRoutesError, "broadcast routes to %s: %v", conn.RemoteAddr(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
}
|
||||
+1
-1
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
SchemaService schemaService
|
||||
Schema schemaService
|
||||
)
|
||||
|
||||
type schemaService struct{}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/domain"
|
||||
"isp-config-service/entity"
|
||||
"isp-config-service/holder"
|
||||
"isp-config-service/model"
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
|
||||
var (
|
||||
ConfigHistory = configHistoryService{}
|
||||
)
|
||||
|
||||
type configHistoryService struct{}
|
||||
|
||||
func (configHistoryService) HandleDeleteVersionConfigCommand(cfg cluster.Identity,
|
||||
state state.WritableState) cluster.ResponseWithError {
|
||||
state.WriteableVersionConfigStore().Delete(cfg.Id)
|
||||
var (
|
||||
deleted int
|
||||
err error
|
||||
)
|
||||
if holder.ClusterClient.IsLeader() {
|
||||
// TODO handle db errors
|
||||
deleted, err = model.VersionStoreRep.Delete(cfg.Id)
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"versionConfigId": cfg.Id,
|
||||
}).Errorf(codes.DatabaseOperationError, "delete configs: %v", err)
|
||||
}
|
||||
}
|
||||
return cluster.NewResponse(domain.DeleteResponse{Deleted: deleted})
|
||||
}
|
||||
|
||||
func (configHistoryService) GetAllVersionConfigById(id string, state state.ReadonlyState) []entity.VersionConfig {
|
||||
return state.VersionConfig().GetByConfigId(id)
|
||||
}
|
||||
|
||||
func (s configHistoryService) SaveConfigVersion(id string, oldConfig entity.Config,
|
||||
state state.WritableState, createdAt time.Time) {
|
||||
cfg := entity.VersionConfig{
|
||||
Id: id,
|
||||
ConfigVersion: oldConfig.Version,
|
||||
ConfigId: oldConfig.Id,
|
||||
Data: oldConfig.Data,
|
||||
CreatedAt: createdAt,
|
||||
}
|
||||
removedVersionId := state.WriteableVersionConfigStore().Update(cfg)
|
||||
if holder.ClusterClient.IsLeader() {
|
||||
s.updateDB(cfg, removedVersionId)
|
||||
}
|
||||
}
|
||||
|
||||
func (configHistoryService) updateDB(cfg entity.VersionConfig, removedId string) {
|
||||
_, err := model.VersionStoreRep.Upsert(cfg)
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"version_config": cfg,
|
||||
}).Errorf(codes.DatabaseOperationError, "upsert version config: %v", err)
|
||||
}
|
||||
if removedId != "" {
|
||||
_, err := model.VersionStoreRep.Delete(removedId)
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"version_config_id": removedId,
|
||||
}).Errorf(codes.DatabaseOperationError, "delete version config: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
-9
@@ -1,7 +1,9 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/pkg/errors"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/domain"
|
||||
@@ -15,7 +17,7 @@ func (s *Store) applyUpdateBackendDeclarationCommand(data []byte) (interface{},
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal structure.BackendDeclaration")
|
||||
}
|
||||
service.ClusterMeshService.HandleUpdateBackendDeclarationCommand(declaration, s.state)
|
||||
service.ClusterMesh.HandleUpdateBackendDeclarationCommand(declaration, s.state)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -25,7 +27,7 @@ func (s *Store) applyDeleteBackendDeclarationCommand(data []byte) (interface{},
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal structure.BackendDeclaration")
|
||||
}
|
||||
service.ClusterMeshService.HandleDeleteBackendDeclarationCommand(declaration, s.state)
|
||||
service.ClusterMesh.HandleDeleteBackendDeclarationCommand(declaration, s.state)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -35,7 +37,7 @@ func (s *Store) applyUpdateConfigSchemaCommand(data []byte) (interface{}, error)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal entity.ConfigSchema")
|
||||
}
|
||||
err = service.SchemaService.HandleUpdateConfigSchemaCommand(schema, s.state)
|
||||
err = service.Schema.HandleUpdateConfigSchemaCommand(schema, s.state)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "update config schema")
|
||||
}
|
||||
@@ -48,7 +50,7 @@ func (s *Store) applyModuleConnectedCommand(data []byte) (interface{}, error) {
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal entity.Module")
|
||||
}
|
||||
service.ModuleRegistryService.HandleModuleConnectedCommand(module, s.state)
|
||||
service.ModuleRegistry.HandleModuleConnectedCommand(module, s.state)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -58,7 +60,7 @@ func (s *Store) applyModuleDisconnectedCommand(data []byte) (interface{}, error)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal entity.Module")
|
||||
}
|
||||
service.ModuleRegistryService.HandleModuleDisconnectedCommand(module, s.state)
|
||||
service.ModuleRegistry.HandleModuleDisconnectedCommand(module, s.state)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -68,7 +70,7 @@ func (s *Store) applyDeleteModulesCommand(data []byte) (interface{}, error) {
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal cluster.DeleteModules")
|
||||
}
|
||||
deleted := service.ModuleRegistryService.HandleDeleteModulesCommand(deleteModules, s.state)
|
||||
deleted := service.ModuleRegistry.HandleDeleteModulesCommand(deleteModules, s.state)
|
||||
return domain.DeleteResponse{Deleted: deleted}, nil
|
||||
}
|
||||
|
||||
@@ -108,7 +110,7 @@ func (s *Store) applyDeleteCommonConfigsCommand(data []byte) (interface{}, error
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal cluster.DeleteCommonConfig")
|
||||
}
|
||||
response := service.CommonConfigService.HandleDeleteConfigsCommand(deleteConfigs, s.state)
|
||||
response := service.CommonConfig.HandleDeleteConfigsCommand(deleteConfigs, s.state)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@@ -118,6 +120,28 @@ func (s *Store) applyUpsertCommonConfigCommand(data []byte) (interface{}, error)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal cluster.UpsertCommonConfig")
|
||||
}
|
||||
response := service.CommonConfigService.HandleUpsertConfigCommand(config, s.state)
|
||||
response := service.CommonConfig.HandleUpsertConfigCommand(config, s.state)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (s *Store) applyBroadcastEventCommand(data []byte) (interface{}, error) {
|
||||
event := cluster.BroadcastEvent{}
|
||||
err := json.Unmarshal(data, &event)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal cluster.BroadcastEvent")
|
||||
}
|
||||
if event.PerformUntil.After(time.Now().UTC()) {
|
||||
service.Discovery.BroadcastEvent(event)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (s *Store) applyDeleteVersionConfigCommand(data []byte) (interface{}, error) {
|
||||
cfg := cluster.Identity{}
|
||||
err := json.Unmarshal(data, &cfg)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "unmarshal cluster.Identity")
|
||||
}
|
||||
response := service.ConfigHistory.HandleDeleteVersionConfigCommand(cfg, s.state)
|
||||
return response, nil
|
||||
}
|
||||
+11
-6
@@ -6,24 +6,29 @@ import (
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
|
||||
func NewStateFromRepository() (state.State, error) {
|
||||
func NewStateFromRepository() (*state.State, error) {
|
||||
configs, err := model.ConfigRep.Snapshot()
|
||||
if err != nil {
|
||||
return state.State{}, errors.WithMessage(err, "restore configs")
|
||||
return nil, errors.WithMessage(err, "restore configs")
|
||||
}
|
||||
schemas, err := model.SchemaRep.Snapshot()
|
||||
if err != nil {
|
||||
return state.State{}, errors.WithMessage(err, "load config schemas")
|
||||
return nil, errors.WithMessage(err, "load config schemas")
|
||||
}
|
||||
modules, err := model.ModuleRep.Snapshot()
|
||||
if err != nil {
|
||||
return state.State{}, errors.WithMessage(err, "load modules registry")
|
||||
return nil, errors.WithMessage(err, "load modules registry")
|
||||
}
|
||||
commonConfigs, err := model.CommonConfigRep.Snapshot()
|
||||
if err != nil {
|
||||
return state.State{}, errors.WithMessage(err, "load common configs")
|
||||
return nil, errors.WithMessage(err, "load common configs")
|
||||
}
|
||||
|
||||
st := state.NewStateFromSnapshot(configs, schemas, modules, commonConfigs)
|
||||
versionStore, err := model.VersionStoreRep.Snapshot()
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "load version store")
|
||||
}
|
||||
|
||||
st := state.NewStateFromSnapshot(configs, schemas, modules, commonConfigs, versionStore)
|
||||
return st, nil
|
||||
}
|
||||
@@ -18,13 +18,13 @@ type ReadonlyCommonConfigStore interface {
|
||||
}
|
||||
|
||||
type CommonConfigStore struct {
|
||||
configs []entity.CommonConfig
|
||||
Configs []entity.CommonConfig
|
||||
}
|
||||
|
||||
func (cs CommonConfigStore) GetByIds(ids []string) []entity.CommonConfig {
|
||||
idsMap := StringsToMap(ids)
|
||||
configs := make([]entity.CommonConfig, 0, len(ids))
|
||||
for _, config := range cs.configs {
|
||||
for _, config := range cs.Configs {
|
||||
if _, found := idsMap[config.Id]; found {
|
||||
configs = append(configs, config)
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (cs CommonConfigStore) GetByIds(ids []string) []entity.CommonConfig {
|
||||
|
||||
func (cs CommonConfigStore) GetByName(name string) []entity.CommonConfig {
|
||||
configs := make([]entity.CommonConfig, 0)
|
||||
for _, config := range cs.configs {
|
||||
for _, config := range cs.Configs {
|
||||
if config.Name == name {
|
||||
configs = append(configs, config)
|
||||
}
|
||||
@@ -49,14 +49,14 @@ func (cs *CommonConfigStore) Create(config entity.CommonConfig) entity.CommonCon
|
||||
if config.Data == nil {
|
||||
config.Data = make(entity.ConfigData)
|
||||
}
|
||||
cs.configs = append(cs.configs, config)
|
||||
cs.Configs = append(cs.Configs, config)
|
||||
return config
|
||||
}
|
||||
|
||||
func (cs *CommonConfigStore) UpdateById(config entity.CommonConfig) {
|
||||
for i := range cs.configs {
|
||||
if cs.configs[i].Id == config.Id {
|
||||
cs.configs[i] = config
|
||||
for i := range cs.Configs {
|
||||
if cs.Configs[i].Id == config.Id {
|
||||
cs.Configs[i] = config
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -65,12 +65,12 @@ func (cs *CommonConfigStore) UpdateById(config entity.CommonConfig) {
|
||||
func (cs *CommonConfigStore) DeleteByIds(ids []string) int {
|
||||
idsMap := StringsToMap(ids)
|
||||
var deleted int
|
||||
for i := 0; i < len(cs.configs); i++ {
|
||||
id := cs.configs[i].Id
|
||||
for i := 0; i < len(cs.Configs); i++ {
|
||||
id := cs.Configs[i].Id
|
||||
if _, ok := idsMap[id]; ok {
|
||||
// change configs ordering
|
||||
cs.configs[i] = cs.configs[len(cs.configs)-1]
|
||||
cs.configs = cs.configs[:len(cs.configs)-1]
|
||||
cs.Configs[i] = cs.Configs[len(cs.Configs)-1]
|
||||
cs.Configs = cs.Configs[:len(cs.Configs)-1]
|
||||
deleted++
|
||||
}
|
||||
}
|
||||
@@ -78,11 +78,11 @@ func (cs *CommonConfigStore) DeleteByIds(ids []string) int {
|
||||
}
|
||||
|
||||
func (cs *CommonConfigStore) GetAll() []entity.CommonConfig {
|
||||
response := make([]entity.CommonConfig, len(cs.configs))
|
||||
copy(response, cs.configs)
|
||||
response := make([]entity.CommonConfig, len(cs.Configs))
|
||||
copy(response, cs.Configs)
|
||||
return response
|
||||
}
|
||||
|
||||
func NewCommonConfigStore() *CommonConfigStore {
|
||||
return &CommonConfigStore{configs: make([]entity.CommonConfig, 0)}
|
||||
return &CommonConfigStore{Configs: make([]entity.CommonConfig, 0)}
|
||||
}
|
||||
+33
-31
@@ -1,8 +1,9 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"isp-config-service/entity"
|
||||
"time"
|
||||
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -25,12 +26,13 @@ type ReadonlyConfigStore interface {
|
||||
}
|
||||
|
||||
type ConfigStore struct {
|
||||
configs []entity.Config
|
||||
Configs []entity.Config
|
||||
}
|
||||
|
||||
func (cs ConfigStore) GetActiveByModuleId(moduleId string) *entity.Config {
|
||||
for _, conf := range cs.configs {
|
||||
if conf.ModuleId == moduleId && conf.Active {
|
||||
for i := range cs.Configs {
|
||||
if cs.Configs[i].ModuleId == moduleId && cs.Configs[i].Active {
|
||||
conf := cs.Configs[i]
|
||||
return &conf
|
||||
}
|
||||
}
|
||||
@@ -40,9 +42,9 @@ func (cs ConfigStore) GetActiveByModuleId(moduleId string) *entity.Config {
|
||||
func (cs ConfigStore) GetByIds(ids []string) []entity.Config {
|
||||
idsMap := StringsToMap(ids)
|
||||
result := make([]entity.Config, 0, len(ids))
|
||||
for _, conf := range cs.configs {
|
||||
if _, ok := idsMap[conf.Id]; ok {
|
||||
result = append(result, conf)
|
||||
for i := range cs.Configs {
|
||||
if _, ok := idsMap[cs.Configs[i].Id]; ok {
|
||||
result = append(result, cs.Configs[i])
|
||||
}
|
||||
}
|
||||
return result
|
||||
@@ -51,9 +53,9 @@ func (cs ConfigStore) GetByIds(ids []string) []entity.Config {
|
||||
func (cs ConfigStore) GetByModuleIds(ids []string) []entity.Config {
|
||||
idsMap := StringsToMap(ids)
|
||||
result := make([]entity.Config, 0, len(ids))
|
||||
for _, conf := range cs.configs {
|
||||
if _, ok := idsMap[conf.ModuleId]; ok {
|
||||
result = append(result, conf)
|
||||
for i := range cs.Configs {
|
||||
if _, ok := idsMap[cs.Configs[i].ModuleId]; ok {
|
||||
result = append(result, cs.Configs[i])
|
||||
}
|
||||
}
|
||||
return result
|
||||
@@ -73,14 +75,14 @@ func (cs *ConfigStore) Create(config entity.Config) entity.Config {
|
||||
if config.CommonConfigs == nil {
|
||||
config.CommonConfigs = make([]string, 0)
|
||||
}
|
||||
cs.configs = append(cs.configs, config)
|
||||
cs.Configs = append(cs.Configs, config)
|
||||
return config
|
||||
}
|
||||
|
||||
func (cs *ConfigStore) UpdateById(config entity.Config) {
|
||||
for i := range cs.configs {
|
||||
if cs.configs[i].Id == config.Id {
|
||||
cs.configs[i] = config
|
||||
for i := range cs.Configs {
|
||||
if cs.Configs[i].Id == config.Id {
|
||||
cs.Configs[i] = config
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -88,10 +90,10 @@ func (cs *ConfigStore) UpdateById(config entity.Config) {
|
||||
|
||||
func (cs *ConfigStore) calcNewVersion(moduleId string) int32 {
|
||||
var maxVersion int32 = 0
|
||||
for i := range cs.configs {
|
||||
if cs.configs[i].ModuleId == moduleId {
|
||||
if cs.configs[i].Version > maxVersion {
|
||||
maxVersion = cs.configs[i].Version
|
||||
for i := range cs.Configs {
|
||||
if cs.Configs[i].ModuleId == moduleId {
|
||||
if cs.Configs[i].Version > maxVersion {
|
||||
maxVersion = cs.Configs[i].Version
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,12 +103,12 @@ func (cs *ConfigStore) calcNewVersion(moduleId string) int32 {
|
||||
func (cs *ConfigStore) DeleteByIds(ids []string) int {
|
||||
idsMap := StringsToMap(ids)
|
||||
var deleted int
|
||||
for i := 0; i < len(cs.configs); i++ {
|
||||
id := cs.configs[i].Id
|
||||
for i := 0; i < len(cs.Configs); i++ {
|
||||
id := cs.Configs[i].Id
|
||||
if _, ok := idsMap[id]; ok {
|
||||
// change configs ordering
|
||||
cs.configs[i] = cs.configs[len(cs.configs)-1]
|
||||
cs.configs = cs.configs[:len(cs.configs)-1]
|
||||
cs.Configs[i] = cs.Configs[len(cs.Configs)-1]
|
||||
cs.Configs = cs.Configs[:len(cs.Configs)-1]
|
||||
deleted++
|
||||
}
|
||||
}
|
||||
@@ -124,11 +126,11 @@ func (cs *ConfigStore) Activate(config entity.Config, date time.Time) []entity.C
|
||||
|
||||
func (cs *ConfigStore) deactivate(moduleId string, date time.Time) []entity.Config {
|
||||
affected := make([]entity.Config, 0)
|
||||
for i := range cs.configs {
|
||||
if cs.configs[i].ModuleId == moduleId && cs.configs[i].Active {
|
||||
cs.configs[i].Active = false
|
||||
cs.configs[i].UpdatedAt = date
|
||||
affected = append(affected, cs.configs[i])
|
||||
for i := range cs.Configs {
|
||||
if cs.Configs[i].ModuleId == moduleId && cs.Configs[i].Active {
|
||||
cs.Configs[i].Active = false
|
||||
cs.Configs[i].UpdatedAt = date
|
||||
affected = append(affected, cs.Configs[i])
|
||||
}
|
||||
}
|
||||
return affected
|
||||
@@ -137,10 +139,10 @@ func (cs *ConfigStore) deactivate(moduleId string, date time.Time) []entity.Conf
|
||||
func (cs *ConfigStore) FilterByCommonConfigs(commonIds []string) []entity.Config {
|
||||
idsMap := StringsToMap(commonIds)
|
||||
result := make([]entity.Config, 0)
|
||||
for _, cfg := range cs.configs {
|
||||
for _, commonId := range cfg.CommonConfigs {
|
||||
for i := range cs.Configs {
|
||||
for _, commonId := range cs.Configs[i].CommonConfigs {
|
||||
if _, ok := idsMap[commonId]; ok {
|
||||
result = append(result, cfg)
|
||||
result = append(result, cs.Configs[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -149,5 +151,5 @@ func (cs *ConfigStore) FilterByCommonConfigs(commonIds []string) []entity.Config
|
||||
}
|
||||
|
||||
func NewConfigStore() *ConfigStore {
|
||||
return &ConfigStore{configs: make([]entity.Config, 0)}
|
||||
return &ConfigStore{Configs: make([]entity.Config, 0)}
|
||||
}
|
||||
+28
-52
@@ -1,7 +1,7 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
)
|
||||
|
||||
type WriteableMesh interface {
|
||||
@@ -11,8 +11,6 @@ type WriteableMesh interface {
|
||||
}
|
||||
|
||||
type ReadonlyMesh interface {
|
||||
CheckBackendChanged(backend structure.BackendDeclaration) (changed bool)
|
||||
BackendExist(backend structure.BackendDeclaration) (exist bool)
|
||||
GetModuleAddresses(moduleName string) []structure.AddressConfiguration
|
||||
GetBackends(module string) []structure.BackendDeclaration
|
||||
GetRoutes() structure.RoutingConfig
|
||||
@@ -22,22 +20,16 @@ type NodesMap map[string]structure.BackendDeclaration
|
||||
|
||||
type Mesh struct {
|
||||
// { "ModuleName": { "address": BackendDeclaration, ...}, ... }
|
||||
modulesMap map[string]NodesMap
|
||||
ModulesMap map[string]NodesMap
|
||||
}
|
||||
|
||||
func (m Mesh) BackendExist(backend structure.BackendDeclaration) (exist bool) {
|
||||
address := backend.Address.GetAddress()
|
||||
if nodes, ok := m.modulesMap[backend.ModuleName]; ok {
|
||||
if _, ok := nodes[address]; ok {
|
||||
exist = true
|
||||
}
|
||||
}
|
||||
return
|
||||
func NewMesh() *Mesh {
|
||||
return &Mesh{ModulesMap: make(map[string]NodesMap)}
|
||||
}
|
||||
|
||||
func (m Mesh) GetBackends(module string) []structure.BackendDeclaration {
|
||||
declarations := make([]structure.BackendDeclaration, 0)
|
||||
if nodes, ok := m.modulesMap[module]; ok {
|
||||
if nodes, ok := m.ModulesMap[module]; ok {
|
||||
for _, backend := range nodes {
|
||||
declarations = append(declarations, backend)
|
||||
}
|
||||
@@ -47,7 +39,7 @@ func (m Mesh) GetBackends(module string) []structure.BackendDeclaration {
|
||||
|
||||
func (m Mesh) GetModuleAddresses(moduleName string) []structure.AddressConfiguration {
|
||||
addressList := make([]structure.AddressConfiguration, 0)
|
||||
if nodes, ok := m.modulesMap[moduleName]; ok {
|
||||
if nodes, ok := m.ModulesMap[moduleName]; ok {
|
||||
for _, backend := range nodes {
|
||||
addressList = append(addressList, backend.Address)
|
||||
}
|
||||
@@ -57,63 +49,47 @@ func (m Mesh) GetModuleAddresses(moduleName string) []structure.AddressConfigura
|
||||
|
||||
func (m Mesh) GetRoutes() structure.RoutingConfig {
|
||||
routes := structure.RoutingConfig{}
|
||||
for _, node := range m.modulesMap {
|
||||
for _, backend := range node {
|
||||
for _, nodes := range m.ModulesMap {
|
||||
for _, backend := range nodes {
|
||||
routes = append(routes, backend)
|
||||
}
|
||||
}
|
||||
return routes
|
||||
}
|
||||
|
||||
func (m Mesh) CheckBackendChanged(backend structure.BackendDeclaration) (changed bool) {
|
||||
func (m *Mesh) UpsertBackend(backend structure.BackendDeclaration) bool {
|
||||
address := backend.Address.GetAddress()
|
||||
if nodes, ok := m.modulesMap[backend.ModuleName]; ok {
|
||||
if oldBackend, ok := nodes[address]; ok {
|
||||
if oldBackend.Version != backend.Version || !oldBackend.IsPathsEqual(backend.Endpoints) || oldBackend.LibVersion != backend.LibVersion {
|
||||
changed = true
|
||||
}
|
||||
} else {
|
||||
changed = true
|
||||
}
|
||||
} else {
|
||||
changed = true
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (m *Mesh) UpsertBackend(backend structure.BackendDeclaration) (changed bool) {
|
||||
address := backend.Address.GetAddress()
|
||||
if nodes, ok := m.modulesMap[backend.ModuleName]; ok {
|
||||
if oldBackend, ok := nodes[address]; ok {
|
||||
if oldBackend.Version != backend.Version || !oldBackend.IsPathsEqual(backend.Endpoints) || oldBackend.LibVersion != backend.LibVersion {
|
||||
nodes[address] = backend
|
||||
changed = true
|
||||
}
|
||||
} else {
|
||||
nodes[address] = backend
|
||||
changed = true
|
||||
}
|
||||
} else {
|
||||
m.modulesMap[backend.ModuleName] = NodesMap{address: backend}
|
||||
changed = true
|
||||
nodes, ok := m.ModulesMap[backend.ModuleName]
|
||||
if !ok {
|
||||
m.ModulesMap[backend.ModuleName] = NodesMap{address: backend}
|
||||
return true
|
||||
}
|
||||
return
|
||||
|
||||
old, ok := nodes[address]
|
||||
if !ok {
|
||||
nodes[address] = backend
|
||||
return true
|
||||
}
|
||||
|
||||
if old.Version != backend.Version || !old.IsPathsEqual(backend.Endpoints) || old.LibVersion != backend.LibVersion {
|
||||
nodes[address] = backend
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Mesh) DeleteBackend(backend structure.BackendDeclaration) (deleted bool) {
|
||||
address := backend.Address.GetAddress()
|
||||
if nodes, ok := m.modulesMap[backend.ModuleName]; ok {
|
||||
if nodes, ok := m.ModulesMap[backend.ModuleName]; ok {
|
||||
if _, ok := nodes[address]; ok {
|
||||
delete(nodes, address)
|
||||
deleted = true
|
||||
}
|
||||
if len(nodes) == 0 {
|
||||
delete(m.modulesMap, backend.ModuleName)
|
||||
delete(m.ModulesMap, backend.ModuleName)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func NewMesh() *Mesh {
|
||||
return &Mesh{modulesMap: make(map[string]NodesMap)}
|
||||
}
|
||||
+15
-15
@@ -18,11 +18,11 @@ type ReadonlyModuleStore interface {
|
||||
}
|
||||
|
||||
type ModuleStore struct {
|
||||
modules []entity.Module
|
||||
Modules []entity.Module
|
||||
}
|
||||
|
||||
func (ms ModuleStore) GetByName(name string) *entity.Module {
|
||||
for _, module := range ms.modules {
|
||||
for _, module := range ms.Modules {
|
||||
if module.Name == name {
|
||||
return &module
|
||||
}
|
||||
@@ -31,7 +31,7 @@ func (ms ModuleStore) GetByName(name string) *entity.Module {
|
||||
}
|
||||
|
||||
func (ms ModuleStore) GetById(id string) *entity.Module {
|
||||
for _, module := range ms.modules {
|
||||
for _, module := range ms.Modules {
|
||||
if module.Id == id {
|
||||
return &module
|
||||
}
|
||||
@@ -40,39 +40,39 @@ func (ms ModuleStore) GetById(id string) *entity.Module {
|
||||
}
|
||||
|
||||
func (ms *ModuleStore) UpdateByName(module entity.Module) {
|
||||
for i := range ms.modules {
|
||||
if ms.modules[i].Name == module.Name {
|
||||
ms.modules[i] = module
|
||||
for i := range ms.Modules {
|
||||
if ms.Modules[i].Name == module.Name {
|
||||
ms.Modules[i] = module
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (ms *ModuleStore) Create(module entity.Module) {
|
||||
ms.modules = append(ms.modules, module)
|
||||
ms.Modules = append(ms.Modules, module)
|
||||
}
|
||||
|
||||
func (ms *ModuleStore) DeleteByIds(ids []string) []entity.Module {
|
||||
idsMap := StringsToMap(ids)
|
||||
var deleted []entity.Module
|
||||
for i := 0; i < len(ms.modules); i++ {
|
||||
id := ms.modules[i].Id
|
||||
for i := 0; i < len(ms.Modules); i++ {
|
||||
id := ms.Modules[i].Id
|
||||
if _, ok := idsMap[id]; ok {
|
||||
// change modules ordering
|
||||
deleted = append(deleted, ms.modules[i])
|
||||
ms.modules[i] = ms.modules[len(ms.modules)-1]
|
||||
ms.modules = ms.modules[:len(ms.modules)-1]
|
||||
deleted = append(deleted, ms.Modules[i])
|
||||
ms.Modules[i] = ms.Modules[len(ms.Modules)-1]
|
||||
ms.Modules = ms.Modules[:len(ms.Modules)-1]
|
||||
}
|
||||
}
|
||||
return deleted
|
||||
}
|
||||
|
||||
func (ms *ModuleStore) GetAll() []entity.Module {
|
||||
response := make([]entity.Module, len(ms.modules))
|
||||
copy(response, ms.modules)
|
||||
response := make([]entity.Module, len(ms.Modules))
|
||||
copy(response, ms.Modules)
|
||||
return response
|
||||
}
|
||||
|
||||
func NewModuleStore() *ModuleStore {
|
||||
return &ModuleStore{modules: make([]entity.Module, 0)}
|
||||
return &ModuleStore{Modules: make([]entity.Module, 0)}
|
||||
}
|
||||
+10
-10
@@ -15,13 +15,13 @@ type ReadonlySchemaStore interface {
|
||||
}
|
||||
|
||||
type SchemaStore struct {
|
||||
schemas []entity.ConfigSchema
|
||||
Schemas []entity.ConfigSchema
|
||||
}
|
||||
|
||||
func (ss SchemaStore) GetByModuleIds(ids []string) []entity.ConfigSchema {
|
||||
idsMap := StringsToMap(ids)
|
||||
result := make([]entity.ConfigSchema, 0, len(ids))
|
||||
for _, schema := range ss.schemas {
|
||||
for _, schema := range ss.Schemas {
|
||||
if _, ok := idsMap[schema.ModuleId]; ok {
|
||||
result = append(result, schema)
|
||||
}
|
||||
@@ -32,12 +32,12 @@ func (ss SchemaStore) GetByModuleIds(ids []string) []entity.ConfigSchema {
|
||||
func (ss *SchemaStore) DeleteByIds(ids []string) int {
|
||||
idsMap := StringsToMap(ids)
|
||||
var deleted int
|
||||
for i := 0; i < len(ss.schemas); i++ {
|
||||
id := ss.schemas[i].Id
|
||||
for i := 0; i < len(ss.Schemas); i++ {
|
||||
id := ss.Schemas[i].Id
|
||||
if _, ok := idsMap[id]; ok {
|
||||
// change schemas ordering
|
||||
ss.schemas[i] = ss.schemas[len(ss.schemas)-1]
|
||||
ss.schemas = ss.schemas[:len(ss.schemas)-1]
|
||||
ss.Schemas[i] = ss.Schemas[len(ss.Schemas)-1]
|
||||
ss.Schemas = ss.Schemas[:len(ss.Schemas)-1]
|
||||
deleted++
|
||||
}
|
||||
}
|
||||
@@ -45,18 +45,18 @@ func (ss *SchemaStore) DeleteByIds(ids []string) int {
|
||||
}
|
||||
|
||||
func (ss *SchemaStore) Upsert(schema entity.ConfigSchema) entity.ConfigSchema {
|
||||
for key, value := range ss.schemas {
|
||||
for key, value := range ss.Schemas {
|
||||
if value.ModuleId == schema.ModuleId {
|
||||
schema.Id = value.Id
|
||||
schema.CreatedAt = value.CreatedAt
|
||||
ss.schemas[key] = schema
|
||||
ss.Schemas[key] = schema
|
||||
return schema
|
||||
}
|
||||
}
|
||||
ss.schemas = append(ss.schemas, schema)
|
||||
ss.Schemas = append(ss.Schemas, schema)
|
||||
return schema
|
||||
}
|
||||
|
||||
func NewSchemaStore() *SchemaStore {
|
||||
return &SchemaStore{schemas: make([]entity.ConfigSchema, 0)}
|
||||
return &SchemaStore{Schemas: make([]entity.ConfigSchema, 0)}
|
||||
}
|
||||
+43
-29
@@ -5,51 +5,60 @@ import (
|
||||
)
|
||||
|
||||
type State struct {
|
||||
mesh *Mesh
|
||||
configs *ConfigStore
|
||||
schemas *SchemaStore
|
||||
modules *ModuleStore
|
||||
commonConfigs *CommonConfigStore
|
||||
MeshStore *Mesh
|
||||
ConfigsStore *ConfigStore
|
||||
SchemasStore *SchemaStore
|
||||
ModulesStore *ModuleStore
|
||||
CommonConfigsStore *CommonConfigStore
|
||||
VersionConfigStore *VersionConfigStore
|
||||
}
|
||||
|
||||
func (s State) Mesh() ReadonlyMesh {
|
||||
return s.mesh
|
||||
return s.MeshStore
|
||||
}
|
||||
|
||||
func (s State) Configs() ReadonlyConfigStore {
|
||||
return s.configs
|
||||
return s.ConfigsStore
|
||||
}
|
||||
|
||||
func (s State) Schemas() ReadonlySchemaStore {
|
||||
return s.schemas
|
||||
return s.SchemasStore
|
||||
}
|
||||
|
||||
func (s State) Modules() ReadonlyModuleStore {
|
||||
return s.modules
|
||||
return s.ModulesStore
|
||||
}
|
||||
|
||||
func (s State) CommonConfigs() ReadonlyCommonConfigStore {
|
||||
return s.commonConfigs
|
||||
return s.CommonConfigsStore
|
||||
}
|
||||
|
||||
func (s State) VersionConfig() ReadonlyVersionConfigStore {
|
||||
return s.VersionConfigStore
|
||||
}
|
||||
|
||||
func (s *State) WritableMesh() WriteableMesh {
|
||||
return s.mesh
|
||||
return s.MeshStore
|
||||
}
|
||||
|
||||
func (s *State) WritableConfigs() WriteableConfigStore {
|
||||
return s.configs
|
||||
return s.ConfigsStore
|
||||
}
|
||||
|
||||
func (s *State) WritableSchemas() WriteableSchemaStore {
|
||||
return s.schemas
|
||||
return s.SchemasStore
|
||||
}
|
||||
|
||||
func (s *State) WritableModules() WriteableModuleStore {
|
||||
return s.modules
|
||||
return s.ModulesStore
|
||||
}
|
||||
|
||||
func (s *State) WritableCommonConfigs() WriteableCommonConfigStore {
|
||||
return s.commonConfigs
|
||||
return s.CommonConfigsStore
|
||||
}
|
||||
|
||||
func (s *State) WriteableVersionConfigStore() WriteableVersionConfigStore {
|
||||
return s.VersionConfigStore
|
||||
}
|
||||
|
||||
type WritableState interface {
|
||||
@@ -59,6 +68,7 @@ type WritableState interface {
|
||||
WritableSchemas() WriteableSchemaStore
|
||||
WritableModules() WriteableModuleStore
|
||||
WritableCommonConfigs() WriteableCommonConfigStore
|
||||
WriteableVersionConfigStore() WriteableVersionConfigStore
|
||||
}
|
||||
|
||||
type ReadonlyState interface {
|
||||
@@ -67,24 +77,28 @@ type ReadonlyState interface {
|
||||
Schemas() ReadonlySchemaStore
|
||||
Modules() ReadonlyModuleStore
|
||||
CommonConfigs() ReadonlyCommonConfigStore
|
||||
VersionConfig() ReadonlyVersionConfigStore
|
||||
}
|
||||
|
||||
func NewState() State {
|
||||
return State{
|
||||
mesh: NewMesh(),
|
||||
configs: NewConfigStore(),
|
||||
schemas: NewSchemaStore(),
|
||||
modules: NewModuleStore(),
|
||||
commonConfigs: NewCommonConfigStore(),
|
||||
func NewState() *State {
|
||||
return &State{
|
||||
MeshStore: NewMesh(),
|
||||
ConfigsStore: NewConfigStore(),
|
||||
SchemasStore: NewSchemaStore(),
|
||||
ModulesStore: NewModuleStore(),
|
||||
CommonConfigsStore: NewCommonConfigStore(),
|
||||
VersionConfigStore: NewVersionConfigStore(),
|
||||
}
|
||||
}
|
||||
|
||||
func NewStateFromSnapshot(configs []entity.Config, schemas []entity.ConfigSchema, modules []entity.Module, commConfigs []entity.CommonConfig) State {
|
||||
return State{
|
||||
mesh: NewMesh(),
|
||||
configs: &ConfigStore{configs: configs},
|
||||
schemas: &SchemaStore{schemas: schemas},
|
||||
modules: &ModuleStore{modules: modules},
|
||||
commonConfigs: &CommonConfigStore{configs: commConfigs},
|
||||
func NewStateFromSnapshot(configs []entity.Config, schemas []entity.ConfigSchema,
|
||||
modules []entity.Module, commConfigs []entity.CommonConfig, versionStore []entity.VersionConfig) *State {
|
||||
return &State{
|
||||
MeshStore: NewMesh(),
|
||||
ConfigsStore: &ConfigStore{Configs: configs},
|
||||
SchemasStore: &SchemaStore{Schemas: schemas},
|
||||
ModulesStore: &ModuleStore{Modules: modules},
|
||||
CommonConfigsStore: &CommonConfigStore{Configs: commConfigs},
|
||||
VersionConfigStore: NewVersionConfigStoreFromSnapshot(versionStore),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/v2/config"
|
||||
"isp-config-service/conf"
|
||||
"isp-config-service/entity"
|
||||
)
|
||||
|
||||
const DefaultVersionCount = 15
|
||||
|
||||
type WriteableVersionConfigStore interface {
|
||||
ReadonlyVersionConfigStore
|
||||
Update(config entity.VersionConfig) (removedId string)
|
||||
Delete(id string)
|
||||
}
|
||||
|
||||
type ReadonlyVersionConfigStore interface {
|
||||
GetByConfigId(id string) []entity.VersionConfig
|
||||
}
|
||||
|
||||
type VersionConfigStore struct {
|
||||
VersionByConfigId map[string][]entity.VersionConfig
|
||||
}
|
||||
|
||||
func (s *VersionConfigStore) Update(req entity.VersionConfig) string {
|
||||
limit := config.Get().(*conf.Configuration).VersionConfigCount
|
||||
if limit <= 0 {
|
||||
limit = DefaultVersionCount
|
||||
}
|
||||
var removedId string
|
||||
store, found := s.VersionByConfigId[req.ConfigId]
|
||||
if found {
|
||||
if len(store) >= limit {
|
||||
removedId = store[0].Id
|
||||
store = append(store[1:], req)
|
||||
} else {
|
||||
store = append(store, req)
|
||||
}
|
||||
} else {
|
||||
store = []entity.VersionConfig{req}
|
||||
}
|
||||
s.VersionByConfigId[req.ConfigId] = store
|
||||
return removedId
|
||||
}
|
||||
|
||||
func (s *VersionConfigStore) Delete(id string) {
|
||||
for cfgId, versionCfg := range s.VersionByConfigId {
|
||||
for i, versionConfig := range versionCfg {
|
||||
if versionConfig.Id == id {
|
||||
newVersionCfg := versionCfg[:i+copy(versionCfg[i:], versionCfg[i+1:])]
|
||||
if len(newVersionCfg) == 0 {
|
||||
delete(s.VersionByConfigId, cfgId)
|
||||
} else {
|
||||
s.VersionByConfigId[cfgId] = newVersionCfg
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s VersionConfigStore) GetByConfigId(id string) []entity.VersionConfig {
|
||||
response, found := s.VersionByConfigId[id]
|
||||
if found {
|
||||
return s.reverse(response)
|
||||
}
|
||||
return []entity.VersionConfig{}
|
||||
}
|
||||
|
||||
func (s VersionConfigStore) reverse(cfg []entity.VersionConfig) []entity.VersionConfig {
|
||||
for i, j := 0, len(cfg)-1; i < j; i, j = i+1, j-1 {
|
||||
cfg[i], cfg[j] = cfg[j], cfg[i]
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
func NewVersionConfigStore() *VersionConfigStore {
|
||||
return &VersionConfigStore{
|
||||
VersionByConfigId: make(map[string][]entity.VersionConfig),
|
||||
}
|
||||
}
|
||||
|
||||
func NewVersionConfigStoreFromSnapshot(req []entity.VersionConfig) *VersionConfigStore {
|
||||
store := NewVersionConfigStore()
|
||||
for i := 0; i < len(req); i++ {
|
||||
_ = store.Update(req[i])
|
||||
}
|
||||
return store
|
||||
}
|
||||
+20
-13
@@ -1,17 +1,18 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"github.com/hashicorp/raft"
|
||||
log "github.com/integration-system/isp-log"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/mohae/deepcopy"
|
||||
"github.com/pkg/errors"
|
||||
"io"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/store/state"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -21,18 +22,18 @@ var (
|
||||
type Store struct {
|
||||
state *state.State
|
||||
lock sync.RWMutex
|
||||
handlers map[uint64]func([]byte) (interface{}, error)
|
||||
handlers map[cluster.Command]func([]byte) (interface{}, error)
|
||||
}
|
||||
|
||||
func (s *Store) Apply(l *raft.Log) interface{} {
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
|
||||
if len(l.Data) < 8 {
|
||||
if len(l.Data) < cluster.CommandSizeBytes {
|
||||
log.Errorf(codes.ApplyLogCommandError, "invalid log data command: %s", l.Data)
|
||||
}
|
||||
command := binary.BigEndian.Uint64(l.Data[:8])
|
||||
log.Debugf(0, "Apply %d command. Data: %s", command, l.Data)
|
||||
command := cluster.ParseCommand(l.Data)
|
||||
log.Debugf(0, "Apply %s. Data: %s", command, l.Data)
|
||||
|
||||
var (
|
||||
result interface{}
|
||||
@@ -41,7 +42,11 @@ func (s *Store) Apply(l *raft.Log) interface{} {
|
||||
if handler, ok := s.handlers[command]; ok {
|
||||
result, err = handler(l.Data[8:])
|
||||
} else {
|
||||
log.Errorf(codes.ApplyLogCommandError, "unknown log command %d", command)
|
||||
err = fmt.Errorf("unknown log command %d", command)
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"command": command,
|
||||
"body": string(l.Data),
|
||||
}).Error(codes.ApplyLogCommandError, "unknown log command")
|
||||
}
|
||||
|
||||
bytes, e := json.Marshal(result)
|
||||
@@ -58,7 +63,7 @@ func (s *Store) Apply(l *raft.Log) interface{} {
|
||||
|
||||
func (s *Store) Snapshot() (raft.FSMSnapshot, error) {
|
||||
s.lock.Lock()
|
||||
copied := deepcopy.Copy(s.state).(state.State)
|
||||
copied := deepcopy.Copy(s.state).(*state.State)
|
||||
s.lock.Unlock()
|
||||
return &fsmSnapshot{copied}, nil
|
||||
}
|
||||
@@ -86,7 +91,7 @@ func (s *Store) VisitState(f func(writableState state.WritableState)) {
|
||||
}
|
||||
|
||||
type fsmSnapshot struct {
|
||||
state state.State
|
||||
state *state.State
|
||||
}
|
||||
|
||||
func (f *fsmSnapshot) Persist(sink raft.SnapshotSink) error {
|
||||
@@ -109,11 +114,11 @@ func (f *fsmSnapshot) Persist(sink raft.SnapshotSink) error {
|
||||
|
||||
func (f *fsmSnapshot) Release() {}
|
||||
|
||||
func NewStateStore(st state.State) *Store {
|
||||
func NewStateStore(st *state.State) *Store {
|
||||
store := &Store{
|
||||
state: &st,
|
||||
state: st,
|
||||
}
|
||||
store.handlers = map[uint64]func([]byte) (interface{}, error){
|
||||
store.handlers = map[cluster.Command]func([]byte) (interface{}, error){
|
||||
cluster.UpdateBackendDeclarationCommand: store.applyUpdateBackendDeclarationCommand,
|
||||
cluster.DeleteBackendDeclarationCommand: store.applyDeleteBackendDeclarationCommand,
|
||||
cluster.ModuleConnectedCommand: store.applyModuleConnectedCommand,
|
||||
@@ -125,6 +130,8 @@ func NewStateStore(st state.State) *Store {
|
||||
cluster.UpsertConfigCommand: store.applyUpsertConfigCommand,
|
||||
cluster.DeleteCommonConfigsCommand: store.applyDeleteCommonConfigsCommand,
|
||||
cluster.UpsertCommonConfigCommand: store.applyUpsertCommonConfigCommand,
|
||||
cluster.BroadcastEventCommand: store.applyBroadcastEventCommand,
|
||||
cluster.DeleteVersionConfigCommand: store.applyDeleteVersionConfigCommand,
|
||||
}
|
||||
return store
|
||||
}
|
||||
+24
-21
@@ -2,12 +2,14 @@ package subs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/asaskevich/govalidator"
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"github.com/integration-system/isp-lib/bootstrap"
|
||||
schema2 "github.com/integration-system/isp-lib/config/schema"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/bootstrap"
|
||||
schema2 "github.com/integration-system/isp-lib/v2/config/schema"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/entity"
|
||||
@@ -15,7 +17,7 @@ import (
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
|
||||
func (h *socketEventHandler) handleModuleReady(conn etp.Conn, data []byte) []byte {
|
||||
func (h *SocketEventHandler) handleModuleReady(conn etp.Conn, data []byte) []byte {
|
||||
moduleName, _ := Parameters(conn) // REMOVE
|
||||
log.Debugf(0, "handleModuleReady moduleName: %s", moduleName) // REMOVE
|
||||
declaration := structure.BackendDeclaration{}
|
||||
@@ -30,14 +32,14 @@ func (h *socketEventHandler) handleModuleReady(conn etp.Conn, data []byte) []byt
|
||||
}
|
||||
SetBackendDeclaration(conn, declaration)
|
||||
command := cluster.PrepareUpdateBackendDeclarationCommand(declaration)
|
||||
_, err = SyncApplyCommand(command, "UpdateBackendDeclarationCommand")
|
||||
_, err = SyncApplyCommand(command)
|
||||
if err != nil {
|
||||
return []byte(err.Error())
|
||||
}
|
||||
return []byte(utils.WsOkResponse)
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) handleModuleRequirements(conn etp.Conn, data []byte) []byte {
|
||||
func (h *SocketEventHandler) handleModuleRequirements(conn etp.Conn, data []byte) []byte {
|
||||
moduleName, err := Parameters(conn)
|
||||
log.Debugf(0, "handleModuleRequirements moduleName: %s", moduleName) // REMOVE
|
||||
if err != nil {
|
||||
@@ -51,15 +53,15 @@ func (h *socketEventHandler) handleModuleRequirements(conn etp.Conn, data []byte
|
||||
}
|
||||
|
||||
h.store.VisitReadonlyState(func(state state.ReadonlyState) {
|
||||
service.DiscoveryService.Subscribe(conn, declaration.RequiredModules, state.Mesh())
|
||||
service.Discovery.Subscribe(conn, declaration.RequiredModules, state.Mesh())
|
||||
if declaration.RequireRoutes {
|
||||
service.RoutesService.SubscribeRoutes(conn, state.Mesh())
|
||||
service.Routes.SubscribeRoutes(conn, state.Mesh())
|
||||
}
|
||||
})
|
||||
return []byte(utils.WsOkResponse)
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) handleConfigSchema(conn etp.Conn, data []byte) []byte {
|
||||
func (h *SocketEventHandler) handleConfigSchema(conn etp.Conn, data []byte) []byte {
|
||||
moduleName, err := Parameters(conn)
|
||||
log.Debugf(0, "handleConfigSchema moduleName: %s", moduleName) // REMOVE
|
||||
if err != nil {
|
||||
@@ -89,13 +91,16 @@ func (h *socketEventHandler) handleConfigSchema(conn etp.Conn, data []byte) []by
|
||||
UpdatedAt: now,
|
||||
}
|
||||
command := cluster.PrepareUpdateConfigSchemaCommand(schema)
|
||||
_, _ = SyncApplyCommand(command, "UpdateConfigSchemaCommand")
|
||||
_, _ = SyncApplyCommand(command)
|
||||
|
||||
var configs []entity.Config
|
||||
h.store.VisitReadonlyState(func(readState state.ReadonlyState) {
|
||||
configs = readState.Configs().GetByModuleIds([]string{module.Id})
|
||||
})
|
||||
if len(configs) == 0 && len(configSchema.DefaultConfig) > 0 {
|
||||
if len(configs) == 0 { // create empty default config
|
||||
if configSchema.DefaultConfig == nil {
|
||||
configSchema.DefaultConfig = make(map[string]interface{})
|
||||
}
|
||||
config := entity.Config{
|
||||
Id: state.GenerateId(),
|
||||
Name: module.Name,
|
||||
@@ -105,17 +110,15 @@ func (h *socketEventHandler) handleConfigSchema(conn etp.Conn, data []byte) []by
|
||||
UpdatedAt: now,
|
||||
}
|
||||
upsertConfig := cluster.UpsertConfig{
|
||||
Config: config,
|
||||
Create: true,
|
||||
Unsafe: true,
|
||||
Config: config,
|
||||
Create: true,
|
||||
Unsafe: true,
|
||||
VersionId: state.GenerateId(),
|
||||
VersionCreateAt: time.Now(),
|
||||
}
|
||||
|
||||
command := cluster.PrepareUpsertConfigCommand(upsertConfig)
|
||||
_, _ = SyncApplyCommand(command, "UpsertConfigCommand")
|
||||
_, _ = SyncApplyCommand(command)
|
||||
}
|
||||
return []byte(utils.WsOkResponse)
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) handleRequestConfig(conn etp.Conn, data []byte) []byte {
|
||||
panic("not implemented")
|
||||
}
|
||||
+10
-6
@@ -1,25 +1,29 @@
|
||||
package subs
|
||||
|
||||
import (
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"fmt"
|
||||
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/holder"
|
||||
)
|
||||
|
||||
func (h *socketEventHandler) applyCommandOnLeader(conn etp.Conn, cmd []byte) []byte {
|
||||
obj, err := holder.ClusterClient.SyncApplyOnLeader(cmd)
|
||||
func (h *SocketEventHandler) applyCommandOnLeader(_ etp.Conn, cmd []byte) (data []byte) {
|
||||
cmdCopy := make([]byte, len(cmd))
|
||||
copy(cmdCopy, cmd)
|
||||
obj, err := holder.ClusterClient.SyncApplyOnLeader(cmdCopy)
|
||||
if err != nil {
|
||||
var logResponse cluster.ApplyLogResponse
|
||||
logResponse.ApplyError = err.Error()
|
||||
data, err := json.Marshal(obj)
|
||||
logResponse.ApplyError = fmt.Sprintf("SyncApplyOnLeader: %v", err)
|
||||
data, err = json.Marshal(logResponse)
|
||||
if err != nil {
|
||||
log.Fatalf(codes.SyncApplyError, "marshaling ApplyLogResponse: %v", err)
|
||||
}
|
||||
return data
|
||||
}
|
||||
data, err := json.Marshal(obj)
|
||||
data, err = json.Marshal(obj)
|
||||
if err != nil {
|
||||
log.Fatalf(codes.SyncApplyError, "marshaling ApplyLogResponse: %v", err)
|
||||
}
|
||||
|
||||
+4
-6
@@ -1,9 +1,9 @@
|
||||
package subs
|
||||
|
||||
import (
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/structure"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
"isp-config-service/cluster"
|
||||
)
|
||||
|
||||
@@ -12,13 +12,11 @@ type connectionState struct {
|
||||
}
|
||||
|
||||
func IsConfigClusterNode(conn etp.Conn) bool {
|
||||
isCluster := conn.URL().Query().Get(cluster.ClusterParam)
|
||||
isCluster := conn.URL().Query().Get(cluster.GETParam)
|
||||
return isCluster == "true"
|
||||
|
||||
}
|
||||
|
||||
func Parameters(conn etp.Conn) (moduleName string, err error) {
|
||||
// TODO remove instanceUUID from isp-lib
|
||||
_, moduleName, err = utils.ParseParameters(conn.URL().RawQuery)
|
||||
return moduleName, err
|
||||
}
|
||||
|
||||
+13
-6
@@ -1,16 +1,18 @@
|
||||
package subs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
"isp-config-service/holder"
|
||||
"isp-config-service/service"
|
||||
)
|
||||
|
||||
func EmitConn(conn etp.Conn, event string, body []byte) {
|
||||
err := conn.Emit(context.Background(), event, body)
|
||||
err := service.EmitConnWithTimeout(conn, event, body)
|
||||
if err != nil {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"event": event,
|
||||
@@ -18,13 +20,18 @@ func EmitConn(conn etp.Conn, event string, body []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func SyncApplyCommand(command []byte, commandName string) (interface{}, error) {
|
||||
func SyncApplyCommand(command []byte) (interface{}, error) {
|
||||
applyLogResponse, err := holder.ClusterClient.SyncApply(command)
|
||||
if err != nil {
|
||||
log.Warnf(codes.SyncApplyError, "apply %s: %v", commandName, err)
|
||||
commandName := cluster.ParseCommand(command).String()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"command": string(command),
|
||||
"commandName": commandName,
|
||||
}).Warnf(codes.SyncApplyError, "apply command: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
if applyLogResponse != nil && applyLogResponse.ApplyError != "" {
|
||||
commandName := cluster.ParseCommand(command).String()
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"result": string(applyLogResponse.Result),
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
@@ -37,7 +44,7 @@ func SyncApplyCommand(command []byte, commandName string) (interface{}, error) {
|
||||
|
||||
func FormatErrorConnection(err error) []byte {
|
||||
errMap := map[string]interface{}{
|
||||
"error": err,
|
||||
"error": err.Error(),
|
||||
}
|
||||
data, _ := json.Marshal(errMap)
|
||||
return data
|
||||
|
||||
+20
-29
@@ -1,8 +1,8 @@
|
||||
package subs
|
||||
|
||||
import (
|
||||
etp "github.com/integration-system/isp-etp-go"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
etp "github.com/integration-system/isp-etp-go/v2"
|
||||
"github.com/integration-system/isp-lib/v2/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"isp-config-service/cluster"
|
||||
@@ -14,20 +14,16 @@ import (
|
||||
"isp-config-service/store/state"
|
||||
)
|
||||
|
||||
const (
|
||||
followersRoom = "cluster_followers"
|
||||
)
|
||||
|
||||
var (
|
||||
json = jsoniter.ConfigFastest
|
||||
)
|
||||
|
||||
type socketEventHandler struct {
|
||||
type SocketEventHandler struct {
|
||||
server etp.Server
|
||||
store *store.Store
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) SubscribeAll() {
|
||||
func (h *SocketEventHandler) SubscribeAll() {
|
||||
h.server.
|
||||
OnConnect(h.handleConnect).
|
||||
OnDisconnect(h.handleDisconnect).
|
||||
@@ -38,19 +34,16 @@ func (h *socketEventHandler) SubscribeAll() {
|
||||
OnWithAck(utils.ModuleSendConfigSchema, h.handleConfigSchema)
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) handleConnect(conn etp.Conn) {
|
||||
func (h *SocketEventHandler) handleConnect(conn etp.Conn) {
|
||||
isClusterNode := IsConfigClusterNode(conn)
|
||||
if isClusterNode {
|
||||
holder.EtpServer.Rooms().Join(conn, followersRoom)
|
||||
}
|
||||
moduleName, err := Parameters(conn)
|
||||
log.Debugf(0, "handleConnect: %s", moduleName) // REMOVE
|
||||
log.Debugf(0, "handleConnect from %s", moduleName) // REMOVE
|
||||
if err != nil {
|
||||
EmitConn(conn, utils.ErrorConnection, FormatErrorConnection(err))
|
||||
_ = conn.Close()
|
||||
return
|
||||
}
|
||||
holder.EtpServer.Rooms().Join(conn, moduleName+service.ConfigWatchersRoomSuffix)
|
||||
holder.EtpServer.Rooms().Join(conn, service.Room.Module(moduleName))
|
||||
now := state.GenerateDate()
|
||||
module := entity.Module{
|
||||
Id: state.GenerateId(),
|
||||
@@ -59,7 +52,7 @@ func (h *socketEventHandler) handleConnect(conn etp.Conn) {
|
||||
LastConnectedAt: now,
|
||||
}
|
||||
command := cluster.PrepareModuleConnectedCommand(module)
|
||||
_, err = SyncApplyCommand(command, "ModuleConnectedCommand")
|
||||
_, err = SyncApplyCommand(command)
|
||||
if err != nil && !isClusterNode {
|
||||
EmitConn(conn, utils.ErrorConnection, FormatErrorConnection(err))
|
||||
_ = conn.Close()
|
||||
@@ -86,14 +79,11 @@ func (h *socketEventHandler) handleConnect(conn etp.Conn) {
|
||||
EmitConn(conn, utils.ConfigSendConfigWhenConnected, data)
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) handleDisconnect(conn etp.Conn, disconnectErr error) {
|
||||
if IsConfigClusterNode(conn) {
|
||||
holder.EtpServer.Rooms().Leave(conn, followersRoom)
|
||||
}
|
||||
func (h *SocketEventHandler) handleDisconnect(conn etp.Conn, _ error) {
|
||||
moduleName, _ := Parameters(conn)
|
||||
log.Debugf(0, "handleDisconnect: %s", moduleName) // REMOVE
|
||||
log.Debugf(0, "websocket handleDisconnect from module '%s' addr '%s'", moduleName, conn.RemoteAddr())
|
||||
if moduleName != "" {
|
||||
holder.EtpServer.Rooms().Leave(conn, moduleName+service.ConfigWatchersRoomSuffix)
|
||||
holder.EtpServer.Rooms().Leave(conn, service.Room.Module(moduleName))
|
||||
now := state.GenerateDate()
|
||||
module := entity.Module{
|
||||
Id: state.GenerateId(),
|
||||
@@ -103,24 +93,25 @@ func (h *socketEventHandler) handleDisconnect(conn etp.Conn, disconnectErr error
|
||||
LastDisconnectedAt: now,
|
||||
}
|
||||
command := cluster.PrepareModuleDisconnectedCommand(module)
|
||||
_, _ = SyncApplyCommand(command, "ModuleDisconnectedCommand")
|
||||
_, _ = SyncApplyCommand(command)
|
||||
}
|
||||
|
||||
service.DiscoveryService.HandleDisconnect(conn.ID())
|
||||
service.RoutesService.HandleDisconnect(conn.ID())
|
||||
service.Discovery.HandleDisconnect(conn.ID())
|
||||
service.Routes.HandleDisconnect(conn.ID())
|
||||
backend, ok := ExtractBackendDeclaration(conn)
|
||||
if ok {
|
||||
command := cluster.PrepareDeleteBackendDeclarationCommand(backend)
|
||||
_, _ = SyncApplyCommand(command, "DeleteBackendDeclarationCommand")
|
||||
_, _ = SyncApplyCommand(command)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *socketEventHandler) handleError(conn etp.Conn, err error) {
|
||||
log.Warnf(codes.WebsocketError, "isp-etp: %v", err)
|
||||
func (h *SocketEventHandler) handleError(conn etp.Conn, err error) {
|
||||
moduleName, _ := Parameters(conn)
|
||||
log.Warnf(codes.WebsocketError, "websocket handleError module '%s' from %s: %v", moduleName, conn.RemoteAddr(), err)
|
||||
}
|
||||
|
||||
func NewSocketEventHandler(server etp.Server, store *store.Store) *socketEventHandler {
|
||||
return &socketEventHandler{
|
||||
func NewSocketEventHandler(server etp.Server, store *store.Store) *SocketEventHandler {
|
||||
return &SocketEventHandler{
|
||||
server: server,
|
||||
store: store,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user