Generate connector form based on meta-data (#62)
* Ignore volumes and exe * Export form meta-data * use dynamic metaform for connectors * fix populating form
This commit is contained in:
committed by
GitHub
parent
43a46ad1fb
commit
d7cfa7f0b2
28
pkg/metaform/metaform.go
Normal file
28
pkg/metaform/metaform.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package metaform
|
||||
|
||||
// Option represents a selectable option for FieldOption type
|
||||
type Option struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
type FieldKind string
|
||||
|
||||
const (
|
||||
FieldString FieldKind = "string"
|
||||
FieldNumber FieldKind = "number"
|
||||
FieldOptions FieldKind = "options"
|
||||
)
|
||||
|
||||
type Field struct {
|
||||
Kind FieldKind `json:"kind"`
|
||||
Name string `json:"name"`
|
||||
Label string `json:"label"`
|
||||
Required bool `json:"required"`
|
||||
Placeholder string `json:"placeholder,omitempty"`
|
||||
Options []Option `json:"options,omitempty"`
|
||||
}
|
||||
|
||||
type Form struct {
|
||||
Fields []Field
|
||||
}
|
||||
Reference in New Issue
Block a user