func GetReadResourceName(instance, hash string, size int64, fname string) (string, error) {
	rname := ""
	if instance != "" {
		rname += fmt.Sprintf("%s/", instance)
	}
	rname += fmt.Sprintf("%s/%s/%d", ResourceNameType, hash, size)
	if fname != "" {
		rname += fmt.Sprintf("/%s", fname)
	}
	if _, err := ParseReadResource(rname); err != nil {
		return "", err
	}
	return rname, nil
}
Return a valid read resource string based on individual components. Errors on invalid inputs.
package cas
import (
	"fmt"
	"strconv"
	"strings"
	uuid "github.com/nu7hatch/gouuid"
	remoteexecution "github.com/twitter/scoot/bazel/remoteexecution"
	"github.com/twitter/scoot/bazel"
)
type Resource struct {
	Instance string
	Digest   *remoteexecution.Digest
	UUID     uuid.UUID
}
func (r *Resource) String() string {
	return fmt.Sprintf("Instance: %s, Digest: %s, UUID: %s", r.Instance, r.Digest, r.UUID)
}