Перенесите реализацию ЛР 4 на стенд ЛР 5
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package attachment
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
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
|
||||
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