func (c *Codec) ReadRequestHeader(r *rpc.Request) error {
	const op = errors.Op("goridge_read_request_header")
	f := c.getFrame()

	err := c.relay.Receive(f)
	if err != nil {
		return err
	}

	// opts[0] sequence ID
	// opts[1] service method name offset from payload in bytes
	opts := f.ReadOptions(f.Header())
	if len(opts) != 2 {
		return errors.E(op, errors.Str("should be 2 options. SEQ_ID and METHOD_LEN"))
	}

	r.Seq = uint64(opts[0])
	r.ServiceMethod = string(f.Payload()[:opts[1]])
	c.frame = f
	return c.storeCodec(r, f.ReadFlags())
}
// ReadRequestHeader receives frame with options
// options should have 2 values
// [0] - integer, sequence ID
// [1] - integer, offset for method name
// For example:
// 15Test.Payload
// SEQ_ID: 15
// METHOD_LEN: 12 and we take 12 bytes from the payload as method name
ReadRequestHeader receives frame with options
options should have 2 values
[0] - integer, sequence ID
[1] - integer, offset for method name
For example:
15Test.Payload
SEQ_ID: 15
METHOD_LEN: 12 and we take 12 bytes from the payload as method name
// ReadRequestHeader receives frame with options // options should have 2 values // [ 0 ] - integer sequence ID // [ 1 ] - integer offset for method name // For example : // 15Test . Payload // SEQ_ID : 15 // METHOD_LEN : 12 and we take 12 bytes from the payload as method name
func (c *Codec) ReadRequestHeader(r *rpc.Request) error {
	const op = errors.Op("goridge_read_request_header")
	f := c.getFrame()
	err := c.relay.Receive(f)
	if err != nil {
		return err
	}
	opts := f.ReadOptions(f.Header())
	if len(opts) != 2 {
		return errors.E(op, errors.Str("should be 2 options. SEQ_ID and METHOD_LEN"))
	}
	r.Seq = uint64(opts[0])
	r.ServiceMethod = string(f.Payload()[:opts[1]])
	c.frame = f
	return c.storeCodec(r, f.ReadFlags())
}
func ( c * Codec ) ReadRequestHeader ( r * rpc . Request ) error { const op = errors . Op ( " " ) f := c . getFrame ( ) err := c . relay . Receive ( f ) if err != nil { return err } opts := f . ReadOptions ( f . Header ( ) ) if len ( opts ) != 2 { return errors . E ( op , errors . Str ( " " ) ) } r . Seq = uint64 ( opts [ 0 ] ) r . ServiceMethod = string ( f . Payload ( ) [ : opts [ 1 ] ] ) c . frame = f return c . storeCodec ( r , f . ReadFlags ( ) ) }
ReadRequestHeader receives frame with options
options should have 2 values
[0] - integer, sequence ID
[1] - integer, offset for method name
For example:
15Test.Payload
SEQ_ID: 15
METHOD_LEN: 12 and we take 12 bytes from the payload as method name
ReadRequestHeader receives frame with options options should have 2 values [ 0 ] - integer sequence ID [ 1 ] - integer offset for method name For example : 15Test . Payload SEQ_ID : 15 METHOD_LEN : 12 and we take 12 bytes from the payload as method name
// opts[0] sequence ID // opts[1] service method name offset from payload in bytes