Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
ID uint64 `gorm:"primarykey"`
Name string `gorm:"uniqueIndex:uq_category_name;not null"`
// Parent
OwnerID uint64 `gorm:"uniqueIndex:uq_category_name;not null"`
Owner *Owner `gorm:"foreignKey:OwnerID"`
// Children
Centroids []*Centroid `gorm:"foreignKey:CategoryID;constraint:onUpdate:CASCADE,onDelete:CASCADE"`
Documents []*Document `gorm:"foreignKey:CategoryID;constraint:onUpdate:CASCADE,onDelete:CASCADE"`
}
type Centroid ¶
type Centroid struct {
ID uint64 `gorm:"primarykey"`
Vector []byte `gorm:"not null"`
LastUpdated time.Time `gorm:"index:idx_centroid_updated;not null"`
// Parent
CategoryID uint64 `gorm:"index:idx_centroid_category;not null"`
Category *Category `gorm:"foreignKey:CategoryID"`
// Children
Embeddings []*Embedding `gorm:"foreignKey:CentroidID;constraint:onUpdate:CASCADE,onDelete:CASCADE"`
}
type Database ¶
type Database struct {
Provider config.DatabaseProvider
*gorm.DB
// contains filtered or unexported fields
}
type Document ¶
type Document struct {
ID uint64 `gorm:"primarykey"`
Name string `gorm:"not null"`
ExternalID string `gorm:"not null"`
LastUpdated time.Time `gorm:"index:idx_document_updated;not null"`
Document DocumentField `gorm:"not null"`
// Parent
CategoryID uint64 `gorm:"not null"`
Category *Category `gorm:"foreignKey:CategoryID"`
// Children
Embeddings []*Embedding `gorm:"foreignKey:DocumentID;constraint:onUpdate:CASCADE,onDelete:CASCADE"`
}
type DocumentField ¶
type DocumentField json.RawMessage
func (DocumentField) JSON ¶
func (d DocumentField) JSON() (value any)
func (*DocumentField) Scan ¶
func (d *DocumentField) Scan(value any) error
Scan scan value into DocumentField, implements sql.Scanner interface
type Embedding ¶
type Embedding struct {
ID uint64 `gorm:"primarykey"`
Vector []byte `gorm:"not null"`
// Parent
DocumentID uint64 `gorm:"index:idx_embedding_document;not null"`
Document *Document `gorm:"foreignKey:DocumentID"`
CentroidID uint64 `gorm:"index:idx_embedding_centroid;not null"`
Centroid *Centroid `gorm:"foreignKey:CentroidID"`
}
Click to show internal directories.
Click to hide internal directories.