Changeset 0.12.0 (#63)
This commit is contained in:
@@ -33,6 +33,7 @@ type Stores struct {
|
||||
Usage UsageStore
|
||||
Pricing PricingStore
|
||||
Extensions ExtensionStore
|
||||
Attachments AttachmentStore
|
||||
}
|
||||
|
||||
// =========================================
|
||||
@@ -340,6 +341,24 @@ type ExtensionStore interface {
|
||||
DeleteUserSettings(ctx context.Context, extID, userID string) error
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// ATTACHMENT 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)
|
||||
SetMessageID(ctx context.Context, attachmentID, 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
|
||||
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)
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// SHARED TYPES
|
||||
// =========================================
|
||||
|
||||
Reference in New Issue
Block a user