MSP-1388 [v] правки после review

This commit is contained in:
Leonid Nikolaev authored and d1slike committed 2023-02-01 13:44:30 +03:00
1 parent 42d2dd18ac
commit f339c87eca
17 files changed
+184 -447

No files matched your search

+2 -3
View File
@@ -1,13 +1,12 @@
# TODO
configServiceAddress:
ip: 127.0.0.1
port: 9001
grpcOuterAddress:
#ip: 127.0.0.1
port: 9999
port: 9740
grpcInnerAddress:
ip: 0.0.0.0
port: 9999
port: 9740
moduleName: isp-lock-service
logfile:
+2 -3
View File
@@ -1,10 +1,9 @@
{
"logLevel": "debug",
"redis": {
"server": "localhost:6379",
"address": "localhost:6379",
"password": "",
"db": 0,
"prefix": "isp-lock-service",
"defaultTimeOut": 10
"prefix": "isp-lock-service"
}
}
+18 -25
View File
@@ -2,7 +2,6 @@ package conf
import (
"reflect"
"time"
"github.com/integration-system/isp-kit/log"
"github.com/integration-system/isp-kit/rc/schema"
@@ -17,30 +16,24 @@ func init() {
})
}
// type Remote struct {
// // Database dbx.Config
// // Consumer Consumer
// LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
// }
type Remote struct {
LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
Redis struct {
Server string `schemaGen:"server" schema:"Адрес сервера redis, обязателен, если sentinel не указан"`
UserName string `schemaGen:"userName" schema:"Имя пользователя в redis"`
Password string `schemaGen:"password" schema:"Пароль для redis"`
DB int `schemaGen:"db" schema:"номер БД в redis"`
Prefix string `schemaGen:"prefix" schema:"Префикс ключей для модуля"`
DefaultTimeOut time.Duration `schemaGen:"defaultTimeOut" schema:"TTL по умолчанию, в секундах"`
RedisSentinel *struct {
Addresses []string `schema:"Адреса нод в кластере"`
MasterName string `schema:"Имя мастера"`
Username string `schema:"Имя пользователя в sentinel"`
Password string `schema:"Пароль в sentinel"`
} `schema:"Настройки sentinel,обязательна, если redis.server не указан"`
} `schemaGen:"redis" schema:"Настройки redis"`
LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
Redis Redis `schema:"Настройки redis"`
}
// type Consumer struct {
// Client grmqx.Connection
// Config grmqx.Consumer
// }
type Redis struct {
Address string `schema:"Адрес,обязательное, если sentinel не указан"`
Username string `schema:"Имя пользователя"`
Password string `schema:"Пароль"`
Sentinel *RedisSentinel `schema:"Настройки sentinel,обязательно, если address не указан"`
DB int `schema:"номер БД в redis"`
Prefix string `schema:"Префикс ключей для модуля"`
}
type RedisSentinel struct {
Addresses []string `valid:"required" schema:"Адреса нод в кластере"`
MasterName string `valid:"required" schema:"Имя мастера"`
Username string `schema:"Имя пользователя в sentinel"`
Password string `schema:"Пароль в sentinel"`
}