mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
79e57e8e8e
* add flag and enum * change help message * linter * add flag * add comment * one more comment * fix panic * preston's comments * add panic
24 lines
690 B
Go
24 lines
690 B
Go
package encoder
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/gogo/protobuf/proto"
|
|
)
|
|
|
|
// Defines the different encoding formats
|
|
const (
|
|
SSZ = "ssz" // SSZ is SSZ only.
|
|
SSZSnappy = "ssz-snappy" // SSZSnappy is SSZ with snappy compression.
|
|
)
|
|
|
|
// NetworkEncoding represents an encoder compatible with Ethereum 2.0 p2p.
|
|
type NetworkEncoding interface {
|
|
// Decode reads bytes from the reader and decodes it to the provided message.
|
|
Decode(io.Reader, proto.Message) error
|
|
// Encode an arbitrary message to the provided writer.
|
|
Encode(io.Writer, proto.Message) (int, error)
|
|
// ProtocolSuffix returns the last part of the protocol ID to indicate the encoding scheme.
|
|
ProtocolSuffix() string
|
|
}
|