Documentation ¶
Index ¶
- Variables
- type Header
- func (h Header) Check() validation.ErrorGroup
- func (h Header) Equals(v any) bool
- func (Header) Generate(rand *rand.Rand, size int) reflect.Value
- func (h Header) MarshalBinary() (data []byte, err error)
- func (h Header) MarshalBinaryWriter(w io.Writer) (err error)
- func (h Header) String() string
- func (h *Header) UnmarshalBinary(data []byte) (err error)
- func (h *Header) UnmarshalBinaryReader(r io.Reader) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyMustBeSet = validation.NewError(
"header_key_must_be_set",
"the header key must be set and cannot be an empty string",
)
ErrKeyMustBeSet is the validation check error returned when the header key is an empty string.
Functions ¶
This section is empty.
Types ¶
type Header ¶
Header represents the key/value pair for a Kafka message.
func New ¶
func New(key string, val []byte) (Header, validation.ErrorGroup)
New creates and validates a new Header from the given key/val.
func (Header) Check ¶
func (h Header) Check() validation.ErrorGroup
Check runs default validation checks for the Header.
func (Header) Equals ¶
Equals compares two Header instances for equality.
Interface: comparison.Equaler
func (Header) MarshalBinary ¶
MarshalBinary converts the Header instance to binary form.
Interface: encoding.BinaryMarshaler
func (Header) MarshalBinaryWriter ¶
MarshalBinaryWriter populates the io.Writer with Header data in its binary form.
func (*Header) UnmarshalBinary ¶
UnmarshalBinary converts the binary form to a Header instance.
Interface: encoding.BinaryUnmarshaler
Click to show internal directories.
Click to hide internal directories.