make json abstraction for server

This commit is contained in:
Adrian Zuercher
2025-04-15 11:04:14 +02:00
parent 3d1dee25f1
commit a1f947e24a
6 changed files with 149 additions and 130 deletions

21
models/jsonData.go Normal file
View File

@@ -0,0 +1,21 @@
package models
type JsonData struct {
Get *[]Get `json:"get,omitempty"`
Set *[]Set `json:"set,omitempty"`
}
type Get struct {
Path string `json:"path"`
Query *Query `json:"query,omitempty"`
}
type Set struct {
Path string `json:"path"`
Value any `json:"value"`
}
type Query struct {
Depth int `json:"depth,omitempty"`
RegExp string `json:"regExp,omitempty"`
}