Documentation
¶
Index ¶
Constants ¶
View Source
const MaxSize = 64378
MaxPayloadSize = MaxMessageSize -
(version(1) + parentsBlocksCount(1) + 4 * (parentsType(1) + parentsCount(1) + 8 * reference(32)) + issuerPK(32) + issuanceTime(8) + seqNum(8) + payloadLength(4) + nonce(8) + signature(64) = MaxMessageSize - 1158 bytes = 64378
Variables ¶
View Source
var GenericDataPayloadType = NewType(0, "GenericDataPayloadType")
GenericDataPayloadType is the Type of a generic GenericDataPayload.
Functions ¶
This section is empty.
Types ¶
type GenericDataPayload ¶
type GenericDataPayload struct {
// contains filtered or unexported fields
}
GenericDataPayload represents a payload which just contains a blob of data.
func GenericDataPayloadFromBytes ¶
func GenericDataPayloadFromBytes(bytes []byte) (genericDataPayload *GenericDataPayload, consumedBytes int, err error)
GenericDataPayloadFromBytes unmarshals a GenericDataPayload from a sequence of bytes.
func NewGenericDataPayload ¶
func NewGenericDataPayload(data []byte) *GenericDataPayload
NewGenericDataPayload creates new GenericDataPayload.
func (*GenericDataPayload) Blob ¶
func (g *GenericDataPayload) Blob() []byte
Blob returns the contained data of the GenericDataPayload (without its type and size headers).
func (*GenericDataPayload) Bytes ¶
func (g *GenericDataPayload) Bytes() []byte
Bytes returns a marshaled version of the Payload.
func (*GenericDataPayload) String ¶
func (g *GenericDataPayload) String() string
String returns a human readable version of the Payload.
func (*GenericDataPayload) Type ¶
func (g *GenericDataPayload) Type() Type
Type returns the Type of the Payload.
type Payload ¶
type Payload interface { // Type returns the Type of the Payload. Type() Type // Bytes returns a marshaled version of the Payload. Bytes() []byte // String returns a human readable version of the Payload. String() string }
Payload represents the generic interface for an object that can be embedded in Messages of the Tangle.
Click to show internal directories.
Click to hide internal directories.