add nipb0/blossom helpers.

This commit is contained in:
fiatjaf
2025-03-04 12:42:24 -03:00
parent 5bfaed2740
commit 5bafd1c778
8 changed files with 366 additions and 0 deletions

22
nipb0/blossom/types.go Normal file
View File

@@ -0,0 +1,22 @@
package blossom
import (
"encoding/json"
"github.com/nbd-wtf/go-nostr"
)
// BlobDescriptor represents metadata about a blob stored on a media server
type BlobDescriptor struct {
URL string `json:"url"`
SHA256 string `json:"sha256"`
Size int `json:"size"`
Type string `json:"type"`
Uploaded nostr.Timestamp `json:"uploaded"`
}
// String returns a JSON string representation of the BlobDescriptor
func (bd BlobDescriptor) String() string {
j, _ := json.Marshal(bd)
return string(j)
}