Documentation ¶
Index ¶
- Variables
- func AuthTimeCheck(eventCreatedAt int64) (bool, string)
- func BuildCborResponse(messageType string, params ...interface{}) []byte
- func BuildResponse(messageType string, params ...interface{}) []byte
- func CloseStream(stream network.Stream)
- func GetHandler(kind string) func(read KindReader, write KindWriter)
- func GetHandlers() map[string]KindHandler
- func IsKindBlocked(kind int, settings *types.RelaySettings) bool
- func IsTheKindAllowed(kind int, settings *types.RelaySettings) bool
- func LoadRelaySettings() (*types.RelaySettings, error)
- func RegisterHandler(kind string, handler func(read KindReader, write KindWriter)) error
- func Responder(stream network.Stream, messageType string, params ...interface{})
- func TimeCheck(eventCreatedAt int64) bool
- func ValidateEvent(write KindWriter, env nostr.EventEnvelope, expectedKind int) bool
- type KindHandler
- type KindReader
- type KindWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var KindHandlers map[string]KindHandler
Functions ¶
func AuthTimeCheck ¶
func BuildCborResponse ¶
func BuildResponse ¶
func CloseStream ¶
func GetHandler ¶
func GetHandler(kind string) func(read KindReader, write KindWriter)
func GetHandlers ¶
func GetHandlers() map[string]KindHandler
func IsKindBlocked ¶
func IsKindBlocked(kind int, settings *types.RelaySettings) bool
func IsTheKindAllowed ¶
func IsTheKindAllowed(kind int, settings *types.RelaySettings) bool
func LoadRelaySettings ¶
func LoadRelaySettings() (*types.RelaySettings, error)
func RegisterHandler ¶
func RegisterHandler(kind string, handler func(read KindReader, write KindWriter)) error
func ValidateEvent ¶
func ValidateEvent(write KindWriter, env nostr.EventEnvelope, expectedKind int) bool
Gerneric event validation that almost all kinds will use
Types ¶
type KindHandler ¶
type KindHandler func(read KindReader, write KindWriter)
type KindReader ¶
type KindWriter ¶
type KindWriter func(messageType string, params ...interface{})
Click to show internal directories.
Click to hide internal directories.