updated proto

This commit is contained in:
2025-08-26 06:07:54 +01:00
parent 0c635f7140
commit d4347f5e26
3 changed files with 431 additions and 245 deletions
+17 -1
View File
@@ -1,6 +1,9 @@
package apiconfig
import "encoding/json"
import (
"encoding/json"
"git.servflow.io/servflow/definitions/proto"
)
type RequestType string
@@ -121,6 +124,19 @@ type ResponseObject struct {
Fields map[string]ResponseObject `json:"fields" yaml:"fields"`
}
func (o *ResponseObject) ToProto() *proto.ResponseObject {
resp := proto.ResponseObject{
Value: o.Value,
Fields: make(map[string]*proto.ResponseObject),
}
for k, v := range o.Fields {
resp.Fields[k] = v.ToProto()
}
return &resp
}
type DatasourceConfig struct {
ID string `json:"id" yaml:"id"`
Config json.RawMessage `json:"config" yaml:"-"`