2024-08-08 12:00:49: merge [master:958e40c1b5f280b681f8c9bf09c476b347ea7b7e];
This commit is contained in:
1 parent
bdbb3216ce
commit
d8a0db34ef
25 files changed
+1752
-1
No files matched your search
@@ -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"`
|
||||
}
|
||||
Reference in new issue
Block a user