mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-04 15:50:16 +02:00
do not make the simd stuff a requirement for Envelope.
This commit is contained in:
parent
201abf231b
commit
be2fe4a019
@ -43,7 +43,7 @@ func ParseMessageSIMD(message []byte, reuse *simdjson.ParsedJson) (Envelope, err
|
||||
iter.Advance()
|
||||
label, _ := iter.StringBytes()
|
||||
|
||||
var v Envelope
|
||||
var v EnvelopeSIMD
|
||||
|
||||
switch {
|
||||
case bytes.Equal(label, labelEvent):
|
||||
@ -117,12 +117,16 @@ func ParseMessage(message []byte) Envelope {
|
||||
|
||||
type Envelope interface {
|
||||
Label() string
|
||||
UnmarshalSIMD(simdjson.Iter) error
|
||||
UnmarshalJSON([]byte) error
|
||||
MarshalJSON() ([]byte, error)
|
||||
String() string
|
||||
}
|
||||
|
||||
type EnvelopeSIMD interface {
|
||||
Envelope
|
||||
UnmarshalSIMD(simdjson.Iter) error
|
||||
}
|
||||
|
||||
var (
|
||||
_ Envelope = (*EventEnvelope)(nil)
|
||||
_ Envelope = (*ReqEnvelope)(nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user