Переведите приём и чтение вложений на асинхронный контракт
This commit is contained in:
@@ -7,17 +7,11 @@ import (
|
||||
)
|
||||
|
||||
type AttachmentRepository interface {
|
||||
// WithPublication holds the file's hash lock through the callback and commit.
|
||||
// Publication is valid only inside the callback. Any callback error rolls back.
|
||||
WithPublication(ctx context.Context, attachment Attachment, fn func(Publication) error) error
|
||||
// Enqueue checks the staging object under the collector's lock before committing its job.
|
||||
Enqueue(ctx context.Context, attachment Attachment, stage string, checkStage func() error) error
|
||||
GetForMember(ctx context.Context, attachmentID, actorID uuid.UUID) (Attachment, error)
|
||||
}
|
||||
|
||||
type Publication interface {
|
||||
FileReady() bool
|
||||
SaveReady(ctx context.Context) error
|
||||
}
|
||||
|
||||
type ChatMembership interface {
|
||||
IsMember(ctx context.Context, chatID, actorID uuid.UUID) (bool, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user