func BasicConsistentPartitioner(partition func(string) func(r *Record, n int) int) Partitioner {
	return &basicPartitioner{partition}
}
BasicConsistentPartitioner wraps a single function to provide a Partitioner
and TopicPartitioner (that function is essentially a combination of
Partitioner.ForTopic and TopicPartitioner.Partition).

As a minimal example, if you do not care about the topic and you set the
partition before producing:

kgo.BasicConsistentPartitioner(func(topic) func(*Record, int) int {
return func(r *Record, n int) int {
return int(r.Partition)
}
})
package kgo
import (
	"math"
	"math/rand"
	"sync/atomic"
	"time"
)
type Partitioner interface {
	ForTopic(string) TopicPartitioner
}
type TopicPartitioner interface {
	RequiresConsistency(*Record) bool
	Partition(r *Record, n int) int
}
type TopicPartitionerOnNewBatch interface {
	OnNewBatch()
}
type TopicBackupPartitioner interface {
	TopicPartitioner
	PartitionByBackup(r *Record, n int, backupIter TopicBackupIter) int
}
type TopicBackupIter interface {
	Next() (int, int64)
	Rem() int
}
type leastBackupInput struct {
	mapping []*topicPartition
}
func (i *leastBackupInput) Next() (int, int64) {
	last := len(i.mapping) - 1
	buffered := atomic.LoadInt64(&i.mapping[last].records.buffered)
	i.mapping = i.mapping[:last]
	return last, buffered
}
func (i *leastBackupInput) Rem() int {
	return len(i.mapping)
}