partition

package
v0.0.0-...-a26ebea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Generate

func Generate(rand *rand.Rand) Partition

Generate a random Partition value.

func New

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

func (p Partition) Equals(v any) bool

Equals compares two Partition instances for equality.

Interface: comparison.Equaler

func (Partition) Generate

func (Partition) Generate(rand *rand.Rand, size int) reflect.Value

Generate random Partition values.

Interface: quick.Generator

func (Partition) MarshalBinary

func (p Partition) MarshalBinary() (data []byte, err error)

MarshalBinary converts the Partition instance to binary form.

Interface: encoding.BinaryMarshaler

func (Partition) MarshalBinaryWriter

func (p Partition) MarshalBinaryWriter(w io.Writer) (err error)

MarshalBinaryWriter populates the io.Writer with Partition data in its binary form.

func (Partition) MarshalJSON

func (p Partition) MarshalJSON() (data []byte, err error)

MarshalJSON converts the Partition instance to JSON form.

Interface: json.Marshaler

func (Partition) String

func (p Partition) String() string

String value of the Partition.

Interface: fmt.Stringer.

func (*Partition) UnmarshalBinary

func (p *Partition) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts the binary form to a Partition instance.

Interface: encoding.BinaryUnmarshaler

func (*Partition) UnmarshalBinaryReader

func (p *Partition) UnmarshalBinaryReader(r io.Reader) (err error)

UnmarshalBinaryReader populates Partition from an io.Reader returning the binary form.

func (*Partition) UnmarshalJSON

func (p *Partition) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON converts the JSON form to a Partition instance.

Interface: json.Unmarshal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL