func (resc *Resource) FetchInfo() (map[string]string, error) {
	var (
		result C.goRodsStringResult_t
		err    *C.char
	)
	result.size = C.int(0)
	cResource := C.CString(resc.name)
	defer C.free(unsafe.Pointer(cResource))
	ccon := resc.con.GetCcon()
	if status := C.gorods_get_resource(cResource, ccon, &result, &err); status != 0 {
		resc.con.ReturnCcon(ccon)
		return nil, newError(Fatal, status, fmt.Sprintf("iRODS Get Resource Info Failed: %v", C.GoString(err)))
	}
	resc.con.ReturnCcon(ccon)
	defer C.gorods_free_string_result(&result)
	unsafeArr := unsafe.Pointer(result.strArr)
	arrLen := int(result.size)
	slice := (*[1 << 30]*C.char)(unsafeArr)[:arrLen:arrLen]
	response := make(map[string]string)
	for _, resourceInfo := range slice {
		resourceAttributes := strings.Split(strings.Trim(C.GoString(resourceInfo), " \n"), "\n")
		for _, attr := range resourceAttributes {
			split := strings.Split(attr, ": ")
			attrName := split[0]
			attrVal := split[1]
			response[attrName] = attrVal
		}
	}
	return response, nil
}
FetchInfo fetches fresh resource info from the iCAT server and returns it as a map
package gorods
import "C"
import (
	"fmt"
	"strconv"
	"strings"
	"time"
	"unsafe"
)
type Resource struct {
	name string
	typ           int
	comment       string
	createTime    time.Time
	modifyTime    time.Time
	id            int
	context       string
	zone          *Zone
	class         int
	children      string
	freeSpace     int
	info          string
	status        string
	parentStr     string
	net           string
	freeSpaceTime time.Time
	objCount      int
	storageType   string
	physPath      string
	parentSlice *Resources
	hasInit     bool
	con *Connection
}
type Resources []*Resource
func (rescs Resources) FindByName(name string) *Resource {
	for _, resc := range rescs {
		if resc.name == name {
			return resc
		}
	}
	return nil
}
func (rescs *Resources) Remove(index int) {
	*rescs = append((*rescs)[:index], (*rescs)[index+1:]...)
}
func initResource(name string, con *Connection) (*Resource, error) {
	resc := new(Resource)
	zne, er := con.LocalZone()
	if er != nil {
		return nil, er
	}
	resc.con = con
	resc.name = name
	resc.zone = zne
	return resc, nil
}
func (resc *Resource) init() error {
	if !resc.hasInit {
		if err := resc.RefreshInfo(); err != nil {
			return err
		}
		resc.hasInit = true
	}
	return nil
}
func (resc *Resource) Remove() bool {
	for n, p := range *resc.parentSlice {
		if p.name == resc.name {
			resc.parentSlice.Remove(n)
			return true
		}
	}
	return false
}
func (resc *Resource) String() string {
	return fmt.Sprintf("%v#%v", resc.Name(), resc.Zone().Name())
}
func (resc *Resource) Name() string {
	return resc.name
}
func (resc *Resource) Comment() (string, error) {
	if err := resc.init(); err != nil {
		return resc.comment, err
	}
	return resc.comment, nil
}
func (resc *Resource) CreateTime() (time.Time, error) {
	if err := resc.init(); err != nil {
		return resc.createTime, err
	}
	return resc.createTime, nil
}
func (resc *Resource) ModifyTime() (time.Time, error) {
	if err := resc.init(); err != nil {
		return resc.modifyTime, err
	}
	return resc.modifyTime, nil
}
func (resc *Resource) Id() (int, error) {
	if err := resc.init(); err != nil {
		return resc.id, err
	}
	return resc.id, nil
}
func (resc *Resource) Type() (int, error) {
	if err := resc.init(); err != nil {
		return resc.typ, err
	}
	return resc.typ, nil
}
func (resc *Resource) Context() (string, error) {
	if err := resc.init(); err != nil {
		return resc.context, err
	}
	return resc.context, nil
}
func (resc *Resource) Class() (int, error) {
	if err := resc.init(); err != nil {
		return resc.class, err
	}
	return resc.class, nil
}
func (resc *Resource) Children() (string, error) {
	if err := resc.init(); err != nil {
		return resc.children, err
	}
	return resc.children, nil
}
func (resc *Resource) FreeSpace() (int, error) {
	if err := resc.init(); err != nil {
		return resc.freeSpace, err
	}
	return resc.freeSpace, nil
}
func (resc *Resource) Info() (string, error) {
	if err := resc.init(); err != nil {
		return resc.info, err
	}
	return resc.info, nil
}
func (resc *Resource) Status() (string, error) {
	if err := resc.init(); err != nil {
		return resc.status, err
	}
	return resc.status, nil
}
func (resc *Resource) ParentStr() (string, error) {
	if err := resc.init(); err != nil {
		return resc.parentStr, err
	}
	return resc.parentStr, nil
}
func (resc *Resource) Net() (string, error) {
	if err := resc.init(); err != nil {
		return resc.net, err
	}
	return resc.net, nil
}
func (resc *Resource) FreeSpaceTime() (time.Time, error) {
	if err := resc.init(); err != nil {
		return resc.freeSpaceTime, err
	}
	return resc.freeSpaceTime, nil
}
func (resc *Resource) ObjCount() (int, error) {
	if err := resc.init(); err != nil {
		return resc.objCount, err
	}
	return resc.objCount, nil
}
func (resc *Resource) StorageType() (string, error) {
	if err := resc.init(); err != nil {
		return resc.storageType, err
	}
	return resc.storageType, nil
}
func (resc *Resource) PhysPath() (string, error) {
	if err := resc.init(); err != nil {
		return resc.physPath, err
	}
	return resc.physPath, nil
}
func (resc *Resource) Zone() *Zone {
	return resc.zone
}
func (resc *Resource) RefreshInfo() error {
	typeMap := map[string]int{
		"cache":   Cache,
		"archive": Archive,
	}
	if infoMap, err := resc.FetchInfo(); err == nil {
		resc.comment = infoMap["r_comment"]
		resc.createTime = timeStringToTime(infoMap["create_ts"])
		resc.modifyTime = timeStringToTime(infoMap["modify_ts"])
		resc.id, _ = strconv.Atoi(infoMap["resc_id"])
		resc.typ = ResourceType
		resc.context = infoMap["resc_context"]
		resc.class = typeMap[infoMap["resc_class_name"]]
		resc.children = infoMap["resc_children"]
		resc.freeSpace, _ = strconv.Atoi(infoMap["free_space"])
		resc.info = infoMap["resc_info"]
		resc.status = infoMap["resc_status"]
		resc.parentStr = infoMap["resc_parent"]
		resc.net = infoMap["resc_net"]
		resc.freeSpaceTime = timeStringToTime(infoMap["free_space_ts"])
		resc.objCount, _ = strconv.Atoi(infoMap["resc_objcount"])
		resc.storageType = infoMap["resc_type_name"]
		resc.physPath = infoMap["resc_def_path"]
		if zones, err := resc.con.Zones(); err != nil {
			return err
		} else {
			if zne := zones.FindByName(infoMap["zone_name"], resc.con); zne != nil {
				resc.zone = zne
			} else {
				return newError(Fatal, -1, fmt.Sprintf("iRODS Refresh Resource Info Failed: Unable to locate zone in cache"))
			}
		}
	} else {
		return err
	}
	return nil
}