func (g *Getter) IsInt8(name string) bool {
	return g.is(name, reflect.Int8)
}
IsInt8 reports whether type of the original struct field named name is int8.
package structil
import (
	"fmt"
	"reflect"
	"unsafe"
	"github.com/goldeneggg/structil/util"
)
type Getter struct {
	rv     reflect.Value             
	numf   int                       
	names  []string                  
	hases  map[string]bool           
	types  map[string]reflect.Type   
	values map[string]reflect.Value  
	intfs  map[string]interface{}    
	cached map[string]bool
}
func NewGetter(i interface{}) (*Getter, error) {
	rv := reflect.ValueOf(i)
	kind := rv.Kind()
	if kind != reflect.Ptr && kind != reflect.Struct {
		return nil, fmt.Errorf("%+v is not supported kind: %v. value: %+v", i, kind, rv)
	}
	if kind == reflect.Ptr {
		rv = reflect.Indirect(rv)
	}
	if !rv.IsValid() {
		return nil, fmt.Errorf("%+v is invalid argument. value: %+v", i, rv)
	}
	numf := rv.NumField()
	return &Getter{
		rv:     rv,
		numf:   numf,
		names:  make([]string, 0, numf),
		hases:  map[string]bool{},
		values: map[string]reflect.Value{},
		types:  map[string]reflect.Type{},
		intfs:  map[string]interface{}{},
		cached: map[string]bool{},
	}, nil
}
func (g *Getter) NumField() int {
	return g.numf
}
func (g *Getter) Has(name string) bool {
	if _, ok := g.cached[name]; !ok {
		g.cache(name)
	}
	return g.hases[name]
}
func (g *Getter) cache(name string) {
	frv := g.rv.FieldByName(name)
	if frv.IsValid() {
		g.types[name] = frv.Type()
		g.hases[name] = true
	} else {
		g.types[name] = nil
		g.hases[name] = false
	}
	frv = reflect.Indirect(frv)
	g.values[name] = frv
	g.intfs[name] = util.ToI(frv)
	g.cached[name] = true
}
func (g *Getter) Names() []string {
	if g.numf > 0 && len(g.names) == 0 {
		var sf reflect.StructField
		for i := 0; i < g.numf; i++ {
			sf = g.rv.Type().Field(i)
			g.names = append(g.names, sf.Name)
		}
	}
	return g.names
}
func (g *Getter) GetType(name string) (reflect.Type, bool) {
	if _, ok := g.cached[name]; !ok {
		g.cache(name)
	}
	return g.types[name], g.hases[name]
}
func (g *Getter) GetValue(name string) (reflect.Value, bool) {
	if _, ok := g.cached[name]; !ok {
		g.cache(name)
	}
	return g.values[name], g.hases[name]
}
func (g *Getter) Get(name string) (interface{}, bool) {
	if _, ok := g.cached[name]; !ok {
		g.cache(name)
	}
	return g.intfs[name], g.hases[name]
}
func (g *Getter) Bool(name string) (bool, bool) {
	v, has := g.Get(name)
	if !has {
		return false, has
	}
	res, ok := v.(bool)
	return res, ok
}
func (g *Getter) Byte(name string) (byte, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(byte)
	return res, ok
}
func (g *Getter) Bytes(name string) ([]byte, bool) {
	v, has := g.Get(name)
	if !has {
		return nil, has
	}
	res, ok := v.([]byte)
	return res, ok
}
func (g *Getter) String(name string) (string, bool) {
	v, has := g.Get(name)
	if !has {
		return "", has
	}
	res, ok := v.(string)
	return res, ok
}
func (g *Getter) Int(name string) (int, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(int)
	return res, ok
}
func (g *Getter) Int8(name string) (int8, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(int8)
	return res, ok
}
func (g *Getter) Int16(name string) (int16, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(int16)
	return res, ok
}
func (g *Getter) Int32(name string) (int32, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(int32)
	return res, ok
}
func (g *Getter) Int64(name string) (int64, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(int64)
	return res, ok
}
func (g *Getter) Uint(name string) (uint, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(uint)
	return res, ok
}
func (g *Getter) Uint8(name string) (uint8, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(uint8)
	return res, ok
}
func (g *Getter) Uint16(name string) (uint16, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(uint16)
	return res, ok
}
func (g *Getter) Uint32(name string) (uint32, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(uint32)
	return res, ok
}
func (g *Getter) Uint64(name string) (uint64, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(uint64)
	return res, ok
}
func (g *Getter) Uintptr(name string) (uintptr, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(uintptr)
	return res, ok
}
func (g *Getter) Float32(name string) (float32, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(float32)
	return res, ok
}
func (g *Getter) Float64(name string) (float64, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(float64)
	return res, ok
}
func (g *Getter) Complex64(name string) (complex64, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(complex64)
	return res, ok
}
func (g *Getter) Complex128(name string) (complex128, bool) {
	v, has := g.Get(name)
	if !has {
		return 0, has
	}
	res, ok := v.(complex128)
	return res, ok
}
func (g *Getter) UnsafePointer(name string) (unsafe.Pointer, bool) {
	v, has := g.Get(name)
	if !has {
		return nil, has
	}
	res, ok := v.(unsafe.Pointer)
	return res, ok
}
func (g *Getter) IsByte(name string) bool {
	return g.is(name, reflect.Uint8)
}
func (g *Getter) IsBytes(name string) bool {
	if g.IsSlice(name) {
		t, ok := g.GetType(name)
		if ok && t.Elem().Kind() == reflect.Uint8 {
			return true
		}
	}
	return false
}
func (g *Getter) IsString(name string) bool {
	return g.is(name, reflect.String)
}
func (g *Getter) IsInt(name string) bool {
	return g.is(name, reflect.Int)
}