Documentation
¶
Index ¶
- type File
- type FileSpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CountFilesByProjectID(projectID string) (int64, 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) GetFileByFileIDAndProjectID(fileID, projectID 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)
- func (s *S) ListFilesByProjectIDAndPurposeWithPagination(projectID, purpose string, afterID uint, limit int, order string) ([]*File, bool, error)
- func (s *S) ListFilesByProjectIDWithPagination(projectID string, afterID uint, limit int, order string) ([]*File, bool, 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) CountFilesByProjectID ¶ added in v1.4.0
CountFilesByProjectID counts files by project ID.
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) GetFileByFileIDAndProjectID ¶ added in v1.4.0
GetFileByFileIDAndProjectID returns a file by file ID and project ID.
func (*S) GetFileByFileIDAndTenantID ¶
GetFileByFileIDAndTenantID returns a file by file ID and a tenant ID.
func (*S) ListFilesByProjectID ¶
ListFilesByProjectID lists files.
func (*S) ListFilesByProjectIDAndPurpose ¶
ListFilesByProjectIDAndPurpose list files.
Click to show internal directories.
Click to hide internal directories.