mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 13:22:56 +01:00
27 lines
689 B
Go
27 lines
689 B
Go
package blossom
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nbd-wtf/go-nostr"
|
|
)
|
|
|
|
type BlobDescriptor struct {
|
|
URL string `json:"url"`
|
|
SHA256 string `json:"sha256"`
|
|
Size int `json:"size"`
|
|
Type string `json:"type"`
|
|
Uploaded nostr.Timestamp `json:"uploaded"`
|
|
|
|
Owner string `json:"-"`
|
|
}
|
|
|
|
type BlobIndex interface {
|
|
Keep(ctx context.Context, blob BlobDescriptor, pubkey string) error
|
|
List(ctx context.Context, pubkey string) (chan BlobDescriptor, error)
|
|
Get(ctx context.Context, sha256 string) (*BlobDescriptor, error)
|
|
Delete(ctx context.Context, sha256 string, pubkey string) error
|
|
}
|
|
|
|
var _ BlobIndex = (*EventStoreBlobIndexWrapper)(nil)
|