Documentation ¶
Index ¶
- Variables
- type Topic
- func (t Topic) Check() validation.ErrorGroup
- func (t Topic) Equals(v any) bool
- func (Topic) Generate(rand *rand.Rand, size int) reflect.Value
- func (t Topic) MarshalBinary() (data []byte, err error)
- func (t Topic) MarshalBinaryWriter(w io.Writer) (err error)
- func (t Topic) MarshalJSON() (data []byte, err error)
- func (t Topic) String() string
- func (t *Topic) UnmarshalBinary(data []byte) (err error)
- func (t *Topic) UnmarshalBinaryReader(r io.Reader) (err error)
- func (t *Topic) UnmarshalJSON(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrMustMatchPattern = validation.NewError( "topic_must_match_pattern", fmt.Sprintf("the topic value must match the following pattern: %s", pattern), )
ErrMustMatchPattern is the validation check error returned when the topic doesn't match length or character requirements.
Functions ¶
This section is empty.
Types ¶
type Topic ¶
type Topic string
Topic represents a kafka topic.
func New ¶
func New(s string) (Topic, validation.ErrorGroup)
New creates and validates a new Topic from the given string.
func (Topic) Check ¶
func (t Topic) Check() validation.ErrorGroup
Check runs default validation checks for the Topic.
func (Topic) Equals ¶
Equals compares two Topic instances for equality.
Interface: comparison.Equaler
func (Topic) MarshalBinary ¶
MarshalBinary converts the Topic instance to binary form.
Interface: encoding.BinaryMarshaler
func (Topic) MarshalBinaryWriter ¶
MarshalBinaryWriter populates the io.Writer with Topic data in its binary form.
func (Topic) MarshalJSON ¶
MarshalJSON converts the Topic instance to JSON form.
Interface: json.Marshaler
func (*Topic) UnmarshalBinary ¶
UnmarshalBinary converts the binary form to a Topic instance.
Interface: encoding.BinaryUnmarshaler
func (*Topic) UnmarshalBinaryReader ¶
UnmarshalBinaryReader populates Topic from an io.Reader returning the binary form.
func (*Topic) UnmarshalJSON ¶
UnmarshalJSON converts the JSON form to a Topic instance.
Interface: json.Unmarshal