import "code.pfad.fr/exp/httpetag"
func FileServer(root http.FileSystem) http.Handler
type ContentHashFile interface { fs.File // ContentHash returns content hashes of the file that uniquely // identifies the file contents. // The returned hashes should be of the form algorithm-base64, // and implementations are encouraged to use sha256, sha384, or sha512 // as the algorithms and RawStdEncoding as base64 encoding, // for interoperability with other systems. // // ContentHash must NOT compute any hash of the file during the call. // That is, it must run in time O(1) not O(length of file). // If no content hash is already available, ContentHash should // return nil rather than take the time to compute one. ContentHash() []string }
A ContentHashFile is a file that can return its own content hashes efficiently.