Files
orly/pkg/interfaces/server/server.go
mleku b5448f4153 Add remote address to log and fix NIP20 prefix handling
- Updated `handleMessage.go` to include the real remote address in the log message when a message is received
- Removed `regexp` import and `NIP20prefixmatcher` variable from `publisher.go`
- Modified `server.go` to remove an unused parameter from the `AddEvent` method
- Added `NIP20prefixmatcher` variable and used it for checking error messages in `addEvent.go`
2025-07-21 13:35:10 +01:00

35 lines
898 B
Go

package server
import (
"net/http"
"orly.dev/pkg/app/relay/publish"
"orly.dev/pkg/encoders/event"
"orly.dev/pkg/encoders/filters"
"orly.dev/pkg/interfaces/relay"
"orly.dev/pkg/interfaces/store"
"orly.dev/pkg/utils/context"
)
type I interface {
AcceptEvent(
c context.T, ev *event.E, hr *http.Request, authedPubkey []byte,
remote string,
) (accept bool, notice string, afterSave func())
AcceptReq(
c context.T, hr *http.Request, f *filters.T,
authedPubkey []byte, remote string,
) (allowed *filters.T, accept bool, modified bool)
AddEvent(
c context.T, rl relay.I, ev *event.E, hr *http.Request, origin string,
) (accepted bool, message []byte)
Context() context.T
Publisher() *publish.S
Publish(c context.T, evt *event.E) (err error)
Relay() relay.I
Shutdown()
Storage() store.I
AuthRequired() bool
PublicReadable() bool
ServiceURL(req *http.Request) (s string)
}