receiver/kafka/kafka.go
func (o *Offset) UnmarshalText(text []byte) error {
	offsetName := string(text)

	switch strings.ToLower(offsetName) {
	case "newest":
		*o = OffsetNewest
	case "oldest":
		*o = OffsetOldest
	default:
		d, err := time.ParseDuration(offsetName)
		if err != nil {
			return err
		}
		*o = Offset(time.Now().Add(d).UnixNano())
	}
	return nil
}
func (o *Offset) UnmarshalText(text []byte) error {
	offsetName := string(text)

	switch strings.ToLower(offsetName) {
	case "newest":
		*o = OffsetNewest
	case "oldest":
		*o = OffsetOldest
	default:
		d, err := time.ParseDuration(offsetName)
		if err != nil {
			return err
		}
		*o = Offset(time.Now().Add(d).UnixNano())
	}
	return nil
}
// UnmarshalText unmarshals text to offset. It handles "newest" and "oldest", oterwise fallbacks to time.ParseDuration.