github.com/MerlinKodo/quic-go@v0.39.2/internal/wire/ping_frame.go (about)

     1  package wire
     2  
     3  import (
     4  	"github.com/MerlinKodo/quic-go/internal/protocol"
     5  )
     6  
     7  // A PingFrame is a PING frame
     8  type PingFrame struct{}
     9  
    10  func (f *PingFrame) Append(b []byte, _ protocol.VersionNumber) ([]byte, error) {
    11  	return append(b, pingFrameType), nil
    12  }
    13  
    14  // Length of a written frame
    15  func (f *PingFrame) Length(_ protocol.VersionNumber) protocol.ByteCount {
    16  	return 1
    17  }