Documentation
¶
Index ¶
- Variables
- func AuthTimeCheck(eventCreatedAt int64) (bool, string)
- func BuildCborResponse(messageType string, params ...interface{}) []byte
- func BuildResponse(messageType string, params ...interface{}) []byte
- func ClearHandlers()
- func CloseStream(stream network.Stream)
- func ExtractInterfaceValues(data ...interface{}) []interface{}
- func GetHandler(kind string) func(read KindReader, write KindWriter)
- func GetHandlers() map[string]KindHandler
- func IsKindAllowed(kind int) bool
- func IsRegisteredKind(kind int) bool
- 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 ClearHandlers ¶
func ClearHandlers()
func CloseStream ¶
func ExtractInterfaceValues ¶
func ExtractInterfaceValues(data ...interface{}) []interface{}
ExtractInterfaceValues is the exported form of extractInterfaceValues.
func GetHandler ¶
func GetHandler(kind string) func(read KindReader, write KindWriter)
func GetHandlers ¶
func GetHandlers() map[string]KindHandler
func IsKindAllowed ¶
func IsRegisteredKind ¶
IsRegisteredKind checks if a kind number has a registered handler
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.