Add base resource decoders

* yaml,
* csv.
This commit is contained in:
Tomaž Jerman
2020-11-27 11:19:15 +01:00
parent d076dbd70f
commit 93bfa80eb0
5 changed files with 329 additions and 9 deletions
+8 -7
View File
@@ -1,27 +1,28 @@
package types
import (
"time"
"github.com/cortezaproject/corteza-server/pkg/filter"
"github.com/cortezaproject/corteza-server/pkg/rbac"
"github.com/jmoiron/sqlx/types"
"time"
)
type (
Module struct {
ID uint64 `json:"moduleID,string"`
ID uint64 `json:"moduleID,string" yaml:"-"`
Handle string `json:"handle"`
Name string `json:"name"`
Meta types.JSONText `json:"meta"`
Fields ModuleFieldSet `json:"fields"`
Meta types.JSONText `json:"meta" yaml:",omitempty"`
Fields ModuleFieldSet `json:"fields" yaml:"-"`
Labels map[string]string `json:"labels,omitempty"`
NamespaceID uint64 `json:"namespaceID,string"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty" yaml:",omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty" yaml:",omitempty"`
DeletedAt *time.Time `json:"deletedAt,omitempty" yaml:",omitempty"`
}
ModuleFilter struct {
+3 -2
View File
@@ -3,10 +3,11 @@ package types
import (
"encoding/json"
"fmt"
"github.com/cortezaproject/corteza-server/pkg/filter"
"strconv"
"time"
"github.com/cortezaproject/corteza-server/pkg/filter"
"github.com/cortezaproject/corteza-server/pkg/rbac"
)
@@ -35,7 +36,7 @@ type (
ID uint64 `json:"recordID,string"`
ModuleID uint64 `json:"moduleID,string"`
Values RecordValueSet `json:"values,omitempty"`
Values RecordValueSet `json:"values,omitempty" yaml:"-"`
Labels map[string]string `json:"labels,omitempty"`