Package digestfs provides a content-addressable virtual file system (VFS) by providing a common interface to one or more content-addressable storage (CAS).
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-digestfs
Here is an example of how to use an already mounted digestfs.MountPoint
to get content:
content, err := mountpoint.Open("SHA-256.hexadecimal", "c0535e4be2b79ffd93291305436bf889314e4a3faec05ecffcbb7df31ad9e51a")
if nil != err {
return err
}
defer content.Close()
Note that if you had the digest encoded as binary, then you could encode it as hexadecimal using: As in:
digest := fmt.Sprintf("%x", binaryDigest)
A content-addressable file system, or content-addressable storage (CAS) may be used with content addressing.
Some examples of content addressing include:
-
MAGNET v0.1 (Draft Tech Overview/Spec), by Gordon Mohr
-
A URN Namespace For Identifiers Based on Cryptographic Hashes by Peter Thiemann
-
Trusty URIs: Verifiable, Immutable, and Permanent Digital Artifacts for Linked Data, by Tobias Kuhn, Michel Dumontier