23 lines
496 B
Go
23 lines
496 B
Go
package attachment
|
|
|
|
import (
|
|
"context"
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
type Attachment struct {
|
|
ID, ChatID, OwnerID uuid.UUID
|
|
Filename string
|
|
FileHash []byte
|
|
SizeBytes int64
|
|
MIMEType, Status string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Repository interface {
|
|
IsMember(context.Context, uuid.UUID, uuid.UUID) (bool, error)
|
|
Publish(context.Context, Attachment, string) error
|
|
GetForMember(context.Context, uuid.UUID, uuid.UUID) (Attachment, error)
|
|
}
|