Documentation ¶
Index ¶
- Variables
- type Partition
- func (p Partition) Check() validation.ErrorGroup
- func (p Partition) Equals(v any) bool
- func (Partition) Generate(rand *rand.Rand, size int) reflect.Value
- func (p Partition) MarshalBinary() (data []byte, err error)
- func (p Partition) MarshalBinaryWriter(w io.Writer) (err error)
- func (p Partition) MarshalJSON() (data []byte, err error)
- func (p Partition) String() string
- func (p *Partition) UnmarshalBinary(data []byte) (err error)
- func (p *Partition) UnmarshalBinaryReader(r io.Reader) (err error)
- func (p *Partition) UnmarshalJSON(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrMustBePositive = validation.NewError(
"partition_must_be_positive",
"the partition value must be a positive number",
)
ErrMustBePositive is the validation check error returned when the partition is a negative number.
Functions ¶
This section is empty.
Types ¶
type Partition ¶
type Partition int32
Partition represents the partition of a topic.
func New ¶
func New(v int32) (Partition, validation.ErrorGroup)
New creates and validates a new Partition from the given int32.
func (Partition) Check ¶
func (p Partition) Check() validation.ErrorGroup
Check runs default validation checks for the Partition.
func (Partition) Equals ¶
Equals compares two Partition instances for equality.
Interface: comparison.Equaler
func (Partition) MarshalBinary ¶
MarshalBinary converts the Partition instance to binary form.
Interface: encoding.BinaryMarshaler
func (Partition) MarshalBinaryWriter ¶
MarshalBinaryWriter populates the io.Writer with Partition data in its binary form.
func (Partition) MarshalJSON ¶
MarshalJSON converts the Partition instance to JSON form.
Interface: json.Marshaler
func (*Partition) UnmarshalBinary ¶
UnmarshalBinary converts the binary form to a Partition instance.
Interface: encoding.BinaryUnmarshaler
func (*Partition) UnmarshalBinaryReader ¶
UnmarshalBinaryReader populates Partition from an io.Reader returning the binary form.
func (*Partition) UnmarshalJSON ¶
UnmarshalJSON converts the JSON form to a Partition instance.
Interface: json.Unmarshal