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

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package srpc
     4  
     5  /*
     6  type frame struct {
     7  	Type     byte
     8  	Payload []byte
     9  }
    10  */
    11  type frame []byte
    12  
    13  func (f frame) Type() byte      { return byte(f[0]) }
    14  func (f frame) Payload() []byte { return f[1:] }
    15  
    16  // Frame type ID is like service ID but fixed ID with 8bit length. Just some few services get one byte length service ID
    17  // Common services must register by 64bit unsigned integer.
    18  const (
    19  	frameTypePadding byte = iota
    20  	frameTypePing
    21  	frameTypeCallService
    22  	frameTypeOpenStream
    23  	frameTypeCloseStream
    24  	frameTypeData
    25  	frameTypeSignature
    26  )