more conversions.

This commit is contained in:
fiatjaf
2025-04-15 00:00:03 -03:00
parent f9e4a5efa3
commit 376834cbf9
117 changed files with 450 additions and 1019 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// Check checks if a file exists on the media server by its hash

View File

@@ -4,7 +4,7 @@ import (
"strings"
"time"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
"github.com/valyala/fasthttp"
)

View File

@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// Delete deletes a file from the media server by its hash

View File

@@ -7,7 +7,7 @@ import (
"net/http"
"os"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// Download downloads a file from the media server by its hash

View File

@@ -8,7 +8,7 @@ import (
"io"
"strconv"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
"github.com/valyala/fasthttp"
)

View File

@@ -2,9 +2,10 @@ package blossom
import (
"context"
"encoding/hex"
"fmt"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// List retrieves a list of blobs from a specific pubkey
@@ -15,7 +16,7 @@ func (c *Client) List(ctx context.Context) ([]BlobDescriptor, error) {
}
bds := make([]BlobDescriptor, 0, 100)
err = c.httpCall(ctx, "GET", "list/"+pubkey, "", func() string {
err = c.httpCall(ctx, "GET", "list/"+hex.EncodeToString(pubkey[:]), "", func() string {
return c.authorizationHeader(ctx, func(evt *nostr.Event) {
evt.Tags = append(evt.Tags, nostr.Tag{"t", "list"})
})

View File

@@ -3,7 +3,7 @@ package blossom
import (
"encoding/json"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// BlobDescriptor represents metadata about a blob stored on a media server

View File

@@ -10,7 +10,7 @@ import (
"os"
"path/filepath"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// UploadFile uploads a file to the media server