neo-go/pkg/network/payload/payloader.go
2018-01-27 16:00:28 +01:00

19 lines
395 B
Go

package payload
import "io"
// Nothing is a safe non payload.
var Nothing = nothing{}
// Payloader ..
type Payloader interface {
Encode(io.Writer) error
Decode(io.Reader) error
Size() uint32
}
type nothing struct{}
func (p nothing) Encode(w io.Writer) error { return nil }
func (p nothing) Decode(R io.Reader) error { return nil }
func (p nothing) Size() uint32 { return 0 }