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