func StringRecord(value string) *Record {
	var slice []byte
	slicehdr := (*reflect.SliceHeader)(unsafe.Pointer(&slice))
	slicehdr.Data = ((*reflect.StringHeader)(unsafe.Pointer(&value))).Data
	slicehdr.Len = len(value)
	slicehdr.Cap = len(value)
	return &Record{Value: slice}
}
StringRecord returns a Record with the Value field set to the input value
string. For producing, this function is useful in tandem with the
client-level ProduceTopic option.

This function uses the 'unsafe' package to avoid copying value into a slice.

NOTE: It is NOT SAFE to modify the record's value. This function should only
be used if you only ever read record fields. This function can safely be used
for producing; the client never modifies a record's key nor value fields.
package kgo
import (
	"reflect"
	"time"
	"unsafe"
)
type RecordHeader struct {
	Key   string
	Value []byte
}
type RecordAttrs struct {
	attrs uint8
}
func (a RecordAttrs) TimestampType() int8 {
	if a.attrs&0b1000_0000 != 0 {
		return -1
	}
	return int8(a.attrs & 0b0000_1000)
}
func (a RecordAttrs) CompressionType() uint8 {
	return a.attrs & 0b0000_0111
}
func (a RecordAttrs) IsTransactional() bool {
	return a.attrs&0b0001_0000 != 0
}
func (a RecordAttrs) IsControl() bool {
	return a.attrs&0b0010_0000 != 0
}
type Record struct {
	Key []byte
	Value []byte
	Headers []RecordHeader
	Timestamp time.Time
	Topic string
	Partition int32
	Attrs RecordAttrs
	ProducerEpoch int16
	ProducerID int64
	LeaderEpoch int32
	Offset int64
}
func (r *Record) AppendFormat(b []byte, layout string) ([]byte, error) {
	f, err := NewRecordFormatter(layout)
	if err != nil {
		return b, err
	}
	return f.AppendRecord(b, r), nil
}