- 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`
35 lines
898 B
Go
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)
|
|
}
|