Documentation
¶
Overview ¶
Package metadata defines the structured metadata.
Index ¶
- func AndValidation(rules []interface{}) *compositeValidation
- func GreaterThanValidation(value interface{}, equals bool) *comparisonValidationRule
- func LessThanValidation(value interface{}, equals bool) *comparisonValidationRule
- func StringLengthValidation(min, max int) *valueLengthValidationRule
- type DataSource
- type DataSourceValue
- type Field
- type FieldType
- type Validation
- type ValidationType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AndValidation ¶
func AndValidation(rules []interface{}) *compositeValidation
AndValidation is relevant for all field types. Allows to include more than one validation rule to be evaluated.
func GreaterThanValidation ¶
func GreaterThanValidation(value interface{}, equals bool) *comparisonValidationRule
GreaterThanValidation rule for integers.
func LessThanValidation ¶
func LessThanValidation(value interface{}, equals bool) *comparisonValidationRule
LessThanValidation rule for integers.
func StringLengthValidation ¶
func StringLengthValidation(min, max int) *valueLengthValidationRule
StringLengthValidation rule for strings.
Types ¶
type DataSource ¶
type DataSource struct {
Values []DataSourceValue `json:"values"`
}
DataSource is the data source definition.
type DataSourceValue ¶
type DataSourceValue struct { ExternalID string `json:"external_id"` Value string `json:"value"` State string `json:"state"` }
DataSourceValue is the value of a single data source.
type Field ¶
type Field struct { Type FieldType `json:"type"` ExternalID string `json:"external_id"` Label string `json:"label"` Mandatory bool `json:"mandatory"` DefaultValue interface{} `json:"default_value,omitempty"` Validation interface{} `json:"validation,omitempty"` DataSource DataSource `json:"datasource,omitempty"` }
Field is a single metadata field.
type FieldType ¶
type FieldType string
FieldType is the type of the metadata field.
const ( // StringFieldType is a string metadata field type. StringFieldType FieldType = "string" // IntegerFieldType is an integer metadata field type. IntegerFieldType FieldType = "integer" // DateFieldType is a date metadata field type. DateFieldType FieldType = "date" // EnumFieldType is an enum metadata field type. EnumFieldType FieldType = "enum" // SetFieldType is a set metadata field type. SetFieldType FieldType = "set" )
type ValidationType ¶
type ValidationType string
ValidationType is the type of the metadata field validation.
Click to show internal directories.
Click to hide internal directories.