update import paths.

This commit is contained in:
fiatjaf
2025-04-15 08:51:25 -03:00
parent 76032dc089
commit f493293be2
106 changed files with 224 additions and 224 deletions

View File

@@ -5,8 +5,8 @@ import (
"errors"
"fmt"
"github.com/fiatjaf/eventstore"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/eventstore"
"fiatjaf.com/nostr"
)
// AddEvent sends an event through then normal add pipeline, as if it was received from a websocket.

View File

@@ -8,7 +8,7 @@ import (
"strings"
"github.com/mailru/easyjson"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
func readAuthorization(r *http.Request) (*nostr.Event, error) {

View File

@@ -3,7 +3,7 @@ package blossom
import (
"context"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
type BlobDescriptor struct {

View File

@@ -4,8 +4,8 @@ import (
"context"
"strconv"
"github.com/fiatjaf/eventstore"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/eventstore"
"fiatjaf.com/nostr"
)
// EventStoreBlobIndexWrapper uses fake events to keep track of what blobs we have stored and who owns them

View File

@@ -12,7 +12,7 @@ import (
"time"
"github.com/liamg/magic"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
func (bs BlossomServer) handleUploadCheck(w http.ResponseWriter, r *http.Request) {

View File

@@ -6,8 +6,8 @@ import (
"net/http"
"strings"
"github.com/fiatjaf/khatru"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr"
)
type BlossomServer struct {

View File

@@ -1,7 +1,7 @@
package khatru
import (
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
// BroadcastEvent emits an event to all listeners whose filters' match, skipping all filters and actions

View File

@@ -6,7 +6,7 @@ import (
"strconv"
"strings"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
func (rl *Relay) handleDeleteRequest(ctx context.Context, evt *nostr.Event) error {

View File

@@ -4,7 +4,7 @@ import (
"context"
"errors"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
func (rl *Relay) handleEphemeral(ctx context.Context, evt *nostr.Event) error {

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"net/http"
"github.com/fiatjaf/eventstore/badger"
"github.com/fiatjaf/khatru"
"fiatjaf.com/nostr/eventstore/badger"
"fiatjaf.com/nostr/khatru"
)
func main() {

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"net/http"
"github.com/fiatjaf/eventstore/elasticsearch"
"github.com/fiatjaf/khatru"
"fiatjaf.com/nostr/eventstore/elasticsearch"
"fiatjaf.com/nostr/khatru"
)
func main() {

View File

@@ -5,8 +5,8 @@ import (
"net/http"
"os"
"github.com/fiatjaf/eventstore/lmdb"
"github.com/fiatjaf/khatru"
"fiatjaf.com/nostr/eventstore/lmdb"
"fiatjaf.com/nostr/khatru"
)
func main() {

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"net/http"
"github.com/fiatjaf/eventstore/postgresql"
"github.com/fiatjaf/khatru"
"fiatjaf.com/nostr/eventstore/postgresql"
"fiatjaf.com/nostr/khatru"
)
func main() {

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"net/http"
"github.com/fiatjaf/eventstore/sqlite3"
"github.com/fiatjaf/khatru"
"fiatjaf.com/nostr/eventstore/sqlite3"
"fiatjaf.com/nostr/khatru"
)
func main() {

View File

@@ -7,9 +7,9 @@ import (
"net/http"
"strings"
"github.com/fiatjaf/eventstore/badger"
"github.com/fiatjaf/khatru"
"github.com/fiatjaf/khatru/blossom"
"fiatjaf.com/nostr/eventstore/badger"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr/khatru/blossom"
)
func main() {

View File

@@ -6,10 +6,10 @@ import (
"net/http"
"os"
"github.com/fiatjaf/eventstore/lmdb"
"github.com/fiatjaf/khatru"
"github.com/fiatjaf/khatru/policies"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/eventstore/lmdb"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr/khatru/policies"
"fiatjaf.com/nostr"
)
func main() {

View File

@@ -6,9 +6,9 @@ import (
"log"
"net/http"
"github.com/fiatjaf/khatru"
"github.com/fiatjaf/khatru/policies"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr/khatru/policies"
"fiatjaf.com/nostr"
)
func main() {

View File

@@ -5,10 +5,10 @@ import (
"net/http"
"slices"
"github.com/fiatjaf/eventstore/slicestore"
"github.com/fiatjaf/eventstore/sqlite3"
"github.com/fiatjaf/khatru"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/eventstore/slicestore"
"fiatjaf.com/nostr/eventstore/sqlite3"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr"
)
func main() {

View File

@@ -6,8 +6,8 @@ import (
"sync"
"time"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip40"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip40"
)
type expiringEvent struct {

View File

@@ -14,13 +14,13 @@ import (
"github.com/bep/debounce"
"github.com/fasthttp/websocket"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip42"
"github.com/nbd-wtf/go-nostr/nip45"
"github.com/nbd-wtf/go-nostr/nip45/hyperloglog"
"github.com/nbd-wtf/go-nostr/nip70"
"github.com/nbd-wtf/go-nostr/nip77"
"github.com/nbd-wtf/go-nostr/nip77/negentropy"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip42"
"fiatjaf.com/nostr/nip45"
"fiatjaf.com/nostr/nip45/hyperloglog"
"fiatjaf.com/nostr/nip70"
"fiatjaf.com/nostr/nip77"
"fiatjaf.com/nostr/nip77/negentropy"
"github.com/puzpuzpuz/xsync/v3"
"github.com/rs/cors"
)

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strings"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
func isOlder(previous, next *nostr.Event) bool {

View File

@@ -5,7 +5,7 @@ import (
"errors"
"slices"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
var ErrSubscriptionClosedByClient = errors.New("subscription closed by client")

View File

@@ -4,7 +4,7 @@ import (
"math/rand"
"testing"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
"github.com/stretchr/testify/require"
)

View File

@@ -5,7 +5,7 @@ import (
"strings"
"testing"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
"github.com/stretchr/testify/require"
)

View File

@@ -5,10 +5,10 @@ import (
"errors"
"fmt"
"github.com/fiatjaf/eventstore"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip77/negentropy"
"github.com/nbd-wtf/go-nostr/nip77/negentropy/storage/vector"
"fiatjaf.com/nostr/eventstore"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip77/negentropy"
"fiatjaf.com/nostr/nip77/negentropy/storage/vector"
)
type NegentropySession struct {

View File

@@ -13,8 +13,8 @@ import (
"reflect"
"strings"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip86"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip86"
)
type RelayManagementAPI struct {

View File

@@ -7,8 +7,8 @@ import (
"strings"
"time"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip70"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip70"
)
// PreventTooManyIndexableTags returns a function that can be used as a RejectFilter that will reject

View File

@@ -4,8 +4,8 @@ import (
"context"
"slices"
"github.com/fiatjaf/khatru"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr"
)
// NoComplexFilters disallows filters with more than 2 tags.

View File

@@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
func ValidateKind(ctx context.Context, evt *nostr.Event) (bool, string) {

View File

@@ -4,8 +4,8 @@ import (
"context"
"slices"
"github.com/fiatjaf/khatru"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr"
)
// RejectKind04Snoopers prevents reading NIP-04 messages from people not involved in the conversation.

View File

@@ -5,8 +5,8 @@ import (
"net/http"
"time"
"github.com/fiatjaf/khatru"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/khatru"
"fiatjaf.com/nostr"
)
func EventIPRateLimiter(tokensPerInterval int, interval time.Duration, maxTokens int) func(ctx context.Context, _ *nostr.Event) (reject bool, msg string) {

View File

@@ -3,7 +3,7 @@ package policies
import (
"time"
"github.com/fiatjaf/khatru"
"fiatjaf.com/nostr/khatru"
)
func ApplySaneDefaults(relay *khatru.Relay) {

View File

@@ -11,9 +11,9 @@ import (
"time"
"github.com/fasthttp/websocket"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip11"
"github.com/nbd-wtf/go-nostr/nip45/hyperloglog"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip11"
"fiatjaf.com/nostr/nip45/hyperloglog"
)
func NewRelay() *Relay {
@@ -23,7 +23,7 @@ func NewRelay() *Relay {
Log: log.New(os.Stderr, "[khatru-relay] ", log.LstdFlags),
Info: &nip11.RelayInformationDocument{
Software: "https://github.com/fiatjaf/khatru",
Software: "https://fiatjaf.com/nostr/khatru",
Version: "n/a",
SupportedNIPs: []any{1, 11, 40, 42, 70, 86},
},

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/fiatjaf/eventstore/slicestore"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr/eventstore/slicestore"
"fiatjaf.com/nostr"
)
func TestBasicRelayFunctionality(t *testing.T) {

View File

@@ -5,8 +5,8 @@ import (
"errors"
"sync"
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip45/hyperloglog"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/nip45/hyperloglog"
)
func (rl *Relay) handleRequest(ctx context.Context, id string, eose *sync.WaitGroup, ws *WebSocket, filter nostr.Filter) error {

View File

@@ -1,7 +1,7 @@
package khatru
import (
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
type Router struct{ *Relay }

View File

@@ -3,7 +3,7 @@ package khatru
import (
"context"
"github.com/nbd-wtf/go-nostr"
"fiatjaf.com/nostr"
)
const (