Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrWrongType = errors.New("wrong payload type")
Functions ¶
This section is empty.
Types ¶
type AddressedCall ¶
type AddressedCall struct {
SourceAddress []byte `json:"sourceAddress"`
Payload []byte `json:"payload"`
// contains filtered or unexported fields
}
AddressedCall defines the format for delivering a call across VMs including a source address and a payload.
Note: If a destination address is expected, it should be encoded in the payload.
func NewAddressedCall ¶
func NewAddressedCall(sourceAddress []byte, payload []byte) (*AddressedCall, error)
NewAddressedCall creates a new *AddressedCall and initializes it.
func ParseAddressedCall ¶
func ParseAddressedCall(b []byte) (*AddressedCall, error)
ParseAddressedCall converts a slice of bytes into an initialized AddressedCall.
func (*AddressedCall) Bytes ¶
func (a *AddressedCall) Bytes() []byte
Bytes returns the binary representation of this payload. It assumes that the payload is initialized from either NewAddressedCall or Parse.
type Hash ¶
type Payload ¶
type Payload interface {
// Bytes returns the binary representation of this payload.
Bytes() []byte
// contains filtered or unexported methods
}
Payload provides a common interface for all payloads implemented by this package. Each payload is a native-ZAP struct-is-wire object whose first byte is a pkind discriminator (the struct IS the buffer; no codec).