proxy.golang.org : github.com/reiver/go-refs
Package refs provides a generic Virtual File System (VFS) like abstraction. An simple example is as follows: Or, without the direct error handling: Note that the ref.Open func (and the ref.MustOpen func) was passed what looks like an HTTP URL, in this example. We could have, in fact, potentially passed it any scheme based identifier. (The 'scheme' being the stuff at the beginning of the string before the colon. So, for example, the scheme of "ftp://somewhere.com/over/the/rb.pdf" is "ftp", the scheme of "http://www.example.com/file.txt" is "http", the scheme of "https://www.skys.com/shine/blue.php" is "https", and the scheme of "data:,Hello%20world!" is "data:", etc.) For example, other scheme based identifiers used could potentially be: (These 3 examples use an FTP URL, an HTTPS URL, and a Data URI, respectively.) Any URL, URI, URN, URC, etc, can all be potentially be used with the ref.Open func (and the ref.MustOpen func). As well as other things that look like URLs, URI, URNs, URCs. One thing to note is the usage of the word "potentially" in the previous two statements. The reason this is important is because you MUST load "refs drivers" yourself, to have any URL, URI, URN, URC, etc. For example: This is similar to how the "database/sql" built-in Go library works. (Where "database/sql" does not support any databases itself, but just provides the interface, and other libraries are imported with provide a driver.)
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/reiver/go-refs
License: MIT
Latest release: over 9 years ago
First release: over 9 years ago
Namespace: github.com/reiver
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 months ago