files
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
Types¶
typeCache¶
type Cache struct {// contains filtered or unexported fields}
Cache persists the files for template versions, and is used by dynamicparameters to deduplicate the files in memory. When any number of users opensthe workspace creation form for a given template version, it's files areloaded into memory exactly once. We hold those files until there are nolonger any open connections, and then we remove the value from the map.
funcNew¶added inv2.24.0
func New(registererprometheus.Registerer, authzrbac.Authorizer) *Cache
New returns a file cache that will fetch files from a database
func (*Cache)Acquire¶
Acquire will load the fs.FS for the given file. It guarantees that parallelcalls for the same fileID will only result in one fetch, and that parallelcalls for distinct fileIDs will fetch in parallel.
Safety: Every call to Acquire that does not return an error must have amatching call to Release.
typeCacheCloser¶added inv2.24.0
type CacheCloser struct {// contains filtered or unexported fields}
CacheCloser is a cache wrapper used to close all acquired files.This is a more simple interface to use if opening multiple files at once.
funcNewCacheCloser¶added inv2.24.0
func NewCacheCloser(cacheFileAcquirer) *CacheCloser
func (*CacheCloser)Close¶added inv2.24.0
func (c *CacheCloser) Close()
typeCloseFS¶added inv2.24.0
CloseFS is a wrapper around fs.FS that implements io.Closer. The Close()method tells the cache to release the fileID. Once all open references areclosed, the file is removed from the cache.