Documentation ¶
Index ¶
- Variables
- func CalculateUnpaddedSize(p *Payload) (int, error)
- func MaxUnpaddedSize() (int, error)
- func NewBytes(p *Payload) ([]byte, error)
- type Payload
- func (*Payload) Descriptor() ([]byte, []int)deprecated
- func (x *Payload) GetConnections() uint64
- func (x *Payload) GetId() []byte
- func (x *Payload) GetPadding() []byte
- func (x *Payload) GetRate() uint64
- func (x *Payload) GetSize() uint64
- func (x *Payload) GetTime() *timestamppb.Timestamp
- func (*Payload) ProtoMessage()
- func (x *Payload) ProtoReflect() protoreflect.Message
- func (x *Payload) Reset()
- func (x *Payload) String() string
Constants ¶
This section is empty.
Variables ¶
var File_payload_payload_proto protoreflect.FileDescriptor
Functions ¶
func CalculateUnpaddedSize ¶
CalculateUnpaddedSize calculates the size of the passed in payload for the purpose of determining how much padding to add to add to reach the target size. CalculateUnpaddedSize returns an error if the payload Padding field is longer than 1.
func MaxUnpaddedSize ¶
MaxUnpaddedSize returns the maximum size that a payload may be if no padding is included.
Types ¶
type Payload ¶
type Payload struct { Connections uint64 `protobuf:"varint,1,opt,name=connections,proto3" json:"connections,omitempty"` Rate uint64 `protobuf:"varint,2,opt,name=rate,proto3" json:"rate,omitempty"` Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` Time *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"` Id []byte `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` Padding []byte `protobuf:"bytes,6,opt,name=padding,proto3" json:"padding,omitempty"` // contains filtered or unexported fields }
Payload is the structure of the loadtime transaction. Proto has a compact encoded representation, making it ideal for the loadtime usecase which aims to keep the generated transactions small.
func FromBytes ¶
FromBytes extracts a paylod from the byte representation of the payload. FromBytes leaves the padding untouched, returning it to the caller to handle or discard per their preference.
func (*Payload) Descriptor
deprecated
func (*Payload) GetConnections ¶
func (*Payload) GetPadding ¶
func (*Payload) GetTime ¶
func (x *Payload) GetTime() *timestamppb.Timestamp
func (*Payload) ProtoMessage ¶
func (*Payload) ProtoMessage()
func (*Payload) ProtoReflect ¶
func (x *Payload) ProtoReflect() protoreflect.Message