func NewGroupMetadataKey() GroupMetadataKey {
	var v GroupMetadataKey
	v.Default()
	return v
}
NewGroupMetadataKey returns a default GroupMetadataKey
This is a shortcut for creating a struct and calling Default yourself.
package kmsg
import (
	"context"
	"fmt"
	"reflect"
	"strings"
	"github.com/twmb/franz-go/pkg/kmsg/internal/kbin"
)
const MaxKey = 67
type MessageV0 struct {
	Offset int64
	MessageSize int32
	CRC int32
	Magic int8
	Attributes int8
	Key []byte
	Value []byte
}
func (v *MessageV0) AppendTo(dst []byte) []byte {
	{
		v := v.Offset
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.MessageSize
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.CRC
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.Magic
		dst = kbin.AppendInt8(dst, v)
	}
	{
		v := v.Attributes
		dst = kbin.AppendInt8(dst, v)
	}
	{
		v := v.Key
		dst = kbin.AppendNullableBytes(dst, v)
	}
	{
		v := v.Value
		dst = kbin.AppendNullableBytes(dst, v)
	}
	return dst
}
func (v *MessageV0) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	s := v
	{
		v := b.Int64()
		s.Offset = v
	}
	{
		v := b.Int32()
		s.MessageSize = v
	}
	{
		v := b.Int32()
		s.CRC = v
	}
	{
		v := b.Int8()
		s.Magic = v
	}
	{
		v := b.Int8()
		s.Attributes = v
	}
	{
		v := b.NullableBytes()
		s.Key = v
	}
	{
		v := b.NullableBytes()
		s.Value = v
	}
	return b.Complete()
}
func (v *MessageV0) Default() {
}
func NewMessageV0() MessageV0 {
	var v MessageV0
	v.Default()
	return v
}
type MessageV1 struct {
	Offset int64
	MessageSize int32
	CRC int32
	Magic int8
	Attributes int8
	Timestamp int64
	Key []byte
	Value []byte
}
func (v *MessageV1) AppendTo(dst []byte) []byte {
	{
		v := v.Offset
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.MessageSize
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.CRC
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.Magic
		dst = kbin.AppendInt8(dst, v)
	}
	{
		v := v.Attributes
		dst = kbin.AppendInt8(dst, v)
	}
	{
		v := v.Timestamp
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.Key
		dst = kbin.AppendNullableBytes(dst, v)
	}
	{
		v := v.Value
		dst = kbin.AppendNullableBytes(dst, v)
	}
	return dst
}
func (v *MessageV1) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	s := v
	{
		v := b.Int64()
		s.Offset = v
	}
	{
		v := b.Int32()
		s.MessageSize = v
	}
	{
		v := b.Int32()
		s.CRC = v
	}
	{
		v := b.Int8()
		s.Magic = v
	}
	{
		v := b.Int8()
		s.Attributes = v
	}
	{
		v := b.Int64()
		s.Timestamp = v
	}
	{
		v := b.NullableBytes()
		s.Key = v
	}
	{
		v := b.NullableBytes()
		s.Value = v
	}
	return b.Complete()
}
func (v *MessageV1) Default() {
}
func NewMessageV1() MessageV1 {
	var v MessageV1
	v.Default()
	return v
}
type Header struct {
	Key string
	Value []byte
}
func (v *Header) AppendTo(dst []byte) []byte {
	{
		v := v.Key
		dst = kbin.AppendVarintString(dst, v)
	}
	{
		v := v.Value
		dst = kbin.AppendVarintBytes(dst, v)
	}
	return dst
}
func (v *Header) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	s := v
	{
		v := b.VarintString()
		s.Key = v
	}
	{
		v := b.VarintBytes()
		s.Value = v
	}
	return b.Complete()
}
func (v *Header) Default() {
}
func NewHeader() Header {
	var v Header
	v.Default()
	return v
}
type Record struct {
	Length int32
	Attributes int8
	TimestampDelta int32
	OffsetDelta int32
	Key []byte
	Value []byte
	Headers []Header
}
func (v *Record) AppendTo(dst []byte) []byte {
	{
		v := v.Length
		dst = kbin.AppendVarint(dst, v)
	}
	{
		v := v.Attributes
		dst = kbin.AppendInt8(dst, v)
	}
	{
		v := v.TimestampDelta
		dst = kbin.AppendVarint(dst, v)
	}
	{
		v := v.OffsetDelta
		dst = kbin.AppendVarint(dst, v)
	}
	{
		v := v.Key
		dst = kbin.AppendVarintBytes(dst, v)
	}
	{
		v := v.Value
		dst = kbin.AppendVarintBytes(dst, v)
	}
	{
		v := v.Headers
		dst = kbin.AppendVarint(dst, int32(len(v)))
		for i := range v {
			v := &v[i]
			{
				v := v.Key
				dst = kbin.AppendVarintString(dst, v)
			}
			{
				v := v.Value
				dst = kbin.AppendVarintBytes(dst, v)
			}
		}
	}
	return dst
}
func (v *Record) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	s := v
	{
		v := b.Varint()
		s.Length = v
	}
	{
		v := b.Int8()
		s.Attributes = v
	}
	{
		v := b.Varint()
		s.TimestampDelta = v
	}
	{
		v := b.Varint()
		s.OffsetDelta = v
	}
	{
		v := b.VarintBytes()
		s.Key = v
	}
	{
		v := b.VarintBytes()
		s.Value = v
	}
	{
		v := s.Headers
		a := v
		var l int32
		l = b.VarintArrayLen()
		if !b.Ok() {
			return b.Complete()
		}
		if l > 0 {
			a = make([]Header, l)
		}
		for i := int32(0); i < l; i++ {
			v := &a[i]
			v.Default()
			s := v
			{
				v := b.VarintString()
				s.Key = v
			}
			{
				v := b.VarintBytes()
				s.Value = v
			}
		}
		v = a
		s.Headers = v
	}
	return b.Complete()
}
func (v *Record) Default() {
}
func NewRecord() Record {
	var v Record
	v.Default()
	return v
}
type RecordBatch struct {
	FirstOffset int64
	Length int32
	PartitionLeaderEpoch int32
	Magic int8
	CRC int32
	Attributes int16
	LastOffsetDelta int32
	FirstTimestamp int64
	MaxTimestamp int64
	ProducerID int64
	ProducerEpoch int16
	FirstSequence int32
	NumRecords int32
	Records []byte
}
func (v *RecordBatch) AppendTo(dst []byte) []byte {
	{
		v := v.FirstOffset
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.Length
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.PartitionLeaderEpoch
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.Magic
		dst = kbin.AppendInt8(dst, v)
	}
	{
		v := v.CRC
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.Attributes
		dst = kbin.AppendInt16(dst, v)
	}
	{
		v := v.LastOffsetDelta
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.FirstTimestamp
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.MaxTimestamp
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.ProducerID
		dst = kbin.AppendInt64(dst, v)
	}
	{
		v := v.ProducerEpoch
		dst = kbin.AppendInt16(dst, v)
	}
	{
		v := v.FirstSequence
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.NumRecords
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.Records
		dst = append(dst, v...)
	}
	return dst
}
func (v *RecordBatch) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	s := v
	{
		v := b.Int64()
		s.FirstOffset = v
	}
	{
		v := b.Int32()
		s.Length = v
	}
	{
		v := b.Int32()
		s.PartitionLeaderEpoch = v
	}
	{
		v := b.Int8()
		s.Magic = v
	}
	{
		v := b.Int32()
		s.CRC = v
	}
	{
		v := b.Int16()
		s.Attributes = v
	}
	{
		v := b.Int32()
		s.LastOffsetDelta = v
	}
	{
		v := b.Int64()
		s.FirstTimestamp = v
	}
	{
		v := b.Int64()
		s.MaxTimestamp = v
	}
	{
		v := b.Int64()
		s.ProducerID = v
	}
	{
		v := b.Int16()
		s.ProducerEpoch = v
	}
	{
		v := b.Int32()
		s.FirstSequence = v
	}
	{
		v := b.Int32()
		s.NumRecords = v
	}
	{
		v := b.Span(int(s.Length) - 49)
		s.Records = v
	}
	return b.Complete()
}
func (v *RecordBatch) Default() {
}
func NewRecordBatch() RecordBatch {
	var v RecordBatch
	v.Default()
	return v
}
type OffsetCommitKey struct {
	Version int16
	Group string
	Topic string
	Partition int32
}
func (v *OffsetCommitKey) AppendTo(dst []byte) []byte {
	version := v.Version
	_ = version
	{
		v := v.Version
		dst = kbin.AppendInt16(dst, v)
	}
	{
		v := v.Group
		dst = kbin.AppendString(dst, v)
	}
	{
		v := v.Topic
		dst = kbin.AppendString(dst, v)
	}
	{
		v := v.Partition
		dst = kbin.AppendInt32(dst, v)
	}
	return dst
}
func (v *OffsetCommitKey) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	v.Version = b.Int16()
	version := v.Version
	_ = version
	s := v
	{
		v := b.String()
		s.Group = v
	}
	{
		v := b.String()
		s.Topic = v
	}
	{
		v := b.Int32()
		s.Partition = v
	}
	return b.Complete()
}
func (v *OffsetCommitKey) Default() {
}
func NewOffsetCommitKey() OffsetCommitKey {
	var v OffsetCommitKey
	v.Default()
	return v
}
type OffsetCommitValue struct {
	Version int16
	Offset int64
	LeaderEpoch int32  
	Metadata string
	CommitTimestamp int64
	ExpireTimestamp int64  
}
func (v *OffsetCommitValue) AppendTo(dst []byte) []byte {
	version := v.Version
	_ = version
	{
		v := v.Version
		dst = kbin.AppendInt16(dst, v)
	}
	{
		v := v.Offset
		dst = kbin.AppendInt64(dst, v)
	}
	if version >= 3 {
		v := v.LeaderEpoch
		dst = kbin.AppendInt32(dst, v)
	}
	{
		v := v.Metadata
		dst = kbin.AppendString(dst, v)
	}
	{
		v := v.CommitTimestamp
		dst = kbin.AppendInt64(dst, v)
	}
	if version >= 1 && version <= 1 {
		v := v.ExpireTimestamp
		dst = kbin.AppendInt64(dst, v)
	}
	return dst
}
func (v *OffsetCommitValue) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	v.Version = b.Int16()
	version := v.Version
	_ = version
	s := v
	{
		v := b.Int64()
		s.Offset = v
	}
	if version >= 3 {
		v := b.Int32()
		s.LeaderEpoch = v
	}
	{
		v := b.String()
		s.Metadata = v
	}
	{
		v := b.Int64()
		s.CommitTimestamp = v
	}
	if version >= 1 && version <= 1 {
		v := b.Int64()
		s.ExpireTimestamp = v
	}
	return b.Complete()
}
func (v *OffsetCommitValue) Default() {
}
func NewOffsetCommitValue() OffsetCommitValue {
	var v OffsetCommitValue
	v.Default()
	return v
}
type GroupMetadataKey struct {
	Version int16
	Group string
}
func (v *GroupMetadataKey) AppendTo(dst []byte) []byte {
	version := v.Version
	_ = version
	{
		v := v.Version
		dst = kbin.AppendInt16(dst, v)
	}
	{
		v := v.Group
		dst = kbin.AppendString(dst, v)
	}
	return dst
}
func (v *GroupMetadataKey) ReadFrom(src []byte) error {
	v.Default()
	b := kbin.Reader{Src: src}
	v.Version = b.Int16()
	version := v.Version
	_ = version
	s := v
	{
		v := b.String()
		s.Group = v
	}
	return b.Complete()
}
func (v *GroupMetadataKey) Default() {
}