Reimplement baseline
This commit is contained in:
1 parent
f062aada42
commit
33b4e2d965
36 files changed
+653
-3262
No files matched your search
@@ -7,5 +7,8 @@
|
||||
"username": "{{ msp_pgsql_user }}",
|
||||
"host": "{{ msp_pgsql_address }}",
|
||||
"port": 5432
|
||||
},
|
||||
"baseline": {
|
||||
"initialAdminUiToken": "{{ isp_service_admin_token }}"
|
||||
}
|
||||
}
|
||||
+12
-6
@@ -3,14 +3,15 @@ package conf
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/integration-system/isp-kit/dbx"
|
||||
"github.com/integration-system/isp-kit/log"
|
||||
"github.com/integration-system/isp-kit/rc/schema"
|
||||
"github.com/integration-system/jsonschema"
|
||||
"github.com/txix-open/isp-kit/dbx"
|
||||
"github.com/txix-open/isp-kit/log"
|
||||
"github.com/txix-open/isp-kit/rc/schema"
|
||||
"github.com/txix-open/jsonschema"
|
||||
)
|
||||
|
||||
//nolint:gochecknoinits
|
||||
func init() {
|
||||
schema.CustomGenerators.Register("logLevel", func(field reflect.StructField, t *jsonschema.Type) {
|
||||
schema.CustomGenerators.Register("logLevel", func(field reflect.StructField, t *jsonschema.Schema) {
|
||||
t.Type = "string"
|
||||
t.Enum = []interface{}{"debug", "info", "error", "fatal"}
|
||||
})
|
||||
@@ -18,5 +19,10 @@ func init() {
|
||||
|
||||
type Remote struct {
|
||||
Database dbx.Config `schema:"Настройка базы данных"`
|
||||
LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
|
||||
Baseline Baseline
|
||||
LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
|
||||
}
|
||||
|
||||
type Baseline struct {
|
||||
InitialAdminUiToken string
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package conf_test
|
||||
|
||||
import (
|
||||
"isp-system-service/conf"
|
||||
"testing"
|
||||
|
||||
"github.com/txix-open/isp-kit/test/rct"
|
||||
)
|
||||
|
||||
func TestDefaultRemoteConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
rct.Test(t, "default_remote_config.json", conf.Remote{})
|
||||
}
|
||||
Reference in new issue
Block a user