Documentation
¶
Index ¶
- type File
- type FileSpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CreateFile(spec FileSpec) (*File, error)
- func (s *S) DeleteFile(fileID, projectID string) error
- func (s *S) GetFile(fileID, projectID string) (*File, error)
- func (s *S) GetFileByFileID(fileID string) (*File, error)
- func (s *S) GetFileByFileIDAndTenantID(fileID, tenantID string) (*File, error)
- func (s *S) ListFilesByProjectID(projectID string) ([]*File, error)
- func (s *S) ListFilesByProjectIDAndPurpose(projectID, purpose string) ([]*File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { gorm.Model FileID string `gorm:"uniqueIndex"` TenantID string `gorm:"index"` OrganizationID string ProjectID string `gorm:"index"` Filename string Purpose string Bytes int64 ObjectStorePath string }
File represents a file.
type FileSpec ¶
type FileSpec struct { FileID string TenantID string OrganizationID string ProjectID string 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 project ID.
func (*S) GetFileByFileID ¶
GetFileByFileID returns a file by file ID.
func (*S) GetFileByFileIDAndTenantID ¶
GetFileByFileIDAndTenantID returns a file by file ID and a tenant ID.
func (*S) ListFilesByProjectID ¶
ListFilesByProjectID lists files.
Click to show internal directories.
Click to hide internal directories.