NewControlBatch constructs a control batch from the list of records passed as arguments.
(records ...ControlRecord)
| 247 | // NewControlBatch constructs a control batch from the list of records passed as |
| 248 | // arguments. |
| 249 | func NewControlBatch(records ...ControlRecord) *ControlBatch { |
| 250 | rawRecords := make([]Record, len(records)) |
| 251 | for i, cr := range records { |
| 252 | rawRecords[i] = cr.Record() |
| 253 | } |
| 254 | return &ControlBatch{ |
| 255 | Records: NewRecordReader(rawRecords...), |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | func (c *ControlBatch) ReadRecord() (*Record, error) { |
| 260 | return c.Records.ReadRecord() |