// Uint8 encodes uint8 data into an Attribute specified by typ.
556508
func (ae *AttributeEncoder) Uint8(typ uint16, v uint8) {
	if ae.err != nil {
		return
	}

	ae.attrs = append(ae.attrs, Attribute{
		Type: typ,
		Data: []byte{v},
	})
}
1344053
func (e Encoder) AppendUint8(dst []byte, val uint8) []byte {
	return e.AppendUint(dst, uint(val))
}
555063
func (k *Key) Uint() (uint, error) {
	u, e := strconv.ParseUint(k.String(), 0, 64)
	return uint(u), e
}
1072515
func (g *Group) Uint8() *Statement {
	// notest
	s := Uint8()
	g.items = append(g.items, s)
	return s
}
332492
func (Encoder) AppendUint8(dst []byte, val uint8) []byte {
	return strconv.AppendUint(dst, uint64(val), 10)
}
1264390
func (Encoder) AppendInt8(dst []byte, val int8) []byte {
	return strconv.AppendInt(dst, int64(val), 10)
}
39037
func writeUint8To(w io.Writer, v uint8, n *int64) error {
	nn, err := w.Write([]byte{v})
	*n += int64(nn)
	return err
}
880330
func (enc *Encoder) AddUint8Key(key string, v uint8) {
	enc.Uint64Key(key, uint64(v))
}
988487
func (ad *AttributeDecoder) Uint8() uint8 {
	if ad.err != nil {
		return 0
	}

	b := ad.data()
	if len(b) != 1 {
		ad.err = fmt.Errorf("netlink: attribute %d is not a uint8; length: %d", ad.Type(), len(b))
		return 0
	}

	return uint8(b[0])
}
161702
func (dec *Decoder) Uint8(v *uint8) error {
	err := dec.decodeUint8(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
948139
func (be *BinaryEncoder) WriteInt8(value int8) {
	be.buffer[be.pos] = byte(value)
	be.pos++
}
1212955
func (t Result) Uint() uint64 {
	switch t.Type {
	default:
		return 0
	case True:
		return 1
	case String:
		n, _ := parseUint(t.Str)
		return n
	case Number:
		// try to directly convert the float64 to uint64
		n, ok := floatToUint(t.Num)
		if !ok {
			// now try to parse the raw string
			n, ok = parseUint(t.Raw)
			if !ok {
				// fallback to a standard conversion
				return uint64(t.Num)
			}
		}
		return n
	}
}
480104
func TryToUint8(i interface{}) (r uint8, err error) {
	switch t := i.(type) {
	case nil:
		r = 0
	case uint:
		r = uint8(t)
	case uint8:
		r = t
	case *uint8:
		r = *t
	case uint16:
		r = uint8(t)
	case uint32:
		r = uint8(t)
	case uint64:
		r = uint8(t)
	case int:
		r = uint8(t)
	case int8:
		r = uint8(t)
	case int16:
		r = uint8(t)
	case int32:
		r = uint8(t)
	case int64:
		r = uint8(t)
	case float32:
		r = uint8(t)
	case float64:
		r = uint8(t)
	case bool:
		if t {
			r = 1
		}
	case string:
		var v uint64
		if v, err = strconv.ParseUint(t, 10, 8); err == nil {
			r = uint8(v)
		}
	default:
		err = castError(i, "uint8")
	}
	return
}
1324888
func Uint8Field(name string, value uint8) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeField(name, inTypeUint8, outTypeDefault, 0)
		ed.writeUint8(value)
	}
}
37002
func (ad *AttributeDecoder) Uint64() uint64 {
	if ad.err != nil {
		return 0
	}

	b := ad.data()
	if len(b) != 8 {
		ad.err = fmt.Errorf("netlink: attribute %d is not a uint64; length: %d", ad.Type(), len(b))
		return 0
	}

	return ad.ByteOrder.Uint64(b)
}
165632
func (p *parserMixin) Uint32() (target *uint32) {
	target = new(uint32)
	p.Uint32Var(target)
	return
}
796356
func (e *Event) Uint32(key string, i uint32) *Event {
	if e == nil {
		return e
	}
	e.buf = enc.AppendUint32(enc.AppendKey(e.buf, key), i)
	return e
}