Documentation ¶
Index ¶
- func NewPbCollectionMetadata(mc *ModelCollection) *apppb.CollectionMetadata
- func NewPbSchemaFields(m *ModelSchema) []*apppb.SchemaField
- type CollectionID
- type FieldID
- type ModelCollection
- type ModelCollectionType
- type ModelFieldSchema
- type ModelFieldsSchema
- type ModelSchema
- type SchemaID
- type SwagValueType
- type SwagValueValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPbCollectionMetadata ¶
func NewPbCollectionMetadata(mc *ModelCollection) *apppb.CollectionMetadata
func NewPbSchemaFields ¶
func NewPbSchemaFields(m *ModelSchema) []*apppb.SchemaField
Types ¶
type CollectionID ¶
type CollectionID string
func NewCollectionID ¶
func NewCollectionID() CollectionID
func NewCollectionIDFromStr ¶
func NewCollectionIDFromStr(s string) CollectionID
func (CollectionID) String ¶
func (c CollectionID) String() string
type ModelCollection ¶
type ModelCollection struct { ID CollectionID `gorm:"column:id;primarykey;type:string;"` Type ModelCollectionType `gorm:"column:type;type:int;"` // Summary is a summary for the collections Summary string `gorm:"column:summary"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"` Schemas []*ModelSchema `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` // associated to many schemes ModelProjectID modelprojects.ProjectID // foreign key to model project ModelProject modelprojects.ModelProject }
func NewModelCollection ¶
func NewModelCollection( projectId modelprojects.ProjectID, id CollectionID, t apppb.CollectionType, summary string, schemas []*ModelSchema, ) ModelCollection
func (ModelCollection) TableName ¶
func (m ModelCollection) TableName() string
type ModelCollectionType ¶
type ModelCollectionType apppb.CollectionType
func (ModelCollectionType) Number ¶
func (m ModelCollectionType) Number() int
func (ModelCollectionType) Proto ¶
func (m ModelCollectionType) Proto() apppb.CollectionType
func (*ModelCollectionType) Scan ¶
func (m *ModelCollectionType) Scan(in any) error
type ModelFieldSchema ¶
type ModelFieldSchema struct { ID FieldID `gorm:"column:id;primarykey;type:int;autoIncrement"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"` FieldName *dotnotation.DotNotation `gorm:"column:field_name";type:string` // dot concated path, a.b.c represents a -> b -> c path FieldValueType SwagValueType `gorm:"column:value_type"` FieldExample *SwagValueValue `gorm:"column:value_example;type:jsonb"` ModelSchemaID SchemaID // foreign key to ModelSchema -> ID }
func (ModelFieldSchema) TableName ¶
func (m ModelFieldSchema) TableName() string
type ModelFieldsSchema ¶
type ModelFieldsSchema []*ModelFieldSchema
type ModelSchema ¶
type ModelSchema struct { ID SchemaID `gorm:"column:id;primarykey;type:int;uniqueIndex:cidsid;autoIncrement"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"` Fields []*ModelFieldSchema `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` ModelCollectionID CollectionID // foreigh key to ModelCollection -> ID }
func NewModelSchema ¶
func NewModelSchema(reqSchemas []*apppb.SchemaField) (*ModelSchema, error)
func (ModelSchema) TableName ¶
func (m ModelSchema) TableName() string
type SwagValueType ¶
type SwagValueType string
var ( NoneSwagValueType SwagValueType = "none" NullSwagValueType SwagValueType = "null" StringSwagValueType SwagValueType = "string" NumberSwagValueType SwagValueType = "number" IntegerSwagValueType SwagValueType = "integer" BoolSwagValueType SwagValueType = "bool" ObjectSwagValueType SwagValueType = "object" ArraySwagValueType SwagValueType = "array" )
func NewSwaggerValueType ¶
func NewSwaggerValueType(pbDataType apppb.SchemaFieldDataType) SwagValueType
func (SwagValueType) Proto ¶
func (f SwagValueType) Proto() apppb.SchemaFieldDataType
type SwagValueValue ¶
func Must ¶
func Must(s *SwagValueValue, e error) *SwagValueValue
func NewSwagValue ¶
func NewSwagValue(v any) (*SwagValueValue, error)
func (SwagValueValue) Interface ¶
func (s SwagValueValue) Interface() interface{}
func (SwagValueValue) Proto ¶
func (s SwagValueValue) Proto() *structpb.Value
func (*SwagValueValue) Scan ¶
func (s *SwagValueValue) Scan(in any) error
func (*SwagValueValue) Type ¶
func (s *SwagValueValue) Type() SwagValueType
Click to show internal directories.
Click to hide internal directories.