Movatterモバイル変換


[0]ホーム

URL:


files

package
v2.23.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:11Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcNewOverlayFSadded inv2.23.0

func NewOverlayFS(baseFSfs.FS, overlays []Overlay)fs.FS

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.

funcNewFromStore

func NewFromStore(storedatabase.Store) *Cache

NewFromStore returns a file cache that will fetch files from the provideddatabase.

func (*Cache)Acquire

func (c *Cache) Acquire(ctxcontext.Context, fileIDuuid.UUID) (fs.FS,error)

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.

Every call to Acquire must have a matching call to Release.

func (*Cache)Countadded inv2.23.0

func (c *Cache) Count()int

Count returns the number of files currently in the cache.Mainly used for unit testing assertions.

func (*Cache)Release

func (c *Cache) Release(fileIDuuid.UUID)

Release decrements the reference count for the given fileID, and frees thebacking data if there are no further references being held.

typeOverlayadded inv2.23.0

type Overlay struct {Pathstringfs.FS}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp