code: func (r Resource) MarshalJSON() ([]byte, error) {
  	var ccResource struct {
  		Filename string `json:"fn,omitempty"`
  		Mode     string `json:"mode,omitempty"`
  		SHA1     string `json:"sha1"`
  		Size     int64  `json:"size"`
  	}
  
  	ccResource.Filename = r.Filename
  	ccResource.Size = r.Size
  	ccResource.SHA1 = r.SHA1
  	ccResource.Mode = strconv.FormatUint(uint64(r.Mode), 8)
  	return json.Marshal(ccResource)
  }
docs: // MarshalJSON converts a resource into a Cloud Controller Resource.