Documentation ¶
Index ¶
- Variables
- type BaseModel
- type Model
- type ModelKey
- type ModelSpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CreateBaseModel(modelID, path string) (*BaseModel, error)
- func (s *S) CreateModel(spec ModelSpec) (*Model, error)
- func (s *S) DeleteModel(k ModelKey) error
- func (s *S) GetBaseModel(modelID string) (*BaseModel, error)
- func (s *S) GetModel(k ModelKey, onlyPublished bool) (*Model, error)
- func (s *S) ListBaseModels() ([]*BaseModel, error)
- func (s *S) ListModelsByTenantID(tenantID string, onlyPublished bool) ([]*Model, error)
- func (s *S) UpdateModel(k ModelKey, isPublished bool) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrConcurrentUpdate is returned when there is a concurrent update. ErrConcurrentUpdate = fmt.Errorf("store: concurrent update") )
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { gorm.Model ModelID string `gorm:"uniqueIndex:idx_model_model_id_tenant_id"` TenantID string `gorm:"uniqueIndex:idx_model_model_id_tenant_id"` Path string IsPublished bool }
Model represents a model.
type S ¶
type S struct {
// contains filtered or unexported fields
}
S represents the data store.
func (*S) AutoMigrate ¶
AutoMigrate sets up the auto-migration task of the database.
func (*S) CreateBaseModel ¶ added in v0.5.0
CreateBaseModel creates a model.
func (*S) CreateModel ¶
CreateModel creates a model.
func (*S) DeleteModel ¶
DeleteModel deletes a model by model ID and tenant ID.
func (*S) GetBaseModel ¶ added in v0.5.0
GetBaseModel returns a base model by model ID.
func (*S) ListBaseModels ¶ added in v0.5.0
ListBaseModels returns all base models.
func (*S) ListModelsByTenantID ¶
ListModelsByTenantID finds models.
Click to show internal directories.
Click to hide internal directories.