Documentation ¶
Index ¶
- Variables
- type File
- type FileKey
- type FileSpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CreateFile(spec FileSpec) (*File, error)
- func (s *S) DeleteFile(k FileKey) error
- func (s *S) GetFile(k FileKey) (*File, error)
- func (s *S) ListFilesByTenantID(tenantID string) ([]*File, error)
- func (s *S) ListFilesByTenantIDAndPurpose(tenantID, purpose string) ([]*File, 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 File ¶
type File struct { gorm.Model FileID string `gorm:"uniqueIndex:idx_file_file_id_tenant_id"` TenantID string `gorm:"uniqueIndex:idx_file_file_id_tenant_id"` Filename string Purpose string `gorm:"index:idx_file_tenant_id_purpose"` Bytes int64 ObjectStorePath string }
File represents a file.
type FileSpec ¶
type FileSpec struct { Key FileKey Filename string Purpose string Bytes int64 ObjectStorePath string }
FileSpec is a spec of the file
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) CreateFile ¶
CreateFile creates a file.
func (*S) DeleteFile ¶
DeleteFile deletes a file by file ID and tenant ID.
func (*S) ListFilesByTenantID ¶
ListFilesByTenantID list files.
Click to show internal directories.
Click to hide internal directories.