libs5-go/protocol/base/base.go

28 lines
692 B
Go
Raw Normal View History

package base
import (
"git.lumeweb.com/LumeWeb/libs5-go/interfaces"
"git.lumeweb.com/LumeWeb/libs5-go/net"
"github.com/vmihailenco/msgpack/v5"
)
2024-01-08 06:16:20 +00:00
//go:generate mockgen -source=base.go -destination=../mocks/base/base.go -package=base
2024-01-08 05:16:32 +00:00
type IncomingMessage interface {
HandleMessage(node interfaces.Node, peer net.Peer, verifyId bool) error
SetIncomingMessage(msg IncomingMessage)
IncomingMessage() IncomingMessage
Self() IncomingMessage
SetSelf(self IncomingMessage)
2024-01-09 17:50:52 +00:00
Original() []byte
2024-01-09 17:49:16 +00:00
Kind() int
RequiresHandshake() bool
SetRequiresHandshake(value bool)
msgpack.CustomDecoder
}
type IncomingMessageTyped interface {
DecodeMessage(dec *msgpack.Decoder) error
IncomingMessage
}