// UnmarshalText implements encoding.TextUnmarshaler
338642
func (f *Framing) UnmarshalText(data []byte) (err error) {
	s := string(data)
	switch strings.ToUpper(s) {
	case `OCTET-COUNTING`:
		fallthrough
	case `"OCTET-COUNTING"`:
		fallthrough
	case `'OCTET-COUNTING'`:
		*f = OctetCounting
		return

	case `NON-TRANSPARENT`:
		fallthrough
	case `"NON-TRANSPARENT"`:
		fallthrough
	case `'NON-TRANSPARENT'`:
		*f = NonTransparent
		return
	}
	*f = -1
	return fmt.Errorf("unknown framing")
}
301472
func (t *Time) UnmarshalText(data []byte) (err error) {
	tt, err := time.Parse(DeisDatetimeFormat, string(data))
	*t = Time{tt}
	return
}
1013360
func (eui *AppEUI) UnmarshalText(data []byte) error {
	e := EUI64(*eui)
	err := e.UnmarshalText(data)
	if err != nil {
		return err
	}
	*eui = AppEUI(e)
	return nil
}
694468
func (n *NetID) UnmarshalText(data []byte) error {
	parsed, err := ParseHEX(string(data), 3)
	if err != nil {
		return err
	}
	copy(n[:], parsed[:])
	return nil
}
1207790
func (bs *Buckets) UnmarshalText(value []byte) error {
	if len(value) < 2 || value[0] != '[' || value[len(value)-1] != ']' {
		return fmt.Errorf("bad buckets: %s", value)
	}
	for _, v := range strings.Split(string(value[1:len(value)-1]), ",") {
		d, err := time.ParseDuration(strings.TrimSpace(v))
		if err != nil {
			return err
		}
		*bs = append(*bs, d)
	}
	if len(*bs) == 0 {
		return fmt.Errorf("bad buckets: %s", value)
	}
	return nil
}
973210
func (id *ResourceID) UnmarshalText(text []byte) error {
	result, err := ParseResourceID(string(text))
	if err != nil {
		return err
	}
	*id = result
	return nil
}
829935
func (c *Constraint) UnmarshalText(text []byte) error {
	constraint, err := NewConstraint(string(text))
	if err != nil {
		return err
	}
	c.Key = constraint.Key
	c.MustMatch = constraint.MustMatch
	c.Regex = constraint.Regex
	return nil
}
158165
func (level *Level) UnmarshalText(text []byte) error {
	l, err := ParseLevel(string(text))
	if err != nil {
		return err
	}

	*level = Level(l)

	return nil
}
551245
func (u *UUID) UnmarshalText(text []byte) (err error) {
	if len(text) < 32 {
		err = fmt.Errorf("uuid: UUID string too short: %s", text)
		return
	}

	t := text[:]

	if bytes.Equal(t[:9], urnPrefix) {
		t = t[9:]
	} else if t[0] == '{' {
		t = t[1:]
	}

	b := u[:]

	for _, byteGroup := range byteGroups {
		if t[0] == '-' {
			t = t[1:]
		}

		if len(t) < byteGroup {
			err = fmt.Errorf("uuid: UUID string too short: %s", text)
			return
		}

		_, err = hex.Decode(b[:byteGroup/2], t[:byteGroup])

		if err != nil {
			return
		}

		t = t[byteGroup:]
		b = b[byteGroup/2:]
	}

	return
}
910450
func (b *Compatibool) UnmarshalText(t []byte) error {
	if bytes.Equal(t, []byte("1")) {
		*b = Compatibool(true)
	}
	return nil
}
759295
func (id *ULID) UnmarshalText(v []byte) error {
	return parse(v, false, id)
}
535178
func (b *Bloom) UnmarshalText(input []byte) error {
	return hexutil.UnmarshalFixedText("Bloom", input, b[:])
}
154898
func (a *Accelerator) UnmarshalText(b []byte) error {
	*a = strings.Split(string(b), acceleratorSeparator)
	return nil
}
455603
func (h *Hash) UnmarshalText(data []byte) error {
	newH, err := HashFromString(string(data))
	if err != nil {
		return err
	}
	*h = newH
	return nil
}
1004449
func (l *Level) UnmarshalText(text []byte) (err error) {
	if bytes.Equal(text, levelBytesDebug) {
		*l = LevelDebug
	} else if bytes.Equal(text, levelBytesInfo) {
		*l = LevelInfo
	} else if bytes.Equal(text, levelBytesWarn) {
		*l = LevelWarn
	} else if bytes.Equal(text, levelBytesError) {
		*l = LevelError
	} else if bytes.Equal(text, levelBytesFatal) {
		*l = LevelFatal
	} else {
		err = fmt.Errorf("Uknown level %v", string(text))
	}
	return
}
898573
func (d *Duration) UnmarshalText(text []byte) error {
	return d.Set(string(text))
}
994040
func (p *PHYPayload) UnmarshalText(text []byte) error {
	b, err := base64.StdEncoding.DecodeString(string(text))
	if err != nil {
		return err
	}
	return p.UnmarshalBinary(b)
}