func newMiddlewareStore() *middlewareStore {
	return &middlewareStore{
		bytesReceived:          make([]BytesReceived, 0),
		localNodeWillStart:     make([]LocalNodeWillStart, 0),
		localNodeStarted:       make([]LocalNodeStarted, 0),
		localNodeWillStop:      make([]LocalNodeWillStop, 0),
		localNodeStopped:       make([]LocalNodeStopped, 0),
		willConnectToNode:      make([]WillConnectToNode, 0),
		remoteNodeConnected:    make([]RemoteNodeConnected, 0),
		remoteNodeReady:        make([]RemoteNodeReady, 0),
		remoteNodeDisconnected: make([]RemoteNodeDisconnected, 0),
		messageEncoded:         make([]MessageEncoded, 0),
		messageWillDecode:      make([]MessageWillDecode, 0),
	}
}
newMiddlewareStore creates a middlewareStore
package node
import (
	"errors"
	"github.com/nknorg/nnet/middleware"
	"github.com/nknorg/nnet/protobuf"
)
type BytesReceived struct {
	Func     func(data, msgID, srcID []byte, remoteNode *RemoteNode) ([]byte, bool)
	Priority int32
}
type LocalNodeWillStart struct {
	Func     func(*LocalNode) bool
	Priority int32
}
type LocalNodeStarted struct {
	Func     func(*LocalNode) bool
	Priority int32
}
type LocalNodeWillStop struct {
	Func     func(*LocalNode) bool
	Priority int32
}
type LocalNodeStopped struct {
	Func     func(*LocalNode) bool
	Priority int32
}
type WillConnectToNode struct {
	Func     func(*protobuf.Node) (bool, bool)
	Priority int32
}
type RemoteNodeConnected struct {
	Func     func(*RemoteNode) bool
	Priority int32
}
type RemoteNodeReady struct {
	Func     func(*RemoteNode) bool
	Priority int32
}
type RemoteNodeDisconnected struct {
	Func     func(*RemoteNode) bool
	Priority int32
}
type MessageEncoded struct {
	Func     func(*RemoteNode, []byte) ([]byte, bool)
	Priority int32
}
type MessageWillDecode struct {
	Func     func(*RemoteNode, []byte) ([]byte, bool)
	Priority int32
}
type middlewareStore struct {
	bytesReceived          []BytesReceived
	localNodeWillStart     []LocalNodeWillStart
	localNodeStarted       []LocalNodeStarted
	localNodeWillStop      []LocalNodeWillStop
	localNodeStopped       []LocalNodeStopped
	willConnectToNode      []WillConnectToNode
	remoteNodeConnected    []RemoteNodeConnected
	remoteNodeReady        []RemoteNodeReady
	remoteNodeDisconnected []RemoteNodeDisconnected
	messageEncoded         []MessageEncoded
	messageWillDecode      []MessageWillDecode
}