Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
050c7bc51f | ||
|
|
775edf889c | ||
|
|
c0e69cec76 | ||
|
|
644c3f278e | ||
|
|
03e84301cc | ||
|
|
ce953e3799 | ||
|
|
677fe21eb8 | ||
|
|
0276feb0e7 | ||
|
|
4d6a7a4c0b | ||
|
|
c8dfcc61fc | ||
|
|
baa80464a4 | ||
|
|
677432de7b | ||
|
|
7b4d8ff7ef | ||
|
|
a8e430e97a | ||
|
|
2cbf355f5f | ||
|
|
ead505d40c | ||
|
|
a39a53561e | ||
|
|
ebf715c368 | ||
|
|
77b18a0382 | ||
|
|
87f2c360c5 | ||
|
|
b0584b4ead | ||
|
|
1575a4cc34 | ||
|
|
1bc12d7a33 | ||
|
|
89707ff412 | ||
|
|
33b9e220d3 | ||
|
|
d3e39f66a2 | ||
|
|
48a991e11b | ||
|
|
3ef79e51ca | ||
|
|
d945add7a0 | ||
|
|
2e0e25de42 | ||
|
|
334043947a | ||
|
|
e5e8f2b962 | ||
|
|
a16ecbc8a9 | ||
|
|
3c6e9c75a9 | ||
|
|
980bcb2eb5 | ||
|
|
3b73722bca | ||
|
|
15f7a970b1 | ||
|
|
e6083dbe81 | ||
|
|
54a77441fd | ||
|
|
353cf671da | ||
|
|
02c280009b | ||
|
|
379db84504 | ||
|
|
bd56df8ed8 |
No files matched your search
@@ -0,0 +1,9 @@
|
|||||||
|
### v1.2.2
|
||||||
|
* add migrations temp
|
||||||
|
### v1.2.1
|
||||||
|
* fix doc generate
|
||||||
|
### v1.2.0
|
||||||
|
* add method `GetSchemaByModuleId`
|
||||||
|
### v1.1.0
|
||||||
|
* update libs
|
||||||
|
* default config handling
|
||||||
Generated
+132
-113
@@ -26,12 +26,12 @@
|
|||||||
version = "v0.1.1"
|
version = "v0.1.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:553f73a4171c265045ae4f5d3122429ecf2c9c0c232c91f336127fe45480104a"
|
digest = "1:c1100fc71e23b6a32b2c68a5202a848fd13811d5a10b12edb8019c3667d1cd9a"
|
||||||
name = "github.com/cenkalti/backoff"
|
name = "github.com/cenkalti/backoff"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "62661b46c4093e2c1f38d943e663db1a29873e80"
|
revision = "4b4cebaf850ec58f1bb1fec5bdebdf8501c2bc3f"
|
||||||
version = "v2.1.0"
|
version = "v3.0.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd"
|
digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd"
|
||||||
@@ -42,50 +42,56 @@
|
|||||||
version = "v1.4.7"
|
version = "v1.4.7"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:64a5a67c69b70c2420e607a8545d674a23778ed9c3e80607bfd17b77c6c87f6a"
|
digest = "1:440028f55cb322d8cb5b9d5ebec298a00b7d74690a658fe6b1c0c0b44341bfae"
|
||||||
name = "github.com/go-ole/go-ole"
|
name = "github.com/go-ole/go-ole"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
"oleutil",
|
"oleutil",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506"
|
revision = "97b6244175ae18ea6eef668034fd6565847501c9"
|
||||||
version = "v1.2.1"
|
version = "v1.2.4"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:e7f1117ec9d37b59ba6d70bbd8feaa9cd2d1c6f676dc88ee152f5a57908fea4b"
|
digest = "1:f9448bfab8ebe44e3d91e4e4475cf92d60789a614652f361df4e41972c9d5caf"
|
||||||
name = "github.com/go-pg/pg"
|
name = "github.com/go-pg/pg"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
"internal",
|
"internal",
|
||||||
|
"internal/iszero",
|
||||||
"internal/parser",
|
"internal/parser",
|
||||||
"internal/pool",
|
"internal/pool",
|
||||||
|
"internal/struct_filter",
|
||||||
|
"internal/tag",
|
||||||
"orm",
|
"orm",
|
||||||
"types",
|
"types",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "514bed76d8f579d6ff8d40294fa77e476a5c1b3f"
|
revision = "1d957cb20f319c4a1e2db7d345824c12aefe5943"
|
||||||
version = "v6.15.0"
|
version = "v8.0.6"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:fa5e9e1af8a8645086811ec5ab003806026babc57c8bb3a6f7e1ab34b80e2ff1"
|
digest = "1:b532ee3f683c057e797694b5bfeb3827d89e6adf41c53dbc80e549bca76364ea"
|
||||||
name = "github.com/golang/protobuf"
|
name = "github.com/golang/protobuf"
|
||||||
packages = [
|
packages = [
|
||||||
"jsonpb",
|
"jsonpb",
|
||||||
"proto",
|
"proto",
|
||||||
"protoc-gen-go/descriptor",
|
"protoc-gen-go/descriptor",
|
||||||
|
"protoc-gen-go/generator",
|
||||||
|
"protoc-gen-go/generator/internal/remap",
|
||||||
|
"protoc-gen-go/plugin",
|
||||||
"ptypes",
|
"ptypes",
|
||||||
"ptypes/any",
|
"ptypes/any",
|
||||||
"ptypes/duration",
|
"ptypes/duration",
|
||||||
"ptypes/struct",
|
"ptypes/struct",
|
||||||
"ptypes/timestamp",
|
"ptypes/timestamp",
|
||||||
|
"ptypes/wrappers",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
|
revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7"
|
||||||
version = "v1.2.0"
|
version = "v1.3.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
digest = "1:324591cd9122f94cc39a87bd44ec71153672c239e2cff5743bfad96b60be3749"
|
digest = "1:324591cd9122f94cc39a87bd44ec71153672c239e2cff5743bfad96b60be3749"
|
||||||
name = "github.com/googollee/go-engine.io"
|
name = "github.com/googollee/go-engine.io"
|
||||||
packages = [
|
packages = [
|
||||||
@@ -100,7 +106,6 @@
|
|||||||
revision = "e2f255711dcb2ea41e42c6d9d98c172d7edf6509"
|
revision = "e2f255711dcb2ea41e42c6d9d98c172d7edf6509"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
digest = "1:3eb026ba34d6dd12b45bb6abd63b4e917ebca8d8f3022a139c0881d900ad1bee"
|
digest = "1:3eb026ba34d6dd12b45bb6abd63b4e917ebca8d8f3022a139c0881d900ad1bee"
|
||||||
name = "github.com/googollee/go-socket.io"
|
name = "github.com/googollee/go-socket.io"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
@@ -108,23 +113,24 @@
|
|||||||
revision = "c8aeb1ed9b49d7de8fef8662efb18f1d289c5f2e"
|
revision = "c8aeb1ed9b49d7de8fef8662efb18f1d289c5f2e"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:7b5c6e2eeaa9ae5907c391a91c132abfd5c9e8a784a341b5625e750c67e6825d"
|
digest = "1:e62657cca9badaa308d86e7716083e4c5933bb78e30a17743fc67f50be26f6f4"
|
||||||
name = "github.com/gorilla/websocket"
|
name = "github.com/gorilla/websocket"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d"
|
revision = "c3e18be99d19e6b3e8f1559eea2c161a665c4b6b"
|
||||||
version = "v1.4.0"
|
version = "v1.4.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:d544928ef5b57ff39325b4fea31f262db66c9241324aee38ba55dfe3e836e2c8"
|
digest = "1:99a9eab89cf8193a246811614678f34432e95446c34142594c450acb1a7a31cc"
|
||||||
name = "github.com/grpc-ecosystem/grpc-gateway"
|
name = "github.com/grpc-ecosystem/grpc-gateway"
|
||||||
packages = [
|
packages = [
|
||||||
|
"internal",
|
||||||
"runtime",
|
"runtime",
|
||||||
"runtime/internal",
|
|
||||||
"utilities",
|
"utilities",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "e8bd377da7395186f2f042ee6b366fa5a11d2b39"
|
revision = "471f45a5a99a578de7a8638dc7ed29e245bde097"
|
||||||
|
version = "v1.11.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:c0d19ab64b32ce9fe5cf4ddceba78d5bc9807f0016db6b1183599da3dcc24d10"
|
digest = "1:c0d19ab64b32ce9fe5cf4ddceba78d5bc9807f0016db6b1183599da3dcc24d10"
|
||||||
@@ -147,7 +153,15 @@
|
|||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:1b1d9534e35d61e861a7356f7f2d766e57e2777dbf79be60e1ac56bbd60adf51"
|
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"
|
name = "github.com/integration-system/go-cmp"
|
||||||
packages = [
|
packages = [
|
||||||
"cmp",
|
"cmp",
|
||||||
@@ -156,7 +170,7 @@
|
|||||||
"cmp/internal/value",
|
"cmp/internal/value",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "ed1c8d9bf7906aec13cf28080fdf069d7687471a"
|
revision = "ac5582987a2f25e8743e0ebb7259312adda05c23"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@@ -171,17 +185,14 @@
|
|||||||
revision = "5959fcea049facd9441fff9de976191accd3cf9f"
|
revision = "5959fcea049facd9441fff9de976191accd3cf9f"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
digest = "1:c2cbe4bc2b4615c904b02e66538790b4b27e6637f9f414f35904c78b855fcf2d"
|
||||||
digest = "1:900583da99fb5a30a9c3b829bab8acca29a9474d5b40a5c3cb28e7bc7cd27788"
|
|
||||||
name = "github.com/integration-system/isp-lib"
|
name = "github.com/integration-system/isp-lib"
|
||||||
packages = [
|
packages = [
|
||||||
"backend",
|
"backend",
|
||||||
"bootstrap",
|
"bootstrap",
|
||||||
"config",
|
"config",
|
||||||
"config/schema",
|
"config/schema",
|
||||||
"controller",
|
|
||||||
"database",
|
"database",
|
||||||
"http",
|
|
||||||
"logger",
|
"logger",
|
||||||
"metric",
|
"metric",
|
||||||
"proto/stubs",
|
"proto/stubs",
|
||||||
@@ -191,37 +202,38 @@
|
|||||||
"utils",
|
"utils",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "0f71aaf83133a59c9fc143faecbd38b86ed068e2"
|
revision = "ec379c1305f381a22a2934d406f4e3c3e20ef0c2"
|
||||||
|
version = "v1.6.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:a992b3ab79433b828258f9fe99af29da5aeb2e48bf8076a41ba556ac90ac04d3"
|
digest = "1:48f3a739fabefebf152d0196277ee89136c1fa6d88fc67fa486fc765a05b1caa"
|
||||||
name = "github.com/integration-system/jsonschema"
|
name = "github.com/integration-system/jsonschema"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "170a88febd847f36821e99ec54a095e6cec48528"
|
revision = "5475a8b08e62e41fa886641861ac225e7f91e4e5"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
digest = "1:01ed62f8f4f574d8aff1d88caee113700a2b44c42351943fa73cc1808f736a50"
|
||||||
digest = "1:fd97437fbb6b7dce04132cf06775bd258cce305c44add58eb55ca86c6c325160"
|
|
||||||
name = "github.com/jinzhu/inflection"
|
name = "github.com/jinzhu/inflection"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "04140366298a54a039076d798123ffa108fff46c"
|
revision = "f5c5f50e6090ae76a29240b61ae2a90dd810112e"
|
||||||
|
version = "v1.0.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:5d713dbcad44f3358fec51fd5573d4f733c02cac5a40dcb177787ad5ffe9272f"
|
digest = "1:ac7f1061abc812a5d0de6df7e3f477cef942aef503848f436da0f0eb2603bfbf"
|
||||||
name = "github.com/json-iterator/go"
|
name = "github.com/json-iterator/go"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
"extra",
|
"extra",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "1624edc4454b8682399def8740d46db5e4362ba4"
|
revision = "27518f6661eba504be5a7a9a9f6d9460d892ade3"
|
||||||
version = "v1.1.5"
|
version = "v1.1.7"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:aaa8e0e7e35d92e21daed3f241832cee73d15ca1cd3302ba3843159a959a7eac"
|
digest = "1:caa1da085cc12cd39d3ddb267434902f621050e1b46f7e9477b2b933df680193"
|
||||||
name = "github.com/klauspost/compress"
|
name = "github.com/klauspost/compress"
|
||||||
packages = [
|
packages = [
|
||||||
"flate",
|
"flate",
|
||||||
@@ -229,59 +241,60 @@
|
|||||||
"zlib",
|
"zlib",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "30be6041bed523c18e269a700ebd9c2ea9328574"
|
revision = "fdc46f09595ea8241b9bfe291bbc868a7af19e10"
|
||||||
version = "v1.4.1"
|
version = "v1.8.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:2d643962fac133904694fffa959bc3c5dcfdcee38c6f5ffdd99a3c93eb9c835c"
|
digest = "1:923c4d7194b42e054b2eb8a6c62824ac55e23ececc1c7e48d4da69c971c55954"
|
||||||
name = "github.com/klauspost/cpuid"
|
name = "github.com/klauspost/cpuid"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "e7e905edc00ea8827e58662220139109efea09db"
|
revision = "05a8198c0f5a27739aec358908d7e12c64ce6eb7"
|
||||||
version = "v1.2.0"
|
version = "v1.2.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:0a69a1c0db3591fcefb47f115b224592c8dfa4368b7ba9fae509d5e16cdc95c8"
|
digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de"
|
||||||
name = "github.com/konsorten/go-windows-terminal-sequences"
|
name = "github.com/konsorten/go-windows-terminal-sequences"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "5c8c8bd35d3832f5d134ae1e1e375b69a4d25242"
|
revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e"
|
||||||
version = "v1.0.1"
|
version = "v1.0.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:8ef506fc2bb9ced9b151dafa592d4046063d744c646c1bbe801982ce87e4bc24"
|
digest = "1:12cb143f2148bf54bcd9fe622abac17325e85eeb1d84b8ec6caf1c80232108fd"
|
||||||
name = "github.com/lib/pq"
|
name = "github.com/lib/pq"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
"oid",
|
"oid",
|
||||||
|
"scram",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "4ded0e9383f75c197b3a2aaa6d590ac52df6fd79"
|
revision = "3427c32cb71afc948325f299f040e53c1dd78979"
|
||||||
version = "v1.0.0"
|
version = "v1.2.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:c568d7727aa262c32bdf8a3f7db83614f7af0ed661474b24588de635c20024c7"
|
digest = "1:5a0ef768465592efca0412f7e838cdc0826712f8447e70e6ccc52eb441e9ab13"
|
||||||
name = "github.com/magiconair/properties"
|
name = "github.com/magiconair/properties"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "c2353362d570a7bfa228149c62842019201cfb71"
|
revision = "de8848e004dd33dc07a2947b3d76f618a7fc7ef1"
|
||||||
version = "v1.8.0"
|
version = "v1.8.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:c658e84ad3916da105a761660dcaeb01e63416c8ec7bc62256a9b411a05fcd67"
|
digest = "1:7c084e0e780596dd2a7e20d25803909a9a43689c153de953520dfbc0b0e51166"
|
||||||
name = "github.com/mattn/go-colorable"
|
name = "github.com/mattn/go-colorable"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
|
revision = "8029fb3788e5a4a9c00e415f586a6d033f5d38b3"
|
||||||
version = "v0.0.9"
|
version = "v0.1.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:0981502f9816113c9c8c4ac301583841855c8cf4da8c72f696b3ebedf6d0e4e5"
|
digest = "1:36325ebb862e0382f2f14feef409ba9351271b89ada286ae56836c603d43b59c"
|
||||||
name = "github.com/mattn/go-isatty"
|
name = "github.com/mattn/go-isatty"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c"
|
revision = "e1f7b56ace729e4a73a29a6b4fac6cd5fcda7ab3"
|
||||||
version = "v0.0.4"
|
version = "v0.0.9"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@@ -324,58 +337,66 @@
|
|||||||
revision = "c48cc78d482608239f6c4c92a4abd87eb8761c90"
|
revision = "c48cc78d482608239f6c4c92a4abd87eb8761c90"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:95741de3af260a92cc5c7f3f3061e85273f5a81b5db20d4bd68da74bd521675e"
|
digest = "1:93131d8002d7025da13582877c32d1fc302486775a1b06f62241741006428c5e"
|
||||||
name = "github.com/pelletier/go-toml"
|
name = "github.com/pelletier/go-toml"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194"
|
revision = "728039f679cbcd4f6a54e080d2219a4c4928c546"
|
||||||
version = "v1.2.0"
|
version = "v1.4.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:d4c5d57ac0163eb71e09f1a94ca998961668700232f948d47a6269c8d7651d38"
|
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
||||||
|
name = "github.com/pkg/errors"
|
||||||
|
packages = ["."]
|
||||||
|
pruneopts = "UT"
|
||||||
|
revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4"
|
||||||
|
version = "v0.8.1"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
digest = "1:7d99649602f68b73ade640ca6975ccc38735f329e159c6a507b63f00213678c0"
|
||||||
name = "github.com/pressly/goose"
|
name = "github.com/pressly/goose"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "7a98874933001af28951c83e958b1db750f39f8d"
|
revision = "e4b98955473e91a12fc7d8816c28d06376d1d92c"
|
||||||
version = "v2.4.5"
|
version = "v2.6.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:d38f81081a389f1466ec98192cf9115a82158854d6f01e1c23e2e7554b97db71"
|
digest = "1:5bbebe8ac19ecb6c87790a89faa20566e38ed0d6494a1d14c4f5b05d9ce2436c"
|
||||||
name = "github.com/rcrowley/go-metrics"
|
name = "github.com/rcrowley/go-metrics"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "3113b8401b8a98917cde58f8bbd42a1b1c03b1fd"
|
revision = "cac0b30c2563378d434b5af411844adff8e32960"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:564e4136357b9d481ad8eb9d87f7fc144a28bb41cb0e29e739db3535e2d87575"
|
digest = "1:ab1672baf07ee80c988e369e5633bcac459342e8e00d0c38a799056395fe9dba"
|
||||||
name = "github.com/shirou/gopsutil"
|
name = "github.com/shirou/gopsutil"
|
||||||
packages = [
|
packages = [
|
||||||
"cpu",
|
"cpu",
|
||||||
"internal/common",
|
"internal/common",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "0f70a4a06f7a1039305ec9b3ba9c2800f8929fba"
|
revision = "e4ec7b275ada47ca32799106c2dba142d96aaf93"
|
||||||
version = "v2.18.11"
|
version = "v2.19.8"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:69b1cc331fca23d702bd72f860c6a647afd0aa9fcbc1d0659b1365e26546dd70"
|
digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976"
|
||||||
name = "github.com/sirupsen/logrus"
|
name = "github.com/sirupsen/logrus"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "bcd833dfe83d3cebad139e4a29ed79cb2318bf95"
|
revision = "839c75faf7f98a33d445d181f3018b5c3409a45e"
|
||||||
version = "v1.2.0"
|
version = "v1.4.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:6a4a11ba764a56d2758899ec6f3848d24698d48442ebce85ee7a3f63284526cd"
|
digest = "1:bb495ec276ab82d3dd08504bbc0594a65de8c3b22c6f2aaa92d05b73fbf3a82e"
|
||||||
name = "github.com/spf13/afero"
|
name = "github.com/spf13/afero"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
"mem",
|
"mem",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "d40851caa0d747393da1ffb28f7f9d8b4eeffebd"
|
revision = "588a75ec4f32903aa5e39a2619ba6a4631e28424"
|
||||||
version = "v1.1.2"
|
version = "v1.2.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:08d65904057412fc0270fc4812a1c90c594186819243160dc779a402d4b6d0bc"
|
digest = "1:08d65904057412fc0270fc4812a1c90c594186819243160dc779a402d4b6d0bc"
|
||||||
@@ -386,12 +407,12 @@
|
|||||||
version = "v1.3.0"
|
version = "v1.3.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:68ea4e23713989dc20b1bded5d9da2c5f9be14ff9885beef481848edd18c26cb"
|
digest = "1:1b753ec16506f5864d26a28b43703c58831255059644351bbcb019b843950900"
|
||||||
name = "github.com/spf13/jwalterweatherman"
|
name = "github.com/spf13/jwalterweatherman"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "4a4406e478ca629068e7768fc33f3f044173c0a6"
|
revision = "94f6ae3ed3bceceafa716478c5fbf8d29ca601a1"
|
||||||
version = "v1.0.0"
|
version = "v1.1.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
|
digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
|
||||||
@@ -402,12 +423,12 @@
|
|||||||
version = "v1.0.3"
|
version = "v1.0.3"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:214775c11fd26da94a100111a62daa25339198a4f9c57cb4aab352da889f5b93"
|
digest = "1:11118bd196646c6515fea3d6c43f66162833c6ae4939bfb229b9956d91c6cf17"
|
||||||
name = "github.com/spf13/viper"
|
name = "github.com/spf13/viper"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "2c12c60302a5a0e62ee102ca9bc996277c2f64f5"
|
revision = "b5bf975e5823809fb22c7644d008757f78a4259e"
|
||||||
version = "v1.2.1"
|
version = "v1.4.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@@ -427,7 +448,7 @@
|
|||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:c911cc6a838b0d6be5de154aaea7b36530d5c97e019c3bb56b67fa8531aa17df"
|
digest = "1:b97ba937497c9b282245aa8f633212c96fcaa1b4cc30e9ab6ae41a0168e32c35"
|
||||||
name = "github.com/valyala/fasthttp"
|
name = "github.com/valyala/fasthttp"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
@@ -435,15 +456,7 @@
|
|||||||
"stackless",
|
"stackless",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "1d2d99cba311e04b8d58f5d113ee07086c3e64f6"
|
revision = "8713335f548d2c18effe36c9686f5a88b65eefce"
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
branch = "master"
|
|
||||||
digest = "1:c83590426ecf1362e77a9054afed570b201de1a353398a6157ecce06583ea024"
|
|
||||||
name = "github.com/vmihailenco/sasl"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "2f13c189728a02f8cc31b3b9cc06047b383c21cc"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:39a425f98fb19427061a693fe6bf0683c9bddec4b25b17067e34fdb465e39cb9"
|
digest = "1:39a425f98fb19427061a693fe6bf0683c9bddec4b25b17067e34fdb465e39cb9"
|
||||||
@@ -455,18 +468,18 @@
|
|||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:9ff2b9f8d4e47013a213b9ea0d850ed787c51f5eab2038842d82397ad85a19c1"
|
digest = "1:35ce874cf16f78a2da908ab28b0277497e36603d289db00d39da5200bc8ace08"
|
||||||
name = "golang.org/x/crypto"
|
name = "golang.org/x/crypto"
|
||||||
packages = [
|
packages = [
|
||||||
"pbkdf2",
|
"pbkdf2",
|
||||||
"ssh/terminal",
|
"ssh/terminal",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "505ab145d0a99da450461ae2c1a9f6cd10d1f447"
|
revision = "9756ffdc24725223350eb3266ffb92590d28f278"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:7a2e3d6819e7a97a877f8604e737901c6941e76d56ae98a51a1ca2f13de351fb"
|
digest = "1:8c8471f63317e39731853a4f55d5d8ff43a142aa425a666a0554bdba0a8b7f8b"
|
||||||
name = "golang.org/x/net"
|
name = "golang.org/x/net"
|
||||||
packages = [
|
packages = [
|
||||||
"context",
|
"context",
|
||||||
@@ -478,27 +491,29 @@
|
|||||||
"trace",
|
"trace",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "351d144fa1fc0bd934e2408202be0c29f25e35a0"
|
revision = "ba9fcec4b297b415637633c5a6e8fa592e4a16c3"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:b9dceb1408ba5105803d5859193bc7d89ac3199b611cf8681dbaa0aa09c10d9c"
|
digest = "1:4f9cc50343843f7c58c1a1aecf17c226ea0e855f4d3293e796701ae985111e0d"
|
||||||
name = "golang.org/x/sys"
|
name = "golang.org/x/sys"
|
||||||
packages = [
|
packages = [
|
||||||
"unix",
|
"unix",
|
||||||
"windows",
|
"windows",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "a5c9d58dba9a56f97aaa86f55e638b718c5a6c42"
|
revision = "749cb33beabd9aa6d3178e3de05bcc914f70b2bf"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18"
|
digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405"
|
||||||
name = "golang.org/x/text"
|
name = "golang.org/x/text"
|
||||||
packages = [
|
packages = [
|
||||||
"collate",
|
"collate",
|
||||||
"collate/build",
|
"collate/build",
|
||||||
"internal/colltab",
|
"internal/colltab",
|
||||||
"internal/gen",
|
"internal/gen",
|
||||||
|
"internal/language",
|
||||||
|
"internal/language/compact",
|
||||||
"internal/tag",
|
"internal/tag",
|
||||||
"internal/triegen",
|
"internal/triegen",
|
||||||
"internal/ucd",
|
"internal/ucd",
|
||||||
@@ -511,23 +526,25 @@
|
|||||||
"unicode/rangetable",
|
"unicode/rangetable",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
|
revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475"
|
||||||
version = "v0.3.0"
|
version = "v0.3.2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:6aec038013fe4a5de91d89b51283cd0ddc0b8ed60ac58e0a173a9d8cf39438c5"
|
digest = "1:08aa0c3a326b71c5afe441683697766f6b172f652b919ecd114881a7f7581a4d"
|
||||||
name = "google.golang.org/genproto"
|
name = "google.golang.org/genproto"
|
||||||
packages = [
|
packages = [
|
||||||
"googleapis/api/annotations",
|
"googleapis/api/annotations",
|
||||||
|
"googleapis/api/httpbody",
|
||||||
"googleapis/rpc/errdetails",
|
"googleapis/rpc/errdetails",
|
||||||
"googleapis/rpc/status",
|
"googleapis/rpc/status",
|
||||||
|
"protobuf/field_mask",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "bd91e49a0898e27abb88c339b432fa53d7497ac0"
|
revision = "92dd089d5514cecde7a465f807541f83dfd486d5"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:9edd250a3c46675d0679d87540b30c9ed253b19bd1fd1af08f4f5fb3c79fc487"
|
digest = "1:3b97661db2e5d4c87f7345e875ea28f911e54c715ba0a74be08e1649d67e05cd"
|
||||||
name = "google.golang.org/grpc"
|
name = "google.golang.org/grpc"
|
||||||
packages = [
|
packages = [
|
||||||
".",
|
".",
|
||||||
@@ -544,6 +561,7 @@
|
|||||||
"grpclog",
|
"grpclog",
|
||||||
"internal",
|
"internal",
|
||||||
"internal/backoff",
|
"internal/backoff",
|
||||||
|
"internal/balancerload",
|
||||||
"internal/binarylog",
|
"internal/binarylog",
|
||||||
"internal/channelz",
|
"internal/channelz",
|
||||||
"internal/envconfig",
|
"internal/envconfig",
|
||||||
@@ -558,21 +576,14 @@
|
|||||||
"resolver",
|
"resolver",
|
||||||
"resolver/dns",
|
"resolver/dns",
|
||||||
"resolver/passthrough",
|
"resolver/passthrough",
|
||||||
|
"serviceconfig",
|
||||||
"stats",
|
"stats",
|
||||||
"status",
|
"status",
|
||||||
"tap",
|
"tap",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "df014850f6dee74ba2fc94874043a9f3f75fbfd8"
|
revision = "6eaf6f47437a6b4e2153a190160ef39a92c7eceb"
|
||||||
version = "v1.17.0"
|
version = "v1.23.0"
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:c805e517269b0ba4c21ded5836019ed7d16953d4026cb7d00041d039c7906be9"
|
|
||||||
name = "gopkg.in/natefinch/lumberjack.v2"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "UT"
|
|
||||||
revision = "a96e63847dc3c67d17befa69c303767e2f84e54f"
|
|
||||||
version = "v2.1"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
|
digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
|
||||||
@@ -582,6 +593,15 @@
|
|||||||
revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
|
revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
|
||||||
version = "v2.2.2"
|
version = "v2.2.2"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
digest = "1:999d566ad1ae4303c456af5a155f7b42401cca4fd33552567ed9dd997b107a08"
|
||||||
|
name = "mellium.im/sasl"
|
||||||
|
packages = ["."]
|
||||||
|
pruneopts = "UT"
|
||||||
|
revision = "e58e780e1378aa4df5dc705364ff5ae9a4dd1e04"
|
||||||
|
source = "https://github.com/mellium/sasl.git"
|
||||||
|
version = "v0.2.1"
|
||||||
|
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
@@ -592,6 +612,7 @@
|
|||||||
"github.com/go-pg/pg/orm",
|
"github.com/go-pg/pg/orm",
|
||||||
"github.com/golang/protobuf/proto",
|
"github.com/golang/protobuf/proto",
|
||||||
"github.com/golang/protobuf/ptypes/struct",
|
"github.com/golang/protobuf/ptypes/struct",
|
||||||
|
"github.com/googollee/go-engine.io",
|
||||||
"github.com/googollee/go-socket.io",
|
"github.com/googollee/go-socket.io",
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime",
|
"github.com/grpc-ecosystem/grpc-gateway/runtime",
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/utilities",
|
"github.com/grpc-ecosystem/grpc-gateway/utilities",
|
||||||
@@ -599,11 +620,9 @@
|
|||||||
"github.com/integration-system/isp-lib/bootstrap",
|
"github.com/integration-system/isp-lib/bootstrap",
|
||||||
"github.com/integration-system/isp-lib/config",
|
"github.com/integration-system/isp-lib/config",
|
||||||
"github.com/integration-system/isp-lib/config/schema",
|
"github.com/integration-system/isp-lib/config/schema",
|
||||||
"github.com/integration-system/isp-lib/controller",
|
|
||||||
"github.com/integration-system/isp-lib/database",
|
"github.com/integration-system/isp-lib/database",
|
||||||
"github.com/integration-system/isp-lib/logger",
|
"github.com/integration-system/isp-lib/logger",
|
||||||
"github.com/integration-system/isp-lib/metric",
|
"github.com/integration-system/isp-lib/metric",
|
||||||
"github.com/integration-system/isp-lib/socket",
|
|
||||||
"github.com/integration-system/isp-lib/structure",
|
"github.com/integration-system/isp-lib/structure",
|
||||||
"github.com/integration-system/isp-lib/utils",
|
"github.com/integration-system/isp-lib/utils",
|
||||||
"github.com/valyala/fasthttp",
|
"github.com/valyala/fasthttp",
|
||||||
|
|||||||
+15
-3
@@ -28,6 +28,18 @@
|
|||||||
go-tests = true
|
go-tests = true
|
||||||
unused-packages = true
|
unused-packages = true
|
||||||
|
|
||||||
[[constraint]]
|
[[override]]
|
||||||
name = "github.com/grpc-ecosystem/grpc-gateway"
|
name = "mellium.im/sasl"
|
||||||
revision = "e8bd377da7395186f2f042ee6b366fa5a11d2b39"
|
source = "https://github.com/mellium/sasl.git"
|
||||||
|
|
||||||
|
[[override]]
|
||||||
|
name = "github.com/valyala/fasthttp"
|
||||||
|
branch = "master"
|
||||||
|
|
||||||
|
[[override]]
|
||||||
|
name = "github.com/googollee/go-socket.io"
|
||||||
|
revision = "c8aeb1ed9b49d7de8fef8662efb18f1d289c5f2e"
|
||||||
|
|
||||||
|
[[override]]
|
||||||
|
name = "github.com/googollee/go-engine.io"
|
||||||
|
revision = "e2f255711dcb2ea41e42c6d9d98c172d7edf6509"
|
||||||
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
+1
-1
@@ -10,7 +10,7 @@ database:
|
|||||||
moduleName: "config"
|
moduleName: "config"
|
||||||
grpcOuterAddress:
|
grpcOuterAddress:
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
port: 9001
|
port: 9002
|
||||||
|
|
||||||
ws:
|
ws:
|
||||||
rest:
|
rest:
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package conf
|
package conf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/integration-system/isp-lib/database"
|
|
||||||
"github.com/integration-system/isp-lib/structure"
|
"github.com/integration-system/isp-lib/structure"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
Database database.DBConfiguration `valid:"required~Required"`
|
Database structure.DBConfiguration `valid:"required~Required"`
|
||||||
GrpcOuterAddress structure.AddressConfiguration `valid:"required~Required" json:"grpcOuterAddress"`
|
GrpcOuterAddress structure.AddressConfiguration `valid:"required~Required" json:"grpcOuterAddress"`
|
||||||
ModuleName string `valid:"required~Required"`
|
ModuleName string `valid:"required~Required"`
|
||||||
WS struct {
|
WS struct {
|
||||||
|
|||||||
@@ -13,6 +13,16 @@ import (
|
|||||||
"isp-config-service/domain"
|
"isp-config-service/domain"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// GetConfigs godoc
|
||||||
|
// @Tags Конфигурация
|
||||||
|
// @Summary Метод получения объектов конфигурации по идентификаторам
|
||||||
|
// @Description Возвращает массив конфиграций по запрошенным идентификаторам (все, если массив пустой)
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param body body []integer false "Массив идентификаторов конфигураций"
|
||||||
|
// @Success 200 {array} entity.Config
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/get_configs [POST]
|
||||||
func GetConfigs(identities []int64) ([]st.Config, error) {
|
func GetConfigs(identities []int64) ([]st.Config, error) {
|
||||||
configs, err := model.ConfigRep.GetConfigs(identities)
|
configs, err := model.ConfigRep.GetConfigs(identities)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -21,6 +31,17 @@ func GetConfigs(identities []int64) ([]st.Config, error) {
|
|||||||
return configs, nil
|
return configs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetConfigByInstanceUUIDAndModuleName godoc
|
||||||
|
// @Tags Конфигурация
|
||||||
|
// @Summary Метод получени объекта конфигурации по названию модуля
|
||||||
|
// @Description Возвращает конфиграцию по названию модуля и идентификатору инстанса
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param body body entity.ModuleInstanceIdentity true "название модуля и id кластера"
|
||||||
|
// @Success 200 {object} entity.Config
|
||||||
|
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/get_config_by_instance_uuid_and_module_name [POST]
|
||||||
func GetConfigByInstanceUUIDAndModuleName(request st.ModuleInstanceIdentity) (*st.Config, error) {
|
func GetConfigByInstanceUUIDAndModuleName(request st.ModuleInstanceIdentity) (*st.Config, error) {
|
||||||
config, err := model.ConfigRep.GetConfigByInstanceUUIDAndModuleName(request.Uuid, request.Name)
|
config, err := model.ConfigRep.GetConfigByInstanceUUIDAndModuleName(request.Uuid, request.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -33,6 +54,18 @@ func GetConfigByInstanceUUIDAndModuleName(request st.ModuleInstanceIdentity) (*s
|
|||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateUpdateConfig godoc
|
||||||
|
// @Tags Конфигурация
|
||||||
|
// @Summary Метод обновления конфигурации
|
||||||
|
// @Description Если конфиг с таким id существует, то обновляет данные, если нет, то добавляет данные в базу
|
||||||
|
// В случае обновления рассылает все подключенным модулям актуальную конфигурацию
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param body body entity.Config true "объект для сохранения"
|
||||||
|
// @Success 200 {object} entity.Config
|
||||||
|
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/create_update_config [POST]
|
||||||
func CreateUpdateConfig(config st.Config) (*st.Config, error) {
|
func CreateUpdateConfig(config st.Config) (*st.Config, error) {
|
||||||
var err error
|
var err error
|
||||||
var cfg *st.Config
|
var cfg *st.Config
|
||||||
@@ -69,6 +102,17 @@ func CreateUpdateConfig(config st.Config) (*st.Config, error) {
|
|||||||
return cfg, nil
|
return cfg, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateActiveConfigByInstanceUUIDAndModuleName godoc
|
||||||
|
// @Tags Конфигурация
|
||||||
|
// @Summary Метод обновления конфигурации по названию модуля
|
||||||
|
// @Description Обновляет объект конфиграции для модуля, рассылает подключенным модулям обновленную конфигурацию
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param body body domain.ConfigInstanceModuleName true "объект для сохранения"
|
||||||
|
// @Success 200 {object} entity.Config "объект для сохранения"
|
||||||
|
// @Failure 404 {object} structure.GrpcError "если конфигурация не найдена"
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/update_active_config_by_instance_uuid_and_module_name [POST]
|
||||||
func UpdateActiveConfigByInstanceUUIDAndModuleName(configReq domain.ConfigInstanceModuleName) (*st.Config, error) {
|
func UpdateActiveConfigByInstanceUUIDAndModuleName(configReq domain.ConfigInstanceModuleName) (*st.Config, error) {
|
||||||
config, err := model.ConfigRep.GetConfigByInstanceUUIDAndModuleName(configReq.InstanceUuid, configReq.ModuleName)
|
config, err := model.ConfigRep.GetConfigByInstanceUUIDAndModuleName(configReq.InstanceUuid, configReq.ModuleName)
|
||||||
if err != nil || config == nil {
|
if err != nil || config == nil {
|
||||||
|
|||||||
@@ -15,6 +15,16 @@ import (
|
|||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// GetModules godoc
|
||||||
|
// @Tags Модули
|
||||||
|
// @Summary Метод получени объектов модулей по идентификаторам
|
||||||
|
// @Description Возвращает массив модулей по запрошенным идентификаторам (все, если массив пустой)
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param body body []integer false "массив идентификаторов модулей"
|
||||||
|
// @Success 200 {array} entity.Module
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/get_modules [POST]
|
||||||
func GetModules(identities []int32) ([]st.Module, error) {
|
func GetModules(identities []int32) ([]st.Module, error) {
|
||||||
modules, err := model.ModulesRep.GetModules(identities)
|
modules, err := model.ModulesRep.GetModules(identities)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -24,6 +34,16 @@ func GetModules(identities []int32) ([]st.Module, error) {
|
|||||||
return modules, nil
|
return modules, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetModulesAggregatedInfo godoc
|
||||||
|
// @Tags Модули
|
||||||
|
// @Summary Метод получения полной информации о состоянии модуля
|
||||||
|
// @Description Возвращает полное состояние всех модулей в кластере (конфигурация, схема конфигурации, подключенные экземпляры)
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param x-instance-identity header string true "идентификатор кластера"
|
||||||
|
// @Success 200 {array} domain.ModuleInfo
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/get_modules_info [POST]
|
||||||
func GetModulesAggregatedInfo(i structure.Isolation) ([]*domain.ModuleInfo, error) {
|
func GetModulesAggregatedInfo(i structure.Isolation) ([]*domain.ModuleInfo, error) {
|
||||||
instanceId, err := i.GetInstanceId()
|
instanceId, err := i.GetInstanceId()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
"isp-config-service/domain"
|
||||||
|
"isp-config-service/entity"
|
||||||
|
"isp-config-service/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
var Schema = schema{}
|
||||||
|
|
||||||
|
type schema struct{}
|
||||||
|
|
||||||
|
// GetModulesAggregatedInfo godoc
|
||||||
|
// @Tags Схема
|
||||||
|
// @Summary Метод схемы конфигурации модуля
|
||||||
|
// @Description Возвращает текущую json схему конфигурации модуля
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param body body domain.GetByModuleIdRequest true "идентификатор модуля"
|
||||||
|
// @Success 200 {array} entity.ConfigSchema
|
||||||
|
// @Failure 404 {object} structure.GrpcError "если схема для модуля не найдена"
|
||||||
|
// @Failure 500 {object} structure.GrpcError
|
||||||
|
// @Router /config/get_modules_info [POST]
|
||||||
|
func (schema) GetByModuleId(request domain.GetByModuleIdRequest) (*entity.ConfigSchema, error) {
|
||||||
|
if response, err := model.SchemaRep.GetSchemaByModuleId(request.ModuleId); err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if response == nil {
|
||||||
|
return nil, status.Errorf(codes.NotFound, "schema with moduleId %d not found", request.ModuleId)
|
||||||
|
} else {
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,3 +13,7 @@ type ConfigInstanceModuleName struct {
|
|||||||
InstanceUuid string `valid:"required~Required"`
|
InstanceUuid string `valid:"required~Required"`
|
||||||
ConfigData map[string]interface{} `valid:"required~Required"`
|
ConfigData map[string]interface{} `valid:"required~Required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetByModuleIdRequest struct {
|
||||||
|
ModuleId int32 `valid:"required~Required"`
|
||||||
|
}
|
||||||
+1
-1
@@ -27,7 +27,7 @@ type Config struct {
|
|||||||
Active bool `json:"active" sql:",null"`
|
Active bool `json:"active" sql:",null"`
|
||||||
CreatedAt time.Time `json:"createdAt" sql:",null"`
|
CreatedAt time.Time `json:"createdAt" sql:",null"`
|
||||||
UpdatedAt time.Time `json:"updatedAt" sql:",null"`
|
UpdatedAt time.Time `json:"updatedAt" sql:",null"`
|
||||||
Data ConfigData `json:"data" sql:",notnull"`
|
Data ConfigData `json:"data" sql:",notnull"` // Объект конфигурации
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigSchema struct {
|
type ConfigSchema struct {
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ type Handlers struct {
|
|||||||
|
|
||||||
// ===== ROUTING =====
|
// ===== ROUTING =====
|
||||||
GetRoutes func() (map[string]interface{}, error) `method:"get_routes" group:"routing" inner:"true"`
|
GetRoutes func() (map[string]interface{}, error) `method:"get_routes" group:"routing" inner:"true"`
|
||||||
|
|
||||||
|
// ===== SCHEMA =====
|
||||||
|
GetSchemaByModuleId func(domain.GetByModuleIdRequest) (*entity.ConfigSchema, error) `method:"get_by_module_id" group:"schema" inner:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetHandlers() *Handlers {
|
func GetHandlers() *Handlers {
|
||||||
@@ -54,5 +57,7 @@ func GetHandlers() *Handlers {
|
|||||||
DeleteConfig: controllers.DeleteConfig,
|
DeleteConfig: controllers.DeleteConfig,
|
||||||
|
|
||||||
GetRoutes: controllers.GetRoutes,
|
GetRoutes: controllers.GetRoutes,
|
||||||
|
|
||||||
|
GetSchemaByModuleId: controllers.Schema.GetByModuleId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,8 +9,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path"
|
|
||||||
rn "runtime"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"isp-config-service/conf"
|
"isp-config-service/conf"
|
||||||
@@ -22,7 +20,6 @@ import (
|
|||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
"github.com/integration-system/isp-lib/backend"
|
"github.com/integration-system/isp-lib/backend"
|
||||||
"github.com/integration-system/isp-lib/config"
|
"github.com/integration-system/isp-lib/config"
|
||||||
"github.com/integration-system/isp-lib/controller"
|
|
||||||
"github.com/integration-system/isp-lib/database"
|
"github.com/integration-system/isp-lib/database"
|
||||||
"github.com/integration-system/isp-lib/logger"
|
"github.com/integration-system/isp-lib/logger"
|
||||||
"github.com/integration-system/isp-lib/metric"
|
"github.com/integration-system/isp-lib/metric"
|
||||||
@@ -38,11 +35,10 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
configData *conf.Configuration
|
configData *conf.Configuration
|
||||||
echoEndpoint *string
|
echoEndpoint *string
|
||||||
executableFileDir string
|
version = "0.1.0"
|
||||||
version = "0.1.0"
|
date = "undefined"
|
||||||
date = "undefined"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -55,16 +51,15 @@ func init() {
|
|||||||
module.Version = version
|
module.Version = version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @title ISP configuration service
|
||||||
|
// @version 1.2.0
|
||||||
|
// @description Сервис управления конфигурацией модулей ISP кластера
|
||||||
|
|
||||||
|
// @license.name GNU GPL v3.0
|
||||||
|
|
||||||
|
// @host localhost:9003
|
||||||
|
// @BasePath /api/config
|
||||||
func main() {
|
func main() {
|
||||||
ex, err := os.Executable()
|
|
||||||
executableFileDir = path.Dir(ex)
|
|
||||||
if err != nil {
|
|
||||||
logger.Fatal(err)
|
|
||||||
}
|
|
||||||
if utils.DEV {
|
|
||||||
_, filename, _, _ := rn.Caller(0)
|
|
||||||
executableFileDir = path.Dir(filename)
|
|
||||||
}
|
|
||||||
metric.InitCollectors(configData.Metrics, structure.MetricConfiguration{})
|
metric.InitCollectors(configData.Metrics, structure.MetricConfiguration{})
|
||||||
metric.InitStatusChecker("routers", checkRouters)
|
metric.InitStatusChecker("routers", checkRouters)
|
||||||
metric.InitStatusChecker("converters", checkConverters)
|
metric.InitStatusChecker("converters", checkConverters)
|
||||||
@@ -150,10 +145,10 @@ func createRestServer(opts ...runtime.ServeMuxOption) {
|
|||||||
mux.Handle("/socket.io/", socket.Get())
|
mux.Handle("/socket.io/", socket.Get())
|
||||||
|
|
||||||
// === REST ===
|
// === REST ===
|
||||||
mux.Handle("/swagger/", controller.StaticHandler(
|
/*mux.Handle("/swagger/", controller.StaticHandler(
|
||||||
http.StripPrefix(
|
http.StripPrefix(
|
||||||
"/swagger/", http.FileServer(
|
"/swagger/", http.FileServer(
|
||||||
http.Dir(path.Join(executableFileDir, "static", "swagger-ui"))))))
|
http.Dir(path.Join(executableFileDir, "static", "swagger-ui"))))))*/
|
||||||
|
|
||||||
gw, err := newGateway(ctx, opts...)
|
gw, err := newGateway(ctx, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -236,7 +231,7 @@ func handleModulesRequest(ctx *fasthttp.RequestCtx) {
|
|||||||
result[i.Uuid] = info
|
result[i.Uuid] = info
|
||||||
}
|
}
|
||||||
|
|
||||||
if bytes, err := utils.ConvertInterfaceToBytes(result, nil); err != nil {
|
if bytes, err := utils.ConvertGoToBytes(result); err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
ctx.Error("internal server error", http.StatusInternalServerError)
|
ctx.Error("internal server error", http.StatusInternalServerError)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
-- +goose Up
|
||||||
|
CREATE TABLE instances (
|
||||||
|
id serial4 NOT NULL PRIMARY KEY,
|
||||||
|
uuid UUID NOT NULL,
|
||||||
|
"name" varchar(255) NOT NULL,
|
||||||
|
created_at timestamp DEFAULT (now() at time zone 'utc') NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +goose StatementBegin
|
||||||
|
CREATE OR REPLACE FUNCTION update_created_modified_column_date()
|
||||||
|
RETURNS TRIGGER AS
|
||||||
|
$body$
|
||||||
|
BEGIN
|
||||||
|
IF TG_OP = 'UPDATE' THEN
|
||||||
|
NEW.created_at = OLD.created_at;
|
||||||
|
NEW.updated_at = (now() at time zone 'utc');
|
||||||
|
ELSIF TG_OP = 'INSERT' THEN
|
||||||
|
NEW.updated_at = (now() at time zone 'utc');
|
||||||
|
END IF;
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
$body$ LANGUAGE plpgsql;
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
-- +goose StatementBegin
|
||||||
|
CREATE OR REPLACE FUNCTION update_created_column_date()
|
||||||
|
RETURNS TRIGGER AS
|
||||||
|
$body$
|
||||||
|
BEGIN
|
||||||
|
IF TG_OP = 'UPDATE' THEN
|
||||||
|
NEW.created_at = OLD.created_at;
|
||||||
|
ELSIF TG_OP = 'INSERT' THEN
|
||||||
|
NEW.created_at = (now() at time zone 'utc');
|
||||||
|
END IF;
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
$body$ LANGUAGE plpgsql;
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
CREATE TRIGGER update_customer_modtime BEFORE INSERT OR UPDATE ON instances
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE update_created_column_date();
|
||||||
|
|
||||||
|
ALTER TABLE instances ADD CONSTRAINT "UQ_instances_uuid" UNIQUE ("uuid");
|
||||||
|
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
DROP TABLE instances;
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
-- +goose Up
|
||||||
|
CREATE TABLE modules (
|
||||||
|
id serial4 NOT NULL PRIMARY KEY,
|
||||||
|
instance_id int4 NOT NULL,
|
||||||
|
"name" varchar(255) NOT NULL,
|
||||||
|
"active" bool DEFAULT true,
|
||||||
|
created_at timestamp DEFAULT (now() at time zone 'utc') NOT NULL,
|
||||||
|
last_connected_at timestamp,
|
||||||
|
last_disconnected_at timestamp
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE modules
|
||||||
|
ADD CONSTRAINT "FK_modules_instanceId_instances_id"
|
||||||
|
FOREIGN KEY ("instance_id") REFERENCES instances ("id")
|
||||||
|
ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
CREATE INDEX IX_modules_instanceId ON modules USING hash (instance_id);
|
||||||
|
|
||||||
|
CREATE TRIGGER update_customer_modtime BEFORE INSERT OR UPDATE ON modules
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE update_created_column_date();
|
||||||
|
|
||||||
|
ALTER TABLE modules ADD CONSTRAINT "UQ_modules_instanceId_name" UNIQUE ("instance_id", "name");
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
DROP TABLE modules;
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
-- +goose Up
|
||||||
|
CREATE TABLE configs (
|
||||||
|
id serial8 NOT NULL PRIMARY KEY,
|
||||||
|
module_id int4 NOT NULL,
|
||||||
|
"version" int4 NOT NULL,
|
||||||
|
"active" bool DEFAULT false,
|
||||||
|
created_at timestamp DEFAULT (now() at time zone 'utc') NOT NULL,
|
||||||
|
updated_at timestamp DEFAULT (now() at time zone 'utc') NOT NULL,
|
||||||
|
"data" jsonb NOT NULL DEFAULT '{}'
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE configs
|
||||||
|
ADD CONSTRAINT "FK_configs_moduleId_modules_id"
|
||||||
|
FOREIGN KEY ("module_id") REFERENCES modules ("id")
|
||||||
|
ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
CREATE INDEX IX_configs_moduleId ON configs USING hash (module_id);
|
||||||
|
|
||||||
|
-- +goose StatementBegin
|
||||||
|
CREATE OR REPLACE FUNCTION deactivate_config()
|
||||||
|
RETURNS TRIGGER AS
|
||||||
|
$body$
|
||||||
|
DECLARE
|
||||||
|
last_version integer;
|
||||||
|
BEGIN
|
||||||
|
NEW.updated_at = (now() at time zone 'utc');
|
||||||
|
IF TG_OP = 'INSERT'
|
||||||
|
THEN
|
||||||
|
EXECUTE format('
|
||||||
|
SELECT version
|
||||||
|
FROM %I.configs
|
||||||
|
WHERE module_id = ' || NEW.module_id || '
|
||||||
|
ORDER BY created_at DESC
|
||||||
|
LIMIT 1;
|
||||||
|
', TG_TABLE_SCHEMA) INTO last_version;
|
||||||
|
IF last_version IS NOT NULL
|
||||||
|
THEN
|
||||||
|
NEW.version = last_version + 1;
|
||||||
|
ELSE
|
||||||
|
NEW.version = 1;
|
||||||
|
END IF;
|
||||||
|
ELSE
|
||||||
|
NEW.version = OLD.version;
|
||||||
|
NEW.created_at = OLD.created_at;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF NEW.active = TRUE
|
||||||
|
THEN
|
||||||
|
EXECUTE format('
|
||||||
|
UPDATE %I.configs
|
||||||
|
SET active = FALSE,
|
||||||
|
updated_at = (now() at time zone ''utc'')
|
||||||
|
WHERE active = TRUE AND ' || NEW.id || ' != id AND module_id = ' || NEW.module_id || ';
|
||||||
|
', TG_TABLE_SCHEMA);
|
||||||
|
END IF;
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
$body$ LANGUAGE plpgsql;
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
CREATE TRIGGER "deactivate_config"
|
||||||
|
BEFORE INSERT OR UPDATE ON configs
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE deactivate_config();
|
||||||
|
|
||||||
|
CREATE TRIGGER update_config_create_time BEFORE INSERT OR UPDATE ON configs
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE update_created_column_date();
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
DROP TABLE configs;
|
||||||
|
DROP FUNCTION deactivate_config;
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
-- +goose Up
|
||||||
|
ALTER TABLE configs
|
||||||
|
ADD COLUMN name VARCHAR(255) NOT NULL DEFAULT 'unnamed',
|
||||||
|
ADD COLUMN description TEXT;
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
ALTER TABLE configs
|
||||||
|
DROP COLUMN name,
|
||||||
|
DROP COLUMN description;
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
-- +goose Up
|
||||||
|
CREATE TABLE config_schemas (
|
||||||
|
id SERIAL4 PRIMARY KEY,
|
||||||
|
module_id INTEGER NOT NULL,
|
||||||
|
version VARCHAR(255) NOT NULL,
|
||||||
|
schema JSONB NOT NULL DEFAULT '{}',
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT (now() at time zone 'utc'),
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT (now() at time zone 'utc'),
|
||||||
|
CONSTRAINT FK_module_id__module_id FOREIGN KEY (module_id)
|
||||||
|
REFERENCES modules (id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TRIGGER update_schema_create_time
|
||||||
|
BEFORE INSERT OR UPDATE
|
||||||
|
ON config_schemas
|
||||||
|
FOR EACH ROW EXECUTE PROCEDURE update_created_modified_column_date();
|
||||||
|
|
||||||
|
CREATE INDEX IX_schemes_moduleId
|
||||||
|
ON config_schemas
|
||||||
|
USING hash (module_id);
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
DROP TABLE config_schemas;
|
||||||
@@ -1,58 +1,124 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migration.db_host = 'msk-pgsql.isp.mobi';
|
set migration.db_host = 'isp-pgsql';
|
||||||
set migration.db_port = '5432';
|
set migration.db_port = '5432';
|
||||||
set migration.db_dbname = 'isp-alpha';
|
set migration.db_dbname = 'isp-test';
|
||||||
set migration.db_user = 'isp-alpha';
|
set migration.db_user = 'isp-test';
|
||||||
set migration.db_pass = 'JxY96xLF8zfh3g8EWvSDtLUBw';
|
set migration.db_pass = '123321';
|
||||||
|
|
||||||
set migration.redis_host = '10.250.9.117';
|
set migration.redis_host = 'isp-redis';
|
||||||
set migration.redis_port = '6379';
|
set migration.redis_port = '5672';
|
||||||
|
|
||||||
|
set migration.admin_token_secret = 'secret';
|
||||||
|
|
||||||
-- auth
|
-- auth
|
||||||
INSERT INTO configs VALUES (1, 1, NULL, 't', NULL, NULL, ('{"redis": {' ||
|
INSERT INTO configs VALUES (1, 1, NULL, 't', NULL, NULL, (format('{
|
||||||
'"ip": "' || current_setting('migration.redis_host') || '", ' ||
|
"jwt": {
|
||||||
'"port": ' || current_setting('migration.redis_port') ||
|
"secret": "%s"
|
||||||
'}, "header": {"token": {"user": "X-USER-TOKEN", "device": "X-DEVICE-TOKEN", "application": "X-APPLICATION-TOKEN"}, "identity": {"user": "X-USER-IDENTITY", "device": "X-DEVICE-IDENTITY", "domain": "X-DOMAIN-IDENTITY", "system": "X-SYSTEM-IDENTITY", "service": "X-SERVICE-IDENTITY", "application": "X-APPLICATION-IDENTITY"}}, "unauthorized.html": "<HTML><BODY><H1>401 Unauthorized BAD CREDENTIALS</H1></BODY></HTML>"}')::jsonb);
|
},
|
||||||
|
"redis": {
|
||||||
|
"ip": "%s",
|
||||||
|
"port": %s
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"token": {
|
||||||
|
"user": "X-USER-TOKEN",
|
||||||
|
"admin": "X-AUTH-ADMIN",
|
||||||
|
"device": "X-DEVICE-TOKEN",
|
||||||
|
"application": "X-APPLICATION-TOKEN"
|
||||||
|
},
|
||||||
|
"identity": {
|
||||||
|
"device": "X-DEVICE-IDENTITY",
|
||||||
|
"domain": "X-DOMAIN-IDENTITY",
|
||||||
|
"system": "X-SYSTEM-IDENTITY",
|
||||||
|
"service": "X-SERVICE-IDENTITY",
|
||||||
|
"application": "X-APPLICATION-IDENTITY",
|
||||||
|
"user": "X-USER-IDENTITY"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unauthorized.html": "<HTML><BODY><H1>401 Unauthorized BAD CREDENTIALS</H1></BODY></HTML>"
|
||||||
|
}',
|
||||||
|
current_setting('migration.admin_token_secret'),
|
||||||
|
current_setting('migration.redis_host'),
|
||||||
|
current_setting('migration.redis_port')
|
||||||
|
))::jsonb);
|
||||||
-- converter
|
-- converter
|
||||||
INSERT INTO configs VALUES (2, 2, NULL, 't', NULL, NULL, ('{"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9553"}}}')::jsonb);
|
INSERT INTO configs VALUES (2, 2, NULL, 't', NULL, NULL, ('{"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9553"}}}')::jsonb);
|
||||||
-- router
|
-- router
|
||||||
INSERT INTO configs VALUES (3, 3, NULL, 't', NULL, NULL, ('{"database": {' ||
|
INSERT INTO configs VALUES (3, 3, NULL, 't', NULL, NULL, ('{
|
||||||
'"port": "' || current_setting('migration.db_port') || '", ' ||
|
"metrics": {
|
||||||
'"schema": "admin_service", ' ||
|
"gc": true,
|
||||||
'"address": "' || current_setting('migration.db_host') || '", ' ||
|
"memory": true,
|
||||||
'"database": "' || current_setting('migration.db_dbname') || '", ' ||
|
"address": {
|
||||||
'"password": "' || current_setting('migration.db_pass') || '", ' ||
|
"port": "9554",
|
||||||
'"username": "' || current_setting('migration.db_user') || '", ' ||
|
"ip": "0.0.0.0",
|
||||||
'"createSchema": true}, ' ||
|
"path": "/metrics"
|
||||||
'"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9554"}}' ||
|
}
|
||||||
'}')::jsonb);
|
}
|
||||||
|
}')::jsonb);
|
||||||
-- system
|
-- system
|
||||||
INSERT INTO configs VALUES (4, 4, NULL, 't', NULL, NULL, ('{"db": {' ||
|
INSERT INTO configs VALUES (4, 4, NULL, 't', NULL, NULL, (format('{
|
||||||
'"port": "' || current_setting('migration.db_port') || '", ' ||
|
"dB": {
|
||||||
'"schema": "system_service", ' ||
|
"password": "%s",
|
||||||
'"address": "' || current_setting('migration.db_host') || '", ' ||
|
"username": "%s",
|
||||||
'"database": "' || current_setting('migration.db_dbname') || '", ' ||
|
"createSchema": true,
|
||||||
'"password": "' || current_setting('migration.db_pass') || '", ' ||
|
"port": "%s",
|
||||||
'"username": "' || current_setting('migration.db_user') || '", ' ||
|
"schema": "system_service",
|
||||||
'"createSchema": true}, "RedisAddress": {' ||
|
"address": "%s",
|
||||||
'"ip": "' || current_setting('migration.redis_host') || '", ' ||
|
"database": "%s"
|
||||||
'"port": "' || current_setting('migration.redis_port') || '"' ||
|
},
|
||||||
'}, ' ||
|
"metrics": {
|
||||||
'"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9555"}}' ||
|
"address": {
|
||||||
'}')::jsonb);
|
"ip": "0.0.0.0",
|
||||||
|
"path": "/metrics",
|
||||||
|
"port": "9555"
|
||||||
|
},
|
||||||
|
"gc": true,
|
||||||
|
"memory": true
|
||||||
|
},
|
||||||
|
"redisAddress": {
|
||||||
|
"ip": "%s",
|
||||||
|
"port": "%s"
|
||||||
|
}
|
||||||
|
}', current_setting('migration.db_pass'),
|
||||||
|
current_setting('migration.db_user'),
|
||||||
|
current_setting('migration.db_port'),
|
||||||
|
current_setting('migration.db_host'),
|
||||||
|
current_setting('migration.db_dbname'),
|
||||||
|
current_setting('migration.redis_host'),
|
||||||
|
current_setting('migration.redis_port')
|
||||||
|
))::jsonb);
|
||||||
-- admin
|
-- admin
|
||||||
INSERT INTO configs VALUES (5, 5, NULL, 't', NULL, NULL, ('{"database": {' ||
|
INSERT INTO configs VALUES (5, 5, NULL, 't', NULL, NULL, (format('{
|
||||||
'"port": "' || current_setting('migration.db_port') || '", ' ||
|
"metrics": {
|
||||||
'"schema": "admin_service", ' ||
|
"gc": true,
|
||||||
'"address": "' || current_setting('migration.db_host') || '", ' ||
|
"memory": true,
|
||||||
'"database": "' || current_setting('migration.db_dbname') || '", ' ||
|
"address": {
|
||||||
'"password": "' || current_setting('migration.db_pass') || '", ' ||
|
"path": "/metrics",
|
||||||
'"username": "' || current_setting('migration.db_user') || '", ' ||
|
"port": "9557",
|
||||||
'"createSchema": true}, ' ||
|
"ip": "0.0.0.0"
|
||||||
'"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9557"}}' ||
|
}
|
||||||
'}')::jsonb);
|
},
|
||||||
|
"database": {
|
||||||
|
"password": "%s",
|
||||||
|
"username": "%s",
|
||||||
|
"createSchema": true,
|
||||||
|
"port": "%s",
|
||||||
|
"schema": "admin_service",
|
||||||
|
"address": "%s",
|
||||||
|
"database": "%s"
|
||||||
|
},
|
||||||
|
"secretKey": "%s"
|
||||||
|
}',
|
||||||
|
current_setting('migration.db_pass'),
|
||||||
|
current_setting('migration.db_user'),
|
||||||
|
current_setting('migration.db_port'),
|
||||||
|
current_setting('migration.db_host'),
|
||||||
|
current_setting('migration.db_dbname'),
|
||||||
|
current_setting('migration.admin_token_secret')
|
||||||
|
))::jsonb);
|
||||||
|
|
||||||
SELECT setval(pg_get_serial_sequence('configs', 'id'), 6, FALSE);
|
SELECT setval(pg_get_serial_sequence('configs', 'id'), 6, FALSE);
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
DELETE FROM configs WHERE id IN (1,2,3,4,5)
|
DELETE FROM configs WHERE id IN (1,2,3,4,5)
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migration.db_host = 'msk-pgsql.isp.mobi';
|
set migration.db_host = 'isp-pgsql';
|
||||||
set migration.db_port = '5432';
|
set migration.db_port = '5432';
|
||||||
set migration.db_dbname = 'isp-alpha';
|
set migration.db_dbname = 'isp-test';
|
||||||
set migration.db_user = 'isp-alpha';
|
set migration.db_user = 'isp-test';
|
||||||
set migration.db_pass = 'JxY96xLF8zfh3g8EWvSDtLUBw';
|
set migration.db_pass = '123321';
|
||||||
|
|
||||||
set migration.redis_host = '10.250.9.117';
|
set migration.redis_host = 'isp-redis';
|
||||||
set migration.redis_port = '6379';
|
set migration.redis_port = '6379';
|
||||||
|
|
||||||
-- user
|
-- user
|
||||||
@@ -54,7 +54,7 @@ INSERT INTO configs VALUES (8, 8, NULL, 't', NULL, NULL, '{
|
|||||||
"backends": [
|
"backends": [
|
||||||
{
|
{
|
||||||
"id": "450e754f-aafb-4a9c-8d87-23c6a2da9833",
|
"id": "450e754f-aafb-4a9c-8d87-23c6a2da9833",
|
||||||
"url": "http://{{ cname }}-nginx.isp.mobi:18888/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
"url": "http://{{ cname }}-nginx.{{ main_domain }}:18888/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
||||||
"name": "citymatica_user_new",
|
"name": "citymatica_user_new",
|
||||||
"wrapList": true,
|
"wrapList": true,
|
||||||
"createDate": "2018-09-07T09:41:03.853Z",
|
"createDate": "2018-09-07T09:41:03.853Z",
|
||||||
@@ -64,7 +64,7 @@ INSERT INTO configs VALUES (8, 8, NULL, 't', NULL, NULL, '{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "74d76314-b28b-11e8-96f8-529269fb1459",
|
"id": "74d76314-b28b-11e8-96f8-529269fb1459",
|
||||||
"url": "http://{{ cname }}-nginx.isp.mobi:18880/ru.mp.storage.backend.ws/backend?wsdl",
|
"url": "http://{{ cname }}-nginx.{{ main_domain }}:18880/ru.mp.storage.backend.ws/backend?wsdl",
|
||||||
"name": "citymatica_user_old",
|
"name": "citymatica_user_old",
|
||||||
"wrapList": true,
|
"wrapList": true,
|
||||||
"createDate": "2018-09-07T09:41:03.853Z",
|
"createDate": "2018-09-07T09:41:03.853Z",
|
||||||
@@ -74,7 +74,7 @@ INSERT INTO configs VALUES (8, 8, NULL, 't', NULL, NULL, '{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "74d7659e-b28b-11e8-96f8-529269fb1459",
|
"id": "74d7659e-b28b-11e8-96f8-529269fb1459",
|
||||||
"url": "http://{{ cname }}-nginx.isp.mobi:18890/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
"url": "http://{{ cname }}-nginx.{{ main_domain }}:18890/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
||||||
"name": "citymatica_user_object_storage",
|
"name": "citymatica_user_object_storage",
|
||||||
"wrapList": true,
|
"wrapList": true,
|
||||||
"createDate": "2018-09-07T09:41:03.853Z",
|
"createDate": "2018-09-07T09:41:03.853Z",
|
||||||
@@ -84,7 +84,7 @@ INSERT INTO configs VALUES (8, 8, NULL, 't', NULL, NULL, '{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "74d75cc0-b28b-11e8-96f8-529269fb1459",
|
"id": "74d75cc0-b28b-11e8-96f8-529269fb1459",
|
||||||
"url": "http://{{ cname }}-nginx.isp.mobi:18891/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
"url": "http://{{ cname }}-nginx.{{ main_domain }}:18891/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
||||||
"name": "citymatica_user_events",
|
"name": "citymatica_user_events",
|
||||||
"wrapList": true,
|
"wrapList": true,
|
||||||
"createDate": "2018-09-07T09:41:03.853Z",
|
"createDate": "2018-09-07T09:41:03.853Z",
|
||||||
@@ -94,7 +94,7 @@ INSERT INTO configs VALUES (8, 8, NULL, 't', NULL, NULL, '{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "d5575047-6588-46d9-be58-b487d42d217c",
|
"id": "d5575047-6588-46d9-be58-b487d42d217c",
|
||||||
"url": "http://{{ cname }}-nginx.isp.mobi:18889/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
"url": "http://{{ cname }}-nginx.{{ main_domain }}:18889/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
||||||
"name": "citymatica_operator",
|
"name": "citymatica_operator",
|
||||||
"wrapList": true,
|
"wrapList": true,
|
||||||
"createDate": "2018-09-07T09:41:03.853Z",
|
"createDate": "2018-09-07T09:41:03.853Z",
|
||||||
@@ -104,7 +104,7 @@ INSERT INTO configs VALUES (8, 8, NULL, 't', NULL, NULL, '{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "74d76094-b28b-11e8-96f8-529269fb1459",
|
"id": "74d76094-b28b-11e8-96f8-529269fb1459",
|
||||||
"url": "http://{{ cname }}-nginx.isp.mobi:18895/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
"url": "http://{{ cname }}-nginx.{{ main_domain }}:18895/ru.isp.starter.awip.backend.ws/backend?wsdl",
|
||||||
"name": "citymatica_operator_metrics",
|
"name": "citymatica_operator_metrics",
|
||||||
"wrapList": true,
|
"wrapList": true,
|
||||||
"createDate": "2018-09-07T09:41:03.853Z",
|
"createDate": "2018-09-07T09:41:03.853Z",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ CREATE TABLE config_schemas (
|
|||||||
CREATE TRIGGER update_schema_create_time
|
CREATE TRIGGER update_schema_create_time
|
||||||
BEFORE INSERT OR UPDATE
|
BEFORE INSERT OR UPDATE
|
||||||
ON config_schemas
|
ON config_schemas
|
||||||
FOR EACH ROW EXECUTE PROCEDURE update_created_column_date();
|
FOR EACH ROW EXECUTE PROCEDURE update_created_modified_column_date();
|
||||||
|
|
||||||
CREATE INDEX IX_schemes_moduleId
|
CREATE INDEX IX_schemes_moduleId
|
||||||
ON config_schemas
|
ON config_schemas
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migration.db_host = 'msk-pgsql.isp.mobi';
|
set migration.db_host = 'isp-pgsql';
|
||||||
set migration.db_port = '5432';
|
set migration.db_port = '5432';
|
||||||
set migration.db_dbname = 'isp-alpha';
|
set migration.db_dbname = 'isp-test';
|
||||||
set migration.db_user = 'isp-alpha';
|
set migration.db_user = 'isp-test';
|
||||||
set migration.db_pass = 'JxY96xLF8zfh3g8EWvSDtLUBw';
|
set migration.db_pass = '123321';
|
||||||
|
|
||||||
WITH moduleVar AS (
|
WITH moduleVar AS (
|
||||||
INSERT INTO modules (instance_id, name, active) VALUES (1, 'template', 't') RETURNING id
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'template', 't') RETURNING id
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migration.nats_host = '10.250.9.117';
|
set migration.nats_host = 'isp-nats';
|
||||||
set migration.nats_port = '4223';
|
set migration.nats_port = '4223';
|
||||||
set migration.nats_cluster_id = 'test-cluster';
|
set migration.nats_cluster_id = 'test-cluster';
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@ VALUES ((SELECT id FROM moduleVar), 't', (
|
|||||||
"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9561"}},
|
"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9561"}},
|
||||||
"firebaseConfig": {
|
"firebaseConfig": {
|
||||||
"token_uri": "https://accounts.google.com/o/oauth2/token",
|
"token_uri": "https://accounts.google.com/o/oauth2/token",
|
||||||
"client_id": "115553569331708875508",
|
"client_id": "",
|
||||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
||||||
"client_email": "firebase-adminsdk-f70qo@test-ccdab.iam.gserviceaccount.com",
|
"client_email": "firebase-adminsdk-f70qo@test-ccdab.iam.gserviceaccount.com",
|
||||||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCM7Rl7AmGQSOxx\nUdQs+yY7cwaUmqi2khmsre0/kfJU2zCJxotbYNeyfWJZk3D8hngxnmI6hrYqWEq3\nyy/J8rhI7AmcY3eXC1yyL/sKTClFjyZVEoDcBWTn0HOuM8YAQAqRAx2vznKDquoj\nLgUHl09qTxsVRmPdfc7fKE45OZBdetA/kdIEd4S5J+CKeYB7tpuT+0eL4QUNOzE1\n6SGqYnhA97QD7K3ylhWxKC8U0Ozyqub/OTg7WRLEYV36Z+6Ok0BZkYiCXbUNukST\nXaKc8DGAFrzcu7jW8rJIRZ/uc/Im5judjuMRznzu1SMPVT6pL8HfduGFc23FIAL/\nGjmcDwWbAgMBAAECggEAETe6oDvHPcCbGrE7sg8xOZwxFqDasguhlWZekSC8sb9h\n68NVLWHkmIsXJAiOilvHfZBzQeFJilzlLBVoDk1YVJh6CCBi8RJTTfXsvvJVLIlz\nznsHQVprXKMsLwFmVIt+fv8ZdmxLs2iDWK77sFS9QCjQD0ZdVydSyhL7k6RDzhfP\nw6It0H3JyyqD8W7DOvYSUfi/oZKZvufBAkEauhuiVVyite97cJtV8YNmiVCznOtK\nOw0OpuzemKez0rh673VtEEvUgrvOy5WNtjunoRkNKZkW1JiAWYpf6FpOOFub/lG3\nQPFwjLZeEUa8xc/E2JJP6HQMON0qF5zvtKr4QH/9uQKBgQDByXfLh+56Cu+6E0CL\nigH0GmagwZQnw7/+zhi1AhC2DjxAmXq9Y0kFrmpwr6FXqtRJm5AANOipASsRknaq\n5kAlDCGdqHnw1LDlNbrxywDvTYADo13ebx2cXfxESDfx0gofXehGhfFfOyXJ0lwp\ngXbgxIQFNjv2QWjSdb637ZaOrQKBgQC6KzmZcMAWo7j+eGo0WoAVTCVu/SDcV/sG\nF4+NxhLjMYSuMbBF7BdMy1rJ6g3SrdULGzw0KDeEqo1XzneOyzHOnEiZFKTkgIPQ\n347fWOYTBKMNEJd37jAIHKrrFiyD/pvL2ZLu1mSnCHsi/v5u02gqpf8Vkvwo/5ME\n4BuhB/PWZwKBgQC7V0adl+rfR0VcURJcE+4xi3hdvua4zpAFCD9wde+r4PU0ymuT\nPbGxcV1rVQ8YTojuJBrBaGToRb3aPgrEytWGO0UgQmiofyYIYLo62LMtpXG1krDD\nwg4RRfcEGAEloZWxnzpXO1QOaYLtqpT4dzVys+ihlT3AoplwpO3cqC6d/QKBgEGu\nkmnSX9Mc/F27eizyaRIahXJ9GCTlXYkustUgNvW1OMyEd16UBzxu2p82Vp4n+mwq\ntbjpH31M9wUtsPzOL8pnVS29HNgJh3ggB7ZBFRtMnYI0glwrywJxqtO6RQZkw+7N\n2ostVOGhmmAkevv61luFqVOhQhns4Z/suZK8zYitAoGAHwLWUQViCy0HFkhED5GV\nWrZZFRH2ucpK+ljOp7dbbUPA+dTD2qu/hho3QCaT5odJWap42TbSL6YhZg/7jN7h\nOSQW8DiDPzjUtL1gfqOxJdQavrgR2a2AW054loM0R508699Vx6Hir/ayD4nZ9IUo\nm2meeJVZcknz/L9LXOOIUBk=\n-----END PRIVATE KEY-----\n",
|
"private_key": "",
|
||||||
"private_key_id": "88d1af761304de758388747d72931c3457df54ef",
|
"private_key_id": "",
|
||||||
"project_id": "test-ccdab",
|
"project_id": "test-ccdab",
|
||||||
"type": "service_account",
|
"type": "service_account",
|
||||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||||
@@ -48,7 +48,7 @@ VALUES ((SELECT id FROM moduleVar), 't', (format('{
|
|||||||
"default": true,
|
"default": true,
|
||||||
"poolSize": 1,
|
"poolSize": 1,
|
||||||
"connection": {
|
"connection": {
|
||||||
"password": "1q2w3e!",
|
"password": "",
|
||||||
"user": "isp",
|
"user": "isp",
|
||||||
"address": {
|
"address": {
|
||||||
"ip": "5.187.0.65",
|
"ip": "5.187.0.65",
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migrationRead.db_host = 'msk-pgsql.isp.mobi';
|
set migrationWrite.db_host = 'isp-pgsql';
|
||||||
set migrationRead.db_port = '5432';
|
|
||||||
set migrationRead.db_dbname = 'isp-alpha';
|
|
||||||
set migrationRead.db_user = 'isp-alpha';
|
|
||||||
set migrationRead.db_pass = 'JxY96xLF8zfh3g8EWvSDtLUBw';
|
|
||||||
|
|
||||||
set migrationWrite.db_host = 'msk-pgsql.isp.mobi';
|
|
||||||
set migrationWrite.db_port = '5432';
|
set migrationWrite.db_port = '5432';
|
||||||
set migrationWrite.db_dbname = 'isp-alpha';
|
set migrationWrite.db_dbname = 'isp-test';
|
||||||
set migrationWrite.db_user = 'isp-alpha';
|
set migrationWrite.db_user = 'isp-test';
|
||||||
set migrationWrite.db_pass = 'JxY96xLF8zfh3g8EWvSDtLUBw';
|
set migrationWrite.db_pass = '123321';
|
||||||
|
|
||||||
set migrationNotification.db_host = 'msk-pgsql.isp.mobi';
|
set migrationRead.db_host = 'isp-pgsql';
|
||||||
set migrationNotification.db_port = '5432';
|
set migrationRead.db_port = '5432';
|
||||||
set migrationNotification.db_dbname = 'isp-alpha';
|
set migrationRead.db_dbname = 'isp-test';
|
||||||
set migrationNotification.db_user = 'isp-alpha';
|
set migrationRead.db_user = 'isp-test';
|
||||||
set migrationNotification.db_pass = 'JxY96xLF8zfh3g8EWvSDtLUBw';
|
set migrationRead.db_pass = '123321';
|
||||||
|
|
||||||
|
set "rabbit.host" = 'isp-rabbit';
|
||||||
|
set "rabbit.port" = '5672';
|
||||||
|
set "rabbit.user" = 'guest';
|
||||||
|
set "rabbit.password" = 'guest';
|
||||||
|
|
||||||
WITH moduleVar AS (
|
WITH moduleVar AS (
|
||||||
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm', 't') RETURNING id
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm', 't') RETURNING id
|
||||||
@@ -24,31 +23,66 @@ WITH moduleVar AS (
|
|||||||
INSERT INTO configs (module_id, active, data) VALUES (
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
(SELECT id FROM moduleVar),
|
(SELECT id FROM moduleVar),
|
||||||
't',
|
't',
|
||||||
('{"databaseRead": {' ||
|
((format('{
|
||||||
'"port": "' || current_setting('migrationRead.db_port') || '", ' ||
|
"queue": {
|
||||||
'"schema": "mdm_service", ' ||
|
"exchange": "notifications",
|
||||||
'"address": "' || current_setting('migrationRead.db_host') || '", ' ||
|
"notifierQueue": "notifier.queue",
|
||||||
'"database": "' || current_setting('migrationRead.db_dbname') || '", ' ||
|
"searcherQueue": "searcher.queue"
|
||||||
'"password": "' || current_setting('migrationRead.db_pass') || '", ' ||
|
},
|
||||||
'"username": "' || current_setting('migrationRead.db_user') || '", ' ||
|
"rabbit": {
|
||||||
'"createSchema": true},' ||
|
"user": "%s",
|
||||||
'"metrics": {"gc": true, "memory": true, "address": {"ip": "0.0.0.0", "path": "/metrics", "port": "9568"}},' ||
|
"address": {
|
||||||
'"databaseWrite": {' ||
|
"ip": "%s",
|
||||||
'"port": "' || current_setting('migrationWrite.db_port') || '", ' ||
|
"port": "%s"
|
||||||
'"schema": "mdm_service", ' ||
|
},
|
||||||
'"address": "' || current_setting('migrationWrite.db_host') || '", ' ||
|
"password": "%s"
|
||||||
'"database": "' || current_setting('migrationWrite.db_dbname') || '", ' ||
|
},
|
||||||
'"password": "' || current_setting('migrationWrite.db_pass') || '", ' ||
|
"metrics": {
|
||||||
'"username": "' || current_setting('migrationWrite.db_user') || '", ' ||
|
"gc": true,
|
||||||
'"createSchema": true},' ||
|
"memory": true,
|
||||||
'"databaseNotifications": {' ||
|
"address": {
|
||||||
'"port": "' || current_setting('migrationNotification.db_port') || '", ' ||
|
"ip": "0.0.0.0",
|
||||||
'"schema": "mdm_service", ' ||
|
"path": "/metrics",
|
||||||
'"address": "' || current_setting('migrationNotification.db_host') || '", ' ||
|
"port": "9568"
|
||||||
'"database": "' || current_setting('migrationNotification.db_dbname') || '", ' ||
|
}
|
||||||
'"password": "' || current_setting('migrationNotification.db_pass') || '", ' ||
|
},
|
||||||
'"username": "' || current_setting('migrationNotification.db_user') || '", ' ||
|
"databaseRead": {
|
||||||
'"createSchema": true}}')::jsonb);
|
"password": "%s",
|
||||||
|
"username": "%s",
|
||||||
|
"createSchema": true,
|
||||||
|
"port": "%s",
|
||||||
|
"schema": "mdm_service",
|
||||||
|
"address": "%s",
|
||||||
|
"database": "%s"
|
||||||
|
},
|
||||||
|
"databaseWrite": {
|
||||||
|
"password": "%s",
|
||||||
|
"username": "%s",
|
||||||
|
"createSchema": true,
|
||||||
|
"port": "%s",
|
||||||
|
"schema": "mdm_service",
|
||||||
|
"address": "%s",
|
||||||
|
"database": "%s"
|
||||||
|
},
|
||||||
|
"externalIdListLimit": 10000
|
||||||
|
}', current_setting('rabbit.user'),
|
||||||
|
current_setting('rabbit.host'),
|
||||||
|
current_setting('rabbit.port'),
|
||||||
|
current_setting('rabbit.password'),
|
||||||
|
|
||||||
|
current_setting('migrationRead.db_pass'),
|
||||||
|
current_setting('migrationRead.db_user'),
|
||||||
|
current_setting('migrationRead.db_port'),
|
||||||
|
current_setting('migrationRead.db_host'),
|
||||||
|
current_setting('migrationRead.db_dbname'),
|
||||||
|
|
||||||
|
current_setting('migrationWrite.db_pass'),
|
||||||
|
current_setting('migrationWrite.db_user'),
|
||||||
|
current_setting('migrationWrite.db_port'),
|
||||||
|
current_setting('migrationWrite.db_host'),
|
||||||
|
current_setting('migrationWrite.db_dbname')
|
||||||
|
|
||||||
|
)) :: jsonb));
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migration.nats_host = '10.250.9.117';
|
set migration.nats_host = 'isp-nats';
|
||||||
set migration.nats_port = '4223';
|
set migration.nats_port = '4223';
|
||||||
set migration.nats_cluster_id = 'test-cluster';
|
set migration.nats_cluster_id = 'test-cluster';
|
||||||
|
|
||||||
set migration.rabbit_host = '10.250.9.117';
|
set migration.rabbit_host = 'isp-rabbit';
|
||||||
set migration.rabbit_port = '5672';
|
set migration.rabbit_port = '5672';
|
||||||
set migration.rabbit_user = 'guest';
|
set migration.rabbit_user = 'guest';
|
||||||
set migration.rabbit_password = 'guest';
|
set migration.rabbit_password = 'guest';
|
||||||
set migration.rabbit_system_queue_prefix = 'test';
|
set migration.rabbit_system_queue_prefix = 'isp-test';
|
||||||
|
|
||||||
WITH moduleVar AS (
|
WITH moduleVar AS (
|
||||||
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-notify', 't') RETURNING id
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-notify', 't') RETURNING id
|
||||||
@@ -18,29 +18,29 @@ INSERT INTO configs (module_id, active, data) VALUES (
|
|||||||
't',
|
't',
|
||||||
('{
|
('{
|
||||||
"notifyConfigurations":[],
|
"notifyConfigurations":[],
|
||||||
|
"logRabbitEnabled": false,
|
||||||
"logger": {
|
"logger": {
|
||||||
|
"asyncLogger":{
|
||||||
|
"enable": false,
|
||||||
|
"nats": {
|
||||||
|
"address": {
|
||||||
|
"port": "' || current_setting('migration.nats_port') || '",
|
||||||
|
"ip": "' || current_setting('migration.nats_host') || '"
|
||||||
|
},
|
||||||
|
"clusterId": "' || current_setting('migration.nats_cluster_id') || '"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"syncLogger": {
|
||||||
|
"enable": false,
|
||||||
|
"filename": "/opt/isp/isp-mdm-notify-service/events_logs/events.log"
|
||||||
|
},
|
||||||
"sendAddRequestSudirV1IsOn": true,
|
"sendAddRequestSudirV1IsOn": true,
|
||||||
"sendFindRequestSudirV1IsOn": true,
|
"sendFindRequestSudirV1IsOn": true,
|
||||||
"sendUpdateRequestSudirV1IsOn": true,
|
"sendUpdateRequestSudirV1IsOn": true,
|
||||||
"sendUpdateRequestSudirV2IsOn": true,
|
"sendUpdateRequestSudirV2IsOn": true,
|
||||||
"creatingSystemNotificationsIsOn": true,
|
"creatingSystemNotificationsIsOn": true,
|
||||||
"sendErlRequestQueueIsOn": true,
|
"sendErlRequestQueueIsOn": true,
|
||||||
"sendJsonRequestQueueIsOn": true,
|
"sendJsonRequestQueueIsOn": true
|
||||||
"syncLogger": {
|
|
||||||
"enable": false,
|
|
||||||
"filename": "/opt/isp/isp-mdm-notify-service/events_logs/events.log.gz"
|
|
||||||
},
|
|
||||||
"asyncLogger": {
|
|
||||||
"enable": false,
|
|
||||||
"nats": {
|
|
||||||
"address": {
|
|
||||||
"ip": "mdm-taxcom-test-nats.isp.mobi",
|
|
||||||
"port": "4222"
|
|
||||||
},
|
|
||||||
"clusterId": "work-cluster"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sendAddRequestSudirV1IsOn": true
|
|
||||||
},
|
},
|
||||||
"metrics":{
|
"metrics":{
|
||||||
"gc": true,
|
"gc": true,
|
||||||
@@ -61,27 +61,10 @@ INSERT INTO configs (module_id, active, data) VALUES (
|
|||||||
"address": {
|
"address": {
|
||||||
"ip": "' || current_setting('migration.rabbit_host') || '",
|
"ip": "' || current_setting('migration.rabbit_host') || '",
|
||||||
"port": "' || current_setting('migration.rabbit_port') || '"
|
"port": "' || current_setting('migration.rabbit_port') || '"
|
||||||
}
|
},
|
||||||
"queue": {
|
"queue": {
|
||||||
"name": "notifier.queue",
|
"name": "notifier.queue",
|
||||||
"prefetchCount": 1000
|
"prefetchCount": 1000
|
||||||
},
|
|
||||||
},
|
|
||||||
"logRabbitEnabled": true,
|
|
||||||
"logRabbit": {
|
|
||||||
"address": {
|
|
||||||
"ip": "10.250.9.50",
|
|
||||||
"port": "5672"
|
|
||||||
},
|
|
||||||
"password": "ohk7athXehev3aiGfic2ZeiD",
|
|
||||||
"routingKey": "mdm-taxcom-test.notify.log",
|
|
||||||
"exchangeName": "mdm-taxcom-test.notify.log",
|
|
||||||
"systemQueuesPrefix": "mdm-taxcom-test",
|
|
||||||
"declareQueueAndExchange": true,
|
|
||||||
"user": "isp",
|
|
||||||
"queue": {
|
|
||||||
"name": "mdm-taxcom-test.notify.log.queue",
|
|
||||||
"prefetchCount": 300
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}')::jsonb);
|
}')::jsonb);
|
||||||
|
|||||||
@@ -1,105 +1,117 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
WITH moduleVar AS (
|
WITH moduleVar AS (
|
||||||
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-notify', 't') RETURNING id
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-converter', 't') RETURNING id
|
||||||
)
|
)
|
||||||
|
|
||||||
INSERT INTO configs (module_id, active, data) VALUES (
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
(SELECT id FROM moduleVar),
|
(SELECT id FROM moduleVar),
|
||||||
't',
|
't',
|
||||||
('{
|
('{
|
||||||
"rules": {
|
"rules": {
|
||||||
"1": [
|
"1": {
|
||||||
"etalon_id",
|
"availableFields": [
|
||||||
"last_name",
|
"*"
|
||||||
"$$documents.#passport",
|
],
|
||||||
"vehicles",
|
"formatting": {
|
||||||
"addresses"
|
"sudir_v1": {
|
||||||
|
"birth_dt": "dateFormatter",
|
||||||
|
"documents.1000016.start_dt": "dateFormatter"
|
||||||
|
},
|
||||||
|
"sudir_v2": {
|
||||||
|
"birth_dt": "dateFormatter",
|
||||||
|
"documents.1000016.start_dt": "dateFormatter"
|
||||||
|
},
|
||||||
|
"sudir_v1_find": {
|
||||||
|
"documents.1000016.start_dt": "dateFormatter",
|
||||||
|
"birth_dt": "dateFormatter"
|
||||||
|
},
|
||||||
|
"sudir_v2_find": {
|
||||||
|
"birth_dt": "dateFormatter",
|
||||||
|
"documents.1000016.start_dt": "dateFormatter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultValues": {
|
||||||
|
"sma": {
|
||||||
|
"*": "%undefined%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"availableFields": [
|
||||||
|
"*"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mappingSchema": {
|
"10": {
|
||||||
"$$documents.1000019.ref_num": "DRIVER_LICENSE.DriverLicense",
|
"availableFields": [
|
||||||
"gkupays.mesmeter": "[]HOUSE.MesMeterNumber",
|
"*"
|
||||||
"$$documents.1000016.start_dt": "PASSPORT_RF.PassportIssueDate",
|
]
|
||||||
"$$addresses.1000009.moscow_district_id": "[]REG_ADDRESS.RegAddressDistrictId",
|
|
||||||
"$$addresses.7.unom": "[]ADDRESS.RealAddressUnom",
|
|
||||||
"$$addresses.1000009.unom": "[]REG_ADDRESS.RegAddressUnom",
|
|
||||||
"$$addresses.1000009.moscow_area_ext_id": "[]REG_ADDRESS.RegAddressAreaId",
|
|
||||||
"$$addresses.7.moscow_area_ext_id": "[]ADDRESS.RealAddressAreaId",
|
|
||||||
"$$escredentials.1000004.etalon_id": "[]OLYMPIAD.OlympiadId",
|
|
||||||
"last_name": "FIO.LastName",
|
|
||||||
"vehicles.reg_number": "[]VEHICLE.VehicleRegistrationNumber",
|
|
||||||
"$$contacts.1.ref_num": "REG_DATA.Phone",
|
|
||||||
"$$addresses.7.corpus_no": "[]ADDRESS.RealAddressCorpus",
|
|
||||||
"$$users.NOT_SSO.id_value": "USER.LoginName",
|
|
||||||
"$$addresses.7.residence_num": "[]ADDRESS.RealAddressFlat",
|
|
||||||
"$$users.SSO.id_value": "USER.LoginName",
|
|
||||||
"birth_place_line_one": "PASSPORT_RF.PassportBirthPlace",
|
|
||||||
"$$addresses.7.house_no": "[]ADDRESS.RealAddressHouse",
|
|
||||||
"$$addresses.1000009.street_name_ex": "[]REG_ADDRESS.RegAddressStreet",
|
|
||||||
"gkupays.mesaccount": "[]HOUSE.MesAccountNumber",
|
|
||||||
"vehicles.etalon_id": "[]VEHICLE.VehicleId",
|
|
||||||
"$$addresses.7.street_id": "[]ADDRESS.RealAddressStreetId",
|
|
||||||
"$$documents.1000014.ref_num": "COMPLEX_OMS.oms",
|
|
||||||
"$$addresses.1000009.stroenie_no": "[]REG_ADDRESS.RegAddressBuilding",
|
|
||||||
"$$addresses.7.moscow_district_id": "[]ADDRESS.RealAddressDistrictId",
|
|
||||||
"$$addresses.7.unad": "[]ADDRESS.RealAddressUnad",
|
|
||||||
"vehicles.pts_number": "[]VEHICLE.VehiclePTSNumber",
|
|
||||||
"$$documents.1000016.identification_issuer": "PASSPORT_RF.PassportIssuer",
|
|
||||||
"etalon_id": "USER.LoginName",
|
|
||||||
"$$addresses.1000009.street_id": "[]REG_ADDRESS.RegAddressStreetId",
|
|
||||||
"$$escredentials.1000003.etalon_id": "[]GIA.GIAId",
|
|
||||||
"$$addresses.1000009.moscow_district_name": "[]REG_ADDRESS.RegAddressDistrict",
|
|
||||||
"given_name_one": "FIO.FirstName",
|
|
||||||
"vehicles.vin_number": "[]VEHICLE.VehicleVin",
|
|
||||||
"$$escredentials.1000004.login": "[]OLYMPIAD.OlympiadLogin",
|
|
||||||
"$$escredentials.1000003.doc_number": "[]GIA.GIADocNumber",
|
|
||||||
"$$addresses.1000009.moscow_area_name": "[]REG_ADDRESS.RegAddressArea",
|
|
||||||
"gkupays.gkupay_address_rel": "[]HOUSE.EpdAddressId",
|
|
||||||
"$$addresses.7.building_name": "[]ADDRESS.RealAddressHouseId",
|
|
||||||
"$$addresses.7.moscow_area_name": "[]ADDRESS.RealAddressArea",
|
|
||||||
"$$addresses.7.moscow_district_name": "[]ADDRESS.RealAddressDistrict",
|
|
||||||
"gender_tp_code": "PERSON.Gender",
|
|
||||||
"$$addresses.7.stroenie_no": "[]ADDRESS.RealAddressBuilding",
|
|
||||||
"$$documents.1000013.ref_num": "TAX_INFO.INN",
|
|
||||||
"$$addresses.1000009.building_name": "[]REG_ADDRESS.RegAddressHouseId",
|
|
||||||
"$$escredentials.1000004.description": "[]OLYMPIAD.OlympiadComment",
|
|
||||||
"birth_dt": "PERSON.Birthday",
|
|
||||||
"gkupays.epd": "[]HOUSE.EpdAddressNumber",
|
|
||||||
"$$addresses.1000009.house_no": "[]REG_ADDRESS.RegAddressHouse",
|
|
||||||
"$$addresses.1000009.street_omk": "[]REG_ADDRESS.RegAddressStreetOMK",
|
|
||||||
"$$citizen_relatives.OTHERS.etalon_id": "[]RELATIVES.RltvId",
|
|
||||||
"vehicles.stsnumber": "[]VEHICLE.VehicleSTSNumber",
|
|
||||||
"vehicles.description": "[]VEHICLE.VehicleDescription",
|
|
||||||
"$$addresses.1000009.unad": "[]REG_ADDRESS.RegAddressUnad",
|
|
||||||
"$$escredentials.1000004.password": "[]OLYMPIAD.OlympiadPassword",
|
|
||||||
"gkupays.phone": "[]HOUSE.EpdAddressCityPhone",
|
|
||||||
"$$addresses.7.street_omk": "[]ADDRESS.RealAddressStreetOMK",
|
|
||||||
"$$documents.1000019.start_dt": "DRIVER_LICENSE.DriverLicenseIssueDate",
|
|
||||||
"$$addresses.1000009.corpus_no": "[]REG_ADDRESS.RegAddressCorpus",
|
|
||||||
"$$citizen_relatives.1000004.etalon_id": "[]CHILDREN.ChildId",
|
|
||||||
"$$documents.1000016.identification_issuer_code": "PASSPORT_RF.PassportIssuerCode",
|
|
||||||
"$$escredentials.1000003.login": "[]GIA.GIARegCode",
|
|
||||||
"$$addresses.1000009.residence_num": "[]REG_ADDRESS.RegAddressFlat",
|
|
||||||
"given_name_two": "FIO.MiddleName",
|
|
||||||
"$$contacts.2.ref_num": "REG_DATA.Email",
|
|
||||||
"$$documents.1000015.ref_num": "SNILS.snils",
|
|
||||||
"$$documents.1000016.ref_num": "PASSPORT_RF.PassportNumber",
|
|
||||||
"$$addresses.7.street_name_ex": "[]ADDRESS.RealAddressStreet",
|
|
||||||
"$$documents.1000014.etalon_id": "COMPLEX_OMS.OmsId",
|
|
||||||
"$$escredentials.1000003.description": "[]GIA.GIAComment",
|
|
||||||
"$$citizen_relatives.1000003.etalon_id": "[]CHILDREN.ChildId",
|
|
||||||
"$$documents.1000016.identification_passport_birth_place": "PASSPORT_RF.PassportBirthPlace"
|
|
||||||
},
|
|
||||||
"metrics": {
|
|
||||||
"memory": true,
|
|
||||||
"address": {
|
|
||||||
"path": "/metrics",
|
|
||||||
"port": "9571",
|
|
||||||
"ip": "0.0.0.0"
|
|
||||||
},
|
|
||||||
"gc": true
|
|
||||||
}
|
}
|
||||||
}')::jsonb);
|
},
|
||||||
|
"metrics": {
|
||||||
|
"address": {
|
||||||
|
"ip": "0.0.0.0",
|
||||||
|
"path": "/metrics",
|
||||||
|
"port": "9571"
|
||||||
|
},
|
||||||
|
"gc": true,
|
||||||
|
"memory": true
|
||||||
|
},
|
||||||
|
"formatters": {
|
||||||
|
"dateFormatter": {
|
||||||
|
"type": "DATE_TIME",
|
||||||
|
"outFormat": "2006-01-02",
|
||||||
|
"inputFormat": "2006-01-02 15:04:05.999"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappingSchema": {
|
||||||
|
"sudir_v2_find": {
|
||||||
|
"type": "sudir",
|
||||||
|
"extends": [
|
||||||
|
"sudir_v2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"erl": {
|
||||||
|
"extends": [],
|
||||||
|
"mapping": {}
|
||||||
|
},
|
||||||
|
"sma": {
|
||||||
|
"mapping": {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sudir": {
|
||||||
|
"type": "sudir",
|
||||||
|
"mapping": {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sudir_v1": {
|
||||||
|
"type": "sudir",
|
||||||
|
"extends": [
|
||||||
|
"sudir"
|
||||||
|
],
|
||||||
|
"mapping": {}
|
||||||
|
},
|
||||||
|
"sudir_v2": {
|
||||||
|
"type": "sudir",
|
||||||
|
"extends": [
|
||||||
|
"sudir"
|
||||||
|
],
|
||||||
|
"mapping": {}
|
||||||
|
},
|
||||||
|
"sudir_v1_find": {
|
||||||
|
"type": "sudir",
|
||||||
|
"extends": [
|
||||||
|
"sudir_v1"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"test_protocol": {
|
||||||
|
"mapping": {
|
||||||
|
"etalon_id": "id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
)::jsonb);
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|
||||||
@@ -1,50 +1,55 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set migration.nats_host = '10.250.9.117';
|
set migration.nats_host = 'isp-nats';
|
||||||
set migration.nats_port = '4223';
|
set migration.nats_port = '4223';
|
||||||
set migration.nats_cluster_id = 'test-cluster';
|
set migration.nats_cluster_id = 'test-cluster';
|
||||||
|
|
||||||
set migration.rabbit_host = '10.250.9.117';
|
set migration.rabbit_host = 'isp-rabbit';
|
||||||
set migration.rabbit_port = '5672';
|
set migration.rabbit_port = '5672';
|
||||||
set migration.rabbit_user = 'guest';
|
set migration.rabbit_user = 'guest';
|
||||||
set migration.rabbit_password = 'guest';
|
set migration.rabbit_password = 'guest';
|
||||||
|
|
||||||
|
|
||||||
WITH moduleVar AS (
|
WITH moduleVar AS (
|
||||||
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-notify', 't') RETURNING id
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-adapter', 't') RETURNING id
|
||||||
)
|
)
|
||||||
|
|
||||||
INSERT INTO configs (module_id, active, data) VALUES (
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
(SELECT id FROM moduleVar),
|
(SELECT id FROM moduleVar),
|
||||||
't',
|
't',
|
||||||
('{
|
('{
|
||||||
"isNatsLoggerEnabled": false,
|
"currentMode": "default",
|
||||||
"nats": {
|
"syncLogger": {
|
||||||
"address": {
|
"filename": "/opt/isp/isp-mdm-adapter-service/events/events.log",
|
||||||
"port": "' || current_setting('migration.nats_port') || '",
|
"enable": true
|
||||||
"ip": "' || current_setting('migration.nats_host') || '"
|
},
|
||||||
},
|
"asyncLogger": {
|
||||||
"clusterId": "' || current_setting('migration.nats_cluster_id') || '"
|
"enable": false,
|
||||||
|
"nats": {
|
||||||
|
"clusterId": "' || current_setting('migration.nats_cluster_id') || '",
|
||||||
|
"address": {
|
||||||
|
"ip": "' || current_setting('migration.nats_host') || '",
|
||||||
|
"port": "' || current_setting('migration.nats_port') || '"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"queue": {
|
"queue": {
|
||||||
"init": {
|
"init": {
|
||||||
"concurrentConsumers": 8,
|
"concurrentConsumers": 1,
|
||||||
"name": "init",
|
"name": "init",
|
||||||
"prefetchCount": 10
|
"prefetchCount": 1000
|
||||||
},
|
},
|
||||||
"tempQueue": {
|
"tempQueue": {
|
||||||
"name": "tempt",
|
"name": "tempt",
|
||||||
"prefetchCount": 10,
|
"prefetchCount": 1000,
|
||||||
"concurrentConsumers": 128
|
"concurrentConsumers": 1
|
||||||
},
|
},
|
||||||
"defaultQueue": {
|
"defaultQueue": {
|
||||||
"concurrentConsumers": 128,
|
"concurrentConsumers": 1,
|
||||||
"name": "events",
|
"name": "events",
|
||||||
"prefetchCount": 10
|
"prefetchCount": 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rabbit": {
|
"rabbit": {
|
||||||
"password": "' || current_setting('migration.rabbit_password') || '",
|
"password": "' || current_setting('migration.rabbit_password') || '",
|
||||||
"reconnectionTimeoutMs": 0,
|
|
||||||
"user": "' || current_setting('migration.rabbit_user') || '",
|
"user": "' || current_setting('migration.rabbit_user') || '",
|
||||||
"address": {
|
"address": {
|
||||||
"ip": "' || current_setting('migration.rabbit_host') || '",
|
"ip": "' || current_setting('migration.rabbit_host') || '",
|
||||||
@@ -59,6 +64,19 @@ INSERT INTO configs (module_id, active, data) VALUES (
|
|||||||
"ip": "0.0.0.0"
|
"ip": "0.0.0.0"
|
||||||
},
|
},
|
||||||
"gc": true
|
"gc": true
|
||||||
|
},
|
||||||
|
"outputQueue": {
|
||||||
|
"routingKey": "external",
|
||||||
|
"enable": false,
|
||||||
|
"rabbit": {
|
||||||
|
"password": "' || current_setting('migration.rabbit_password') || '",
|
||||||
|
"user": "' || current_setting('migration.rabbit_user') || '",
|
||||||
|
"address": {
|
||||||
|
"ip": "' || current_setting('migration.rabbit_host') || '",
|
||||||
|
"port": "' || current_setting('migration.rabbit_port') || '"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"exchange": "external"
|
||||||
}
|
}
|
||||||
}')::jsonb);
|
}')::jsonb);
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,32 @@ WITH moduleVar AS (
|
|||||||
INSERT INTO configs (module_id, active, data) VALUES (
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
(SELECT id FROM moduleVar),
|
(SELECT id FROM moduleVar),
|
||||||
't',
|
't',
|
||||||
('{' ||
|
('{
|
||||||
'"pKAttributeName": "id"' ||
|
"metrics": {
|
||||||
'}')::jsonb);
|
"memory": true,
|
||||||
|
"address": {
|
||||||
|
"path": "/metrics",
|
||||||
|
"port": "9570",
|
||||||
|
"ip": "0.0.0.0"
|
||||||
|
},
|
||||||
|
"gc": true
|
||||||
|
},
|
||||||
|
"outputQueue": {
|
||||||
|
"routingKey": "external",
|
||||||
|
"enable": false,
|
||||||
|
"exchange": "external"
|
||||||
|
},
|
||||||
|
"appConfigurations": [],
|
||||||
|
"limits": {
|
||||||
|
"defaultRecordsLimit": 1000,
|
||||||
|
"defaultPackageSizeLimit": 1000,
|
||||||
|
"defaultAsyncWorkersLimit": 2
|
||||||
|
},
|
||||||
|
"syncLogger": {
|
||||||
|
"enable": false,
|
||||||
|
"filename": "/opt/isp/isp-mdm-api-service/events/events.log.gz"
|
||||||
|
}
|
||||||
|
}')::jsonb);
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
set rabbit.host = '10.250.9.117';
|
set "rabbit.host" = 'isp-rabbit';
|
||||||
set rabbit.port = '5672';
|
set "rabbit.port" = '5672';
|
||||||
set rabbit.user = 'guest';
|
set "rabbit.user" = 'guest';
|
||||||
set rabbit.password = 'guest';
|
set "rabbit.password" = 'guest';
|
||||||
|
|
||||||
set elastic.url = 'http://10.250.9.48:9200';
|
set elastic.url = 'http://isp-elastic:9200';
|
||||||
|
|
||||||
WITH moduleVar AS (
|
WITH moduleVar AS (
|
||||||
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-search', 't') RETURNING id
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-search', 't') RETURNING id
|
||||||
@@ -40,15 +40,7 @@ INSERT INTO configs (module_id, active, data) VALUES (
|
|||||||
"gc": true,
|
"gc": true,
|
||||||
"memory": true
|
"memory": true
|
||||||
},
|
},
|
||||||
"isFieldsListWhite": false,
|
"elasticDynamicDateFormats": ["yyyy-MM-dd HH:mm:ss.SSS"]
|
||||||
"fieldsList": [
|
|
||||||
"documents",
|
|
||||||
"citizen_relatives",
|
|
||||||
"contacts",
|
|
||||||
"addresses",
|
|
||||||
"escredentials",
|
|
||||||
"users"
|
|
||||||
]
|
|
||||||
}', current_setting('rabbit.user'),
|
}', current_setting('rabbit.user'),
|
||||||
current_setting('rabbit.host'),
|
current_setting('rabbit.host'),
|
||||||
current_setting('rabbit.port'),
|
current_setting('rabbit.port'),
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
-- +goose Up
|
||||||
|
set migration.ds_db_host = 'isp-pgsql';
|
||||||
|
set migration.ds_db_port = '5432';
|
||||||
|
set migration.ds_db_dbname = 'isp-test';
|
||||||
|
set migration.ds_db_user = 'isp-test';
|
||||||
|
set migration.ds_db_pass = '123321';
|
||||||
|
|
||||||
|
set migration.internal_db_host = 'isp-pgsql';
|
||||||
|
set migration.internal_db_port = '5432';
|
||||||
|
set migration.internal_db_dbname = 'isp-test';
|
||||||
|
set migration.internal_db_user = 'isp-test';
|
||||||
|
set migration.internal_db_pass = '123321';
|
||||||
|
|
||||||
|
|
||||||
|
WITH moduleVar AS (
|
||||||
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-dumper', 't') RETURNING id
|
||||||
|
)
|
||||||
|
|
||||||
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
|
(SELECT id FROM moduleVar),
|
||||||
|
't',
|
||||||
|
((format('{
|
||||||
|
"limits": {
|
||||||
|
"rowsInFile": 1000000,
|
||||||
|
"fetchBatchSize": 1000,
|
||||||
|
"convertBatchSize": 300
|
||||||
|
},
|
||||||
|
"metrics": {
|
||||||
|
"gc": true,
|
||||||
|
"memory": true,
|
||||||
|
"address": {
|
||||||
|
"port": "9575",
|
||||||
|
"ip": "0.0.0.0",
|
||||||
|
"path": "/metrics"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dataSourceDb": {
|
||||||
|
"password": "%s",
|
||||||
|
"username": "%s",
|
||||||
|
"createSchema": false,
|
||||||
|
"port": "%s",
|
||||||
|
"schema": "mdm_service",
|
||||||
|
"address": "%s",
|
||||||
|
"database": "%s"
|
||||||
|
},
|
||||||
|
"internalDb": {
|
||||||
|
"password": "%s",
|
||||||
|
"username": "%s",
|
||||||
|
"createSchema": true,
|
||||||
|
"port": "%s",
|
||||||
|
"schema": "mdm_dumper_service",
|
||||||
|
"address": "%s",
|
||||||
|
"database": "%s"
|
||||||
|
},
|
||||||
|
"schedules": [],
|
||||||
|
"workerCount": 1,
|
||||||
|
"dumpDirectoryPath": "/opt/msp/msp-mdm-dumper-service/dump"
|
||||||
|
}', current_setting('migration.ds_db_pass'),
|
||||||
|
current_setting('migration.ds_db_user'),
|
||||||
|
current_setting('migration.ds_db_port'),
|
||||||
|
current_setting('migration.ds_db_host'),
|
||||||
|
current_setting('migration.ds_db_dbname'),
|
||||||
|
|
||||||
|
current_setting('migration.internal_db_pass'),
|
||||||
|
current_setting('migration.internal_db_user'),
|
||||||
|
current_setting('migration.internal_db_port'),
|
||||||
|
current_setting('migration.internal_db_host'),
|
||||||
|
current_setting('migration.internal_db_dbname')
|
||||||
|
)) :: jsonb));
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
-- +goose Up
|
||||||
|
set migration.internal_db_host = 'isp-pgsql';
|
||||||
|
set migration.internal_db_port = '5432';
|
||||||
|
set migration.internal_db_dbname = 'isp-test';
|
||||||
|
set migration.internal_db_user = 'isp-test';
|
||||||
|
set migration.internal_db_pass = '123321';
|
||||||
|
|
||||||
|
|
||||||
|
WITH moduleVar AS (
|
||||||
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'mdm-async-api', 't') RETURNING id
|
||||||
|
)
|
||||||
|
|
||||||
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
|
(SELECT id FROM moduleVar),
|
||||||
|
't',
|
||||||
|
((format('{
|
||||||
|
"limits": {
|
||||||
|
"totalWorkers": 4,
|
||||||
|
"jobExecutionAttempts": 1
|
||||||
|
},
|
||||||
|
"metrics": {
|
||||||
|
"address": {
|
||||||
|
"ip": "0.0.0.0",
|
||||||
|
"path": "/metrics",
|
||||||
|
"port": "9576"
|
||||||
|
},
|
||||||
|
"gc": true,
|
||||||
|
"memory": true
|
||||||
|
},
|
||||||
|
"database": {
|
||||||
|
"password": "%s",
|
||||||
|
"username": "%s",
|
||||||
|
"createSchema": true,
|
||||||
|
"port": "%s",
|
||||||
|
"schema": "mdm_async_api_service",
|
||||||
|
"address": "%s",
|
||||||
|
"database": "%s"
|
||||||
|
},
|
||||||
|
"execution": {
|
||||||
|
"acquiredJobTTLInSec": 300,
|
||||||
|
"storeEntriesTTLInSec": 1800,
|
||||||
|
"purgeStoreTimeoutInSec": 600,
|
||||||
|
"jobStealingRequestTimeoutInSec": 5,
|
||||||
|
"scrollTTLInSec": 60
|
||||||
|
}
|
||||||
|
}',
|
||||||
|
current_setting('migration.internal_db_pass'),
|
||||||
|
current_setting('migration.internal_db_user'),
|
||||||
|
current_setting('migration.internal_db_port'),
|
||||||
|
current_setting('migration.internal_db_host'),
|
||||||
|
current_setting('migration.internal_db_dbname')
|
||||||
|
)) :: jsonb));
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
-- +goose Up
|
||||||
|
|
||||||
|
WITH moduleVar AS (
|
||||||
|
INSERT INTO modules (instance_id, name, active) VALUES (1, 'script', 't') RETURNING id
|
||||||
|
)
|
||||||
|
|
||||||
|
INSERT INTO configs (module_id, active, data) VALUES (
|
||||||
|
(SELECT id FROM moduleVar),
|
||||||
|
't',
|
||||||
|
('{
|
||||||
|
"scripts": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"shaderScript": "",
|
||||||
|
"scriptExecutionTimeoutMs": 1000
|
||||||
|
}')::jsonb
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
|
||||||
@@ -31,6 +31,12 @@ func (r *ModulesRepository) GetModules(identities []int32) ([]entity.Module, err
|
|||||||
return modules, err
|
return modules, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *ModulesRepository) GetModule(identity int32) (*entity.Module, error) {
|
||||||
|
var module entity.Module
|
||||||
|
var err = r.DB.Model(&module).Where("id = ?", identity).Select()
|
||||||
|
return &module, err
|
||||||
|
}
|
||||||
|
|
||||||
func (r *ModulesRepository) GetActiveModules() ([]entity.Module, error) {
|
func (r *ModulesRepository) GetActiveModules() ([]entity.Module, error) {
|
||||||
var modules []entity.Module
|
var modules []entity.Module
|
||||||
err := r.DB.Model(&modules).
|
err := r.DB.Model(&modules).
|
||||||
|
|||||||
@@ -28,3 +28,16 @@ func (r *SchemaRepository) GetSchemasByModulesId(modulesId []int32) ([]entity.Co
|
|||||||
}
|
}
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *SchemaRepository) GetSchemaByModuleId(moduleId int32) (*entity.ConfigSchema, error) {
|
||||||
|
var model entity.ConfigSchema
|
||||||
|
if err := r.DB.Model(&model).Where("module_id = ?", moduleId).Select(); err != nil {
|
||||||
|
if err == pg.ErrNoRows {
|
||||||
|
return nil, nil
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return &model, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package service
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/googollee/go-socket.io"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SocketConn struct {
|
||||||
|
socketio.Socket
|
||||||
|
EstablishedAt time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
type roomStats struct {
|
||||||
|
m map[string]map[string]*SocketConn
|
||||||
|
sync.RWMutex
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRoomStats() *roomStats {
|
||||||
|
return &roomStats{
|
||||||
|
m: make(map[string]map[string]*SocketConn),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) Join(room string, socket socketio.Socket) error {
|
||||||
|
rs.Lock()
|
||||||
|
sockets, ok := rs.m[room]
|
||||||
|
if !ok {
|
||||||
|
sockets = make(map[string]*SocketConn)
|
||||||
|
}
|
||||||
|
sockets[socket.Id()] = &SocketConn{socket, time.Now()}
|
||||||
|
rs.m[room] = sockets
|
||||||
|
rs.Unlock()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) GetConnection(instanceId, sockId string) (*SocketConn, bool) {
|
||||||
|
rs.RLock()
|
||||||
|
defer rs.RUnlock()
|
||||||
|
|
||||||
|
if m, ok := rs.m[":"+instanceId]; !ok {
|
||||||
|
return nil, false
|
||||||
|
} else if s, ok := m[sockId]; !ok {
|
||||||
|
return nil, false
|
||||||
|
} else {
|
||||||
|
return s, true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) Leave(room string, socket socketio.Socket) error {
|
||||||
|
rs.Lock()
|
||||||
|
defer rs.Unlock()
|
||||||
|
sockets, ok := rs.m[room]
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
delete(sockets, socket.Id())
|
||||||
|
if len(sockets) == 0 {
|
||||||
|
delete(rs.m, room)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
rs.m[room] = sockets
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) RoomCount(room string) map[string]*SocketConn {
|
||||||
|
rs.RLock()
|
||||||
|
defer rs.RUnlock()
|
||||||
|
return rs.m[room]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) RoomsCount() map[string]map[string]int {
|
||||||
|
rs.RLock()
|
||||||
|
defer rs.RUnlock()
|
||||||
|
|
||||||
|
result := map[string]map[string]int{}
|
||||||
|
for room, value := range rs.m {
|
||||||
|
instanceId := room[1:37]
|
||||||
|
module := room[37:]
|
||||||
|
if module == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, ok := result[instanceId]; !ok {
|
||||||
|
result[instanceId] = map[string]int{module: len(value)}
|
||||||
|
} else {
|
||||||
|
result[instanceId][module] = len(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) GetModuleConnectionMap() map[string]map[string][]string {
|
||||||
|
rs.RLock()
|
||||||
|
defer rs.RUnlock()
|
||||||
|
|
||||||
|
result := make(map[string]map[string][]string)
|
||||||
|
for room, value := range rs.m {
|
||||||
|
instanceId := room[1:37]
|
||||||
|
module := room[37:]
|
||||||
|
if module == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, ok := result[instanceId]; !ok {
|
||||||
|
result[instanceId] = make(map[string][]string)
|
||||||
|
}
|
||||||
|
for sockId := range value {
|
||||||
|
if arr, ok := result[instanceId][module]; !ok {
|
||||||
|
result[instanceId][module] = []string{sockId}
|
||||||
|
} else {
|
||||||
|
result[instanceId][module] = append(arr, sockId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) Send(ignore socketio.Socket, room, event string, args ...interface{}) error {
|
||||||
|
rs.RLock()
|
||||||
|
sockets := rs.m[room]
|
||||||
|
for id, s := range sockets {
|
||||||
|
if ignore != nil && ignore.Id() == id {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
s.Emit(event, args...)
|
||||||
|
}
|
||||||
|
rs.RUnlock()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) Len(room string) int {
|
||||||
|
return len(rs.m[room])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *roomStats) RemoveSocketConn(sockId string) {
|
||||||
|
rs.Lock()
|
||||||
|
|
||||||
|
for room, store := range rs.m {
|
||||||
|
delete(store, sockId)
|
||||||
|
if len(store) == 0 {
|
||||||
|
delete(rs.m, room)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rs.Unlock()
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package service
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/googollee/go-engine.io"
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
type StoreOption func(ss *sessionsStore)
|
||||||
|
|
||||||
|
type sessionsStore struct {
|
||||||
|
sessions map[string]engineio.Conn
|
||||||
|
locker sync.RWMutex
|
||||||
|
|
||||||
|
onRemove func(id string)
|
||||||
|
onSet func(id string, conn engineio.Conn)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *sessionsStore) Get(id string) engineio.Conn {
|
||||||
|
s.locker.RLock()
|
||||||
|
defer s.locker.RUnlock()
|
||||||
|
|
||||||
|
ret, ok := s.sessions[id]
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *sessionsStore) Set(id string, conn engineio.Conn) {
|
||||||
|
s.locker.Lock()
|
||||||
|
defer s.locker.Unlock()
|
||||||
|
|
||||||
|
s.sessions[id] = conn
|
||||||
|
|
||||||
|
if s.onSet != nil {
|
||||||
|
s.onSet(id, conn)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *sessionsStore) Remove(id string) {
|
||||||
|
s.locker.Lock()
|
||||||
|
defer s.locker.Unlock()
|
||||||
|
|
||||||
|
delete(s.sessions, id)
|
||||||
|
|
||||||
|
if s.onRemove != nil {
|
||||||
|
s.onRemove(id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSessionStore(opts ...StoreOption) engineio.Sessions {
|
||||||
|
ss := &sessionsStore{sessions: make(map[string]engineio.Conn)}
|
||||||
|
|
||||||
|
for _, o := range opts {
|
||||||
|
o(ss)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ss
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithOnRemoveCallback(f func(id string)) StoreOption {
|
||||||
|
return func(ss *sessionsStore) {
|
||||||
|
ss.onRemove = f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithOnSetCallback(f func(id string, conn engineio.Conn)) StoreOption {
|
||||||
|
return func(ss *sessionsStore) {
|
||||||
|
ss.onSet = f
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ package service
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"isp-config-service/entity"
|
"isp-config-service/entity"
|
||||||
@@ -22,20 +21,19 @@ func Disonnect(instanceUuid string, moduleName string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConnection(instanceUuid string, moduleName string) (*entity.Config, error) {
|
func NewConnection(instanceUuid string, moduleName string) error {
|
||||||
|
|
||||||
instance, err := model.InstanceRep.GetInstanceByUuid(instanceUuid)
|
instance, err := model.InstanceRep.GetInstanceByUuid(instanceUuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
return nil, errors.New(utils.ServiceError)
|
return errors.New(utils.ServiceError)
|
||||||
}
|
}
|
||||||
if instance.Id == 0 {
|
if instance.Id == 0 {
|
||||||
return nil, errors.New(fmt.Sprintf("The instance with uuid: %s not found", instanceUuid))
|
return errors.New(fmt.Sprintf("The instance with uuid: %s not found", instanceUuid))
|
||||||
}
|
}
|
||||||
module, err := model.ModulesRep.GetModuleByInstanceIdAndName(instance.Id, moduleName)
|
module, err := model.ModulesRep.GetModuleByInstanceIdAndName(instance.Id, moduleName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
return nil, errors.New(utils.ServiceError)
|
return errors.New(utils.ServiceError)
|
||||||
}
|
}
|
||||||
if module.Id == 0 {
|
if module.Id == 0 {
|
||||||
module.Name = moduleName
|
module.Name = moduleName
|
||||||
@@ -44,18 +42,18 @@ func NewConnection(instanceUuid string, moduleName string) (*entity.Config, erro
|
|||||||
module, err = model.ModulesRep.CreateModule(module)
|
module, err = model.ModulesRep.CreateModule(module)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
return nil, errors.New(utils.ServiceError)
|
return errors.New(utils.ServiceError)
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
} else {
|
} else {
|
||||||
module.LastConnectedAt = time.Now()
|
module.LastConnectedAt = time.Now()
|
||||||
module, err = model.ModulesRep.UpdateModule(module)
|
module, err = model.ModulesRep.UpdateModule(module)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
return nil, errors.New(utils.ServiceError)
|
return errors.New(utils.ServiceError)
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetConfig(instanceUuid, moduleName)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConfig(instanceUuid string, moduleName string) (*entity.Config, error) {
|
func GetConfig(instanceUuid string, moduleName string) (*entity.Config, error) {
|
||||||
@@ -71,18 +69,3 @@ func GetConfig(instanceUuid string, moduleName string) (*entity.Config, error) {
|
|||||||
}
|
}
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseParameters(queryRaw string) (instanceUUID string, moduleName string, error error) {
|
|
||||||
parsedParams, _ := url.ParseQuery(queryRaw)
|
|
||||||
moduleName = parsedParams.Get("module_name")
|
|
||||||
instanceUuid := parsedParams.Get("instance_uuid")
|
|
||||||
if moduleName == "" || instanceUuid == "" || !utils.IsValidUUID(instanceUuid) {
|
|
||||||
err := fmt.Sprintf("SocketIO not received all parameters, module_name: %s, instance_uuid: %s",
|
|
||||||
moduleName,
|
|
||||||
instanceUuid,
|
|
||||||
)
|
|
||||||
logger.Debug(err)
|
|
||||||
return "", "", errors.New(err)
|
|
||||||
}
|
|
||||||
return instanceUuid, moduleName, nil
|
|
||||||
}
|
|
||||||
+72
-22
@@ -20,6 +20,11 @@ const (
|
|||||||
routesSubscribers = ":routes_subs"
|
routesSubscribers = ":routes_subs"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
okMsg = "ok"
|
||||||
|
errorMsg = "error"
|
||||||
|
)
|
||||||
|
|
||||||
func RoutesSubscribersRoom(instanceUuid string) string {
|
func RoutesSubscribersRoom(instanceUuid string) string {
|
||||||
return instanceUuid + routesSubscribers
|
return instanceUuid + routesSubscribers
|
||||||
}
|
}
|
||||||
@@ -30,7 +35,7 @@ func onError(so socketio.Socket, err error) {
|
|||||||
|
|
||||||
func onDisconnect(so socketio.Socket) {
|
func onDisconnect(so socketio.Socket) {
|
||||||
logger.Debugf("onDisconnect: %s", so.Id())
|
logger.Debugf("onDisconnect: %s", so.Id())
|
||||||
instanceUuid, moduleName, err := service.ParseParameters(so.Request().URL.RawQuery)
|
instanceUuid, moduleName, err := utils.ParseParameters(so.Request().URL.RawQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
return
|
return
|
||||||
@@ -39,7 +44,7 @@ func onDisconnect(so socketio.Socket) {
|
|||||||
must(so.Leave(instanceUuid + moduleName))
|
must(so.Leave(instanceUuid + moduleName))
|
||||||
must(so.Leave(instanceUuid))
|
must(so.Leave(instanceUuid))
|
||||||
must(so.Leave(RoutesSubscribersRoom(instanceUuid)))
|
must(so.Leave(RoutesSubscribersRoom(instanceUuid)))
|
||||||
must(service.Disonnect(instanceUuid, moduleName))
|
_ = service.Disonnect(instanceUuid, moduleName)
|
||||||
|
|
||||||
discoverer := getOrRegisterDiscoverer(instanceUuid)
|
discoverer := getOrRegisterDiscoverer(instanceUuid)
|
||||||
discoverer.OnDisconnection(so.Id())
|
discoverer.OnDisconnection(so.Id())
|
||||||
@@ -52,31 +57,36 @@ func onDisconnect(so socketio.Socket) {
|
|||||||
func onConnect(so socketio.Socket) {
|
func onConnect(so socketio.Socket) {
|
||||||
logger.Debugf("onConnect: %s", so.Id())
|
logger.Debugf("onConnect: %s", so.Id())
|
||||||
|
|
||||||
instanceUuid, moduleName, err := service.ParseParameters(so.Request().URL.RawQuery)
|
instanceUuid, moduleName, err := utils.ParseParameters(so.Request().URL.RawQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = so.Emit(utils.ConfigError, err.Error())
|
_ = so.Emit(utils.ConfigError, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
config, err := service.NewConnection(instanceUuid, moduleName)
|
err = service.NewConnection(instanceUuid, moduleName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = so.Emit(utils.ConfigError, err.Error())
|
_ = so.Emit(utils.ConfigError, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
must(so.Join(instanceUuid + moduleName))
|
must(so.Join(instanceUuid + moduleName))
|
||||||
must(so.Join(instanceUuid))
|
must(so.Join(instanceUuid))
|
||||||
_ = so.Emit(
|
|
||||||
utils.ConfigSendConfigWhenConnected, config.Data.ToJSON(), func(so socketio.Socket, data string) {
|
config, err := service.GetConfig(instanceUuid, moduleName)
|
||||||
logger.Debug("Client ACK with data: ", data)
|
if err != nil {
|
||||||
},
|
_ = so.Emit(utils.ConfigError, err.Error())
|
||||||
)
|
} else {
|
||||||
|
_ = so.Emit(
|
||||||
|
utils.ConfigSendConfigWhenConnected, config.Data.ToJSON(), func(so socketio.Socket, data string) {
|
||||||
|
logger.Debug("Client ACK with data: ", data)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func onReceivedModuleRequirements(so socketio.Socket, msg string) {
|
func onReceivedModuleRequirements(so socketio.Socket, msg string) {
|
||||||
logger.Debugf("onReceivedModuleRequirements: %s %s", so.Id(), msg)
|
logger.Debugf("onReceivedModuleRequirements: %s %s", so.Id(), msg)
|
||||||
|
|
||||||
instanceUuid, _, err := service.ParseParameters(so.Request().URL.RawQuery)
|
instanceUuid, _, err := utils.ParseParameters(so.Request().URL.RawQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = so.Emit(utils.ErrorConnection, map[string]string{"error": err.Error()})
|
_ = so.Emit(utils.ErrorConnection, map[string]string{"error": err.Error()})
|
||||||
return
|
return
|
||||||
@@ -110,44 +120,51 @@ func onReceiveRoutesUpdate(so socketio.Socket, msg string) {
|
|||||||
handleModuleDeclaration(so, msg)
|
handleModuleDeclaration(so, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func onReceiveRemoteConfigSchema(so socketio.Socket, msg string) {
|
func onReceiveRemoteConfigSchema(so socketio.Socket, msg string) string {
|
||||||
logger.Debugf("onReceiveRemoteConfigSchema: %s %s", so.Id(), msg)
|
logger.Debugf("onReceiveRemoteConfigSchema: %s %s", so.Id(), msg)
|
||||||
|
|
||||||
instanceUuid, moduleName, err := service.ParseParameters(so.Request().URL.RawQuery)
|
instanceUuid, moduleName, err := utils.ParseParameters(so.Request().URL.RawQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
return
|
return errorMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
module, err := model.ModulesRep.GetModulesByInstanceUuidAndName(instanceUuid, moduleName)
|
module, err := model.ModulesRep.GetModulesByInstanceUuidAndName(instanceUuid, moduleName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
return
|
return errorMsg
|
||||||
}
|
}
|
||||||
if module == nil {
|
if module == nil {
|
||||||
logger.Warnf("Module '%s' in instance '%s' not found", moduleName, instanceUuid)
|
logger.Warnf("Module '%s' in instance '%s' not found", moduleName, instanceUuid)
|
||||||
return
|
return errorMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
s := new(schema.ConfigSchema)
|
s := new(schema.ConfigSchema)
|
||||||
if err := json.Unmarshal([]byte(msg), s); err != nil {
|
if err := json.Unmarshal([]byte(msg), s); err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
return
|
return errorMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := model.SchemaRep.GetSchemasByModulesId([]int32{module.Id})
|
res, err := model.SchemaRep.GetSchemasByModulesId([]int32{module.Id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
return
|
return errorMsg
|
||||||
}
|
}
|
||||||
if len(res) > 0 {
|
if len(res) > 0 {
|
||||||
schema := &res[0]
|
schema := &res[0]
|
||||||
if s.Version > schema.Version {
|
schema.Schema = s.Schema
|
||||||
|
schema.Version = s.Version
|
||||||
|
if _, err := model.SchemaRep.UpdateConfigSchema(schema); err != nil {
|
||||||
|
logger.Warn(err)
|
||||||
|
return errorMsg
|
||||||
|
}
|
||||||
|
/*if s.Version > schema.Version {
|
||||||
schema.Version = s.Version
|
schema.Version = s.Version
|
||||||
schema.Schema = s.Schema
|
schema.Schema = s.Schema
|
||||||
if _, err := model.SchemaRep.UpdateConfigSchema(schema); err != nil {
|
if _, err := model.SchemaRep.UpdateConfigSchema(schema); err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
} else {
|
} else {
|
||||||
cs := &entity.ConfigSchema{
|
cs := &entity.ConfigSchema{
|
||||||
Version: s.Version,
|
Version: s.Version,
|
||||||
@@ -156,12 +173,45 @@ func onReceiveRemoteConfigSchema(so socketio.Socket, msg string) {
|
|||||||
}
|
}
|
||||||
if _, err := model.SchemaRep.InsertConfigSchema(cs); err != nil {
|
if _, err := model.SchemaRep.InsertConfigSchema(cs); err != nil {
|
||||||
logger.Warn(err)
|
logger.Warn(err)
|
||||||
|
return errorMsg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(s.DefaultConfig) == 0 {
|
||||||
|
return okMsg
|
||||||
|
}
|
||||||
|
|
||||||
|
configs, err := model.ConfigRep.GetConfigByInstanceUUIDAndModuleName(instanceUuid, moduleName)
|
||||||
|
if err != nil {
|
||||||
|
logger.Warn(err)
|
||||||
|
return errorMsg
|
||||||
|
}
|
||||||
|
if configs != nil {
|
||||||
|
return okMsg
|
||||||
|
}
|
||||||
|
config := entity.Config{
|
||||||
|
ModuleId: module.Id,
|
||||||
|
Name: module.Name,
|
||||||
|
Data: s.DefaultConfig,
|
||||||
|
Active: true,
|
||||||
|
Version: 1,
|
||||||
|
}
|
||||||
|
_, err = model.ConfigRep.CreateConfig(&config)
|
||||||
|
if err != nil {
|
||||||
|
logger.Warn(err)
|
||||||
|
return errorMsg
|
||||||
|
}
|
||||||
|
_ = so.Emit(
|
||||||
|
utils.ConfigSendConfigWhenConnected, config.Data.ToJSON(), func(so socketio.Socket, data string) {
|
||||||
|
logger.Debug("Client ACK with data: ", data)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
return okMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleModuleDeclaration(so socketio.Socket, msg string) {
|
func handleModuleDeclaration(so socketio.Socket, msg string) {
|
||||||
instanceUuid, moduleName, err := service.ParseParameters(so.Request().URL.RawQuery)
|
instanceUuid, moduleName, err := utils.ParseParameters(so.Request().URL.RawQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = so.Emit(utils.ErrorConnection, map[string]string{"error": err.Error()})
|
_ = so.Emit(utils.ErrorConnection, map[string]string{"error": err.Error()})
|
||||||
return
|
return
|
||||||
@@ -191,7 +241,7 @@ func handleModuleDeclaration(so socketio.Socket, msg string) {
|
|||||||
func onRequestConfig(so socketio.Socket) {
|
func onRequestConfig(so socketio.Socket) {
|
||||||
logger.Debugf("onRequestConfig: %s", so.Id())
|
logger.Debugf("onRequestConfig: %s", so.Id())
|
||||||
|
|
||||||
instanceUuid, moduleName, err := service.ParseParameters(so.Request().URL.RawQuery)
|
instanceUuid, moduleName, err := utils.ParseParameters(so.Request().URL.RawQuery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = so.Emit(utils.ErrorConnection, map[string]string{"error": err.Error()})
|
_ = so.Emit(utils.ErrorConnection, map[string]string{"error": err.Error()})
|
||||||
return
|
return
|
||||||
|
|||||||
+3
-4
@@ -5,7 +5,6 @@ import (
|
|||||||
"github.com/googollee/go-socket.io"
|
"github.com/googollee/go-socket.io"
|
||||||
"github.com/integration-system/isp-lib/config"
|
"github.com/integration-system/isp-lib/config"
|
||||||
"github.com/integration-system/isp-lib/logger"
|
"github.com/integration-system/isp-lib/logger"
|
||||||
sck "github.com/integration-system/isp-lib/socket"
|
|
||||||
str "github.com/integration-system/isp-lib/structure"
|
str "github.com/integration-system/isp-lib/structure"
|
||||||
"github.com/integration-system/isp-lib/utils"
|
"github.com/integration-system/isp-lib/utils"
|
||||||
"isp-config-service/conf"
|
"isp-config-service/conf"
|
||||||
@@ -17,7 +16,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
server *socketio.Server
|
server *socketio.Server
|
||||||
br *broadcaster
|
br *broadcaster
|
||||||
socketRoomStats = sck.NewRoomStats()
|
socketRoomStats = service.NewRoomStats()
|
||||||
backendRoutes = &service.RouterTables{}
|
backendRoutes = &service.RouterTables{}
|
||||||
ConfigServiceBackendDeclaration = &str.BackendDeclaration{}
|
ConfigServiceBackendDeclaration = &str.BackendDeclaration{}
|
||||||
)
|
)
|
||||||
@@ -27,7 +26,7 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal(err)
|
logger.Fatal(err)
|
||||||
}
|
}
|
||||||
sessionStore := sck.NewSessionStore(sck.WithOnRemoveCallback(func(id string) {
|
sessionStore := service.NewSessionStore(service.WithOnRemoveCallback(func(id string) {
|
||||||
socketRoomStats.RemoveSocketConn(id)
|
socketRoomStats.RemoveSocketConn(id)
|
||||||
}))
|
}))
|
||||||
newServer.SetSessionManager(sessionStore)
|
newServer.SetSessionManager(sessionStore)
|
||||||
@@ -76,7 +75,7 @@ func GetModuleConnectionIdMapByInstanceId(instanceId string) map[string][]string
|
|||||||
return socketRoomStats.GetModuleConnectionMap()[instanceId]
|
return socketRoomStats.GetModuleConnectionMap()[instanceId]
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConnectionById(instanceId, sockId string) (*sck.SocketConn, bool) {
|
func GetConnectionById(instanceId, sockId string) (*service.SocketConn, bool) {
|
||||||
return socketRoomStats.GetConnection(instanceId, sockId)
|
return socketRoomStats.GetConnection(instanceId, sockId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user