github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/srpc/frame-padding.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package srpc
     4  
     5  import "../syllab"
     6  
     7  /*
     8  type paddingFrame struct {
     9  	Length  [2]byte // including the header fields
    10  	Padding []byte
    11  }
    12  */
    13  type paddingFrame []byte
    14  
    15  func (f paddingFrame) Length() uint16    { return syllab.GetUInt16(f, 0) }
    16  func (f paddingFrame) Payload() []byte   { return f[2:f.Length()] }
    17  func (f paddingFrame) NextFrame() []byte { return f[f.Length():] }