2024-08-08 12:00:49: merge [master:958e40c1b5f280b681f8c9bf09c476b347ea7b7e];

This commit is contained in:
txix committed 2024-08-08 12:00:49 +03:00
1 parent bdbb3216ce
commit d8a0db34ef
25 files changed
+1752 -1

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
configServiceAddress:
ip: 127.0.0.1
port: 9001
grpcOuterAddress:
# ip: 127.0.0.1
port: 9024
grpcInnerAddress:
ip: 0.0.0.0
port: 9024
moduleName: script
infraServerPort: 9574
logfile:
path: /var/log/isp-script-service/runtime.log
maxSizeMb: 512
maxBackups: 4
compress: true
+7
View File
@@ -0,0 +1,7 @@
{
"logLevel": "debug",
"scripts": [
],
"sharedScript": "",
"scriptExecutionTimeoutMs": 1000
}
+29
View File
@@ -0,0 +1,29 @@
package conf
import (
"reflect"
"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.Schema) {
t.Type = "string"
t.Enum = []interface{}{"debug", "info", "error", "fatal"}
})
}
type Remote struct {
LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
Scripts []ScriptDefinition
SharedScript string
ScriptExecutionTimeoutMs int `validate:"required"`
}
type ScriptDefinition struct {
Id string `validate:"required"`
Script string `validate:"required"`
}
+13
View File
@@ -0,0 +1,13 @@
package conf_test
import (
"testing"
"github.com/txix-open/isp-kit/test/rct"
"isp-script-service/conf"
)
func TestDefaultRemoteConfig(t *testing.T) {
t.Parallel()
rct.Test(t, "default_remote_config.json", conf.Remote{})
}