Changeset 0.22.8 (#150)
This commit is contained in:
@@ -34,7 +34,7 @@ type Stores struct {
|
||||
Usage UsageStore
|
||||
Pricing PricingStore
|
||||
Extensions ExtensionStore
|
||||
Attachments AttachmentStore
|
||||
Files FileStore
|
||||
KnowledgeBases KnowledgeBaseStore
|
||||
Groups GroupStore
|
||||
ResourceGrants ResourceGrantStore
|
||||
@@ -385,24 +385,27 @@ type ExtensionStore interface {
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// ATTACHMENT STORE
|
||||
// FILE STORE
|
||||
// =========================================
|
||||
|
||||
type AttachmentStore interface {
|
||||
Create(ctx context.Context, a *models.Attachment) error
|
||||
GetByID(ctx context.Context, id string) (*models.Attachment, error)
|
||||
GetByChannel(ctx context.Context, channelID string) ([]models.Attachment, error)
|
||||
GetByMessage(ctx context.Context, messageID string) ([]models.Attachment, error)
|
||||
GetByProject(ctx context.Context, projectID string) ([]models.Attachment, error) // v0.22.4
|
||||
SetMessageID(ctx context.Context, attachmentID, messageID string) error
|
||||
type FileStore interface {
|
||||
Create(ctx context.Context, f *models.File) error
|
||||
GetByID(ctx context.Context, id string) (*models.File, error)
|
||||
GetByChannel(ctx context.Context, channelID string, origin string) ([]models.File, error)
|
||||
GetByMessage(ctx context.Context, messageID string) ([]models.File, error)
|
||||
GetByProject(ctx context.Context, projectID string) ([]models.File, error)
|
||||
GetByUser(ctx context.Context, userID string, page, perPage int) ([]models.File, int, error) // paginated, returns total
|
||||
SetMessageID(ctx context.Context, fileID, messageID string) error
|
||||
UpdateMetadata(ctx context.Context, id string, metadata map[string]interface{}) error
|
||||
SetExtractedText(ctx context.Context, id string, text string) error
|
||||
Delete(ctx context.Context, id string) (*models.Attachment, error) // returns deleted row for storage cleanup
|
||||
Delete(ctx context.Context, id string) (*models.File, error) // returns deleted row for storage cleanup
|
||||
DeleteByChannel(ctx context.Context, channelID string) ([]string, error) // returns storage_keys
|
||||
UserUsageBytes(ctx context.Context, userID string) (int64, error)
|
||||
ListOrphans(ctx context.Context, olderThan time.Duration) ([]models.Attachment, error)
|
||||
ListOrphans(ctx context.Context, olderThan time.Duration) ([]models.File, error)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// =========================================
|
||||
// KNOWLEDGE BASE STORE
|
||||
// =========================================
|
||||
|
||||
Reference in New Issue
Block a user