Documentation ¶
Index ¶
Constants ¶
View Source
const ( DateTp = "date-time" BooleanTp = "boolean" StringTp = "string" IntegerTp = "integer" FloatTp = "number" SchemeDefault = "default" SchemeMinimum = "minimum" SchemeMaximum = "maximum" TimeRFC3339 = "2006-01-02T15:04:05.999999999Z" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BooleanType ¶
type BooleanType proto.BooleanType
func (*BooleanType) Bind ¶
func (b *BooleanType) Bind(p *DTOStruct) error
func (*BooleanType) ToProtoStruct ¶
func (b *BooleanType) ToProtoStruct() *structpb.Struct
type DateTimeType ¶
type DateTimeType proto.DateTimeType
func (*DateTimeType) Bind ¶
func (b *DateTimeType) Bind(p *DTOStruct) error
func (*DateTimeType) Load ¶
func (b *DateTimeType) Load()
func (*DateTimeType) ToProtoStruct ¶
func (b *DateTimeType) ToProtoStruct() *structpb.Struct
type FloatType ¶
func (*FloatType) ToProtoStruct ¶
func (fl *FloatType) ToProtoStruct() *structpb.Struct
type IntegerType ¶
type IntegerType proto.IntegerType
func (*IntegerType) Bind ¶
func (i *IntegerType) Bind(p *DTOStruct) error
func (*IntegerType) ToProtoStruct ¶
func (i *IntegerType) ToProtoStruct() *structpb.Struct
type JsonSchemaValidator ¶
type JsonSchemaValidator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() *JsonSchemaValidator
func (*JsonSchemaValidator) Validate ¶
func (v *JsonSchemaValidator) Validate(schema Schema, record *structpb.Struct, opts ...JsonValidatorOption) []errors.FieldError
type JsonValidatorOption ¶
type JsonValidatorOption func(*processContext)
func WithFieldErrorPrefix ¶
func WithFieldErrorPrefix(prefix string) JsonValidatorOption
type Properties ¶
type Properties struct {
Columns map[string]PropertyType
}
func (*Properties) Scan ¶
func (c *Properties) Scan(v interface{}) error
type PropertyType ¶
func CreateProperty ¶
func CreateProperty(p *DTOStruct) (PropertyType, error)
type Record ¶
type Schema ¶
type Schema struct { ID uuid.UUID `gorm:"column:id;primary_key"` Name string `gorm:"column:name"` Properties Properties `gorm:"column:properties;type:bytea"` Required Required `gorm:"column:required;type:bytea"` ProjectID uuid.UUID `gorm:"column:project_id"` Version string `gorm:"column:version;unique_index"` CreatedAt time.Time UpdatedAt time.Time }
func (Schema) GetProp ¶
func (s Schema) GetProp(k string) PropertyType
func (Schema) JSONSchema ¶
type StringType ¶
type StringType proto.StringType
func (*StringType) Bind ¶
func (s *StringType) Bind(p *DTOStruct) error
func (*StringType) ToProtoStruct ¶
func (s *StringType) ToProtoStruct() *structpb.Struct
Click to show internal directories.
Click to hide internal directories.