Documentation
¶
Index ¶
- Variables
- type ArchiveFS
- func (fs *ArchiveFS) Close() error
- func (fs *ArchiveFS) ListAllFiles(ctx context.Context) ([]string, error)
- func (fs *ArchiveFS) Lstat(ctx context.Context, path string) (os.FileInfo, error)
- func (fs *ArchiveFS) Open(ctx context.Context, name string) (ctxvfs.ReadSeekCloser, error)
- func (fs *ArchiveFS) ReadDir(ctx context.Context, path string) ([]os.FileInfo, error)
- func (fs *ArchiveFS) Stat(ctx context.Context, path string) (os.FileInfo, error)
- func (fs *ArchiveFS) String() string
- type Evicter
- type GitRepoVFS
- func (fs *GitRepoVFS) Lstat(ctx context.Context, path string) (os.FileInfo, error)
- func (fs *GitRepoVFS) Open(ctx context.Context, path string) (ctxvfs.ReadSeekCloser, error)
- func (fs *GitRepoVFS) ReadDir(ctx context.Context, path string) ([]os.FileInfo, error)
- func (fs *GitRepoVFS) Stat(ctx context.Context, path string) (os.FileInfo, error)
- func (fs *GitRepoVFS) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ArchiveCacheDir = "/tmp/go-langserver-archive-cache"
ArchiveCacheDir is the location on disk that archives are cached. It is configurable so that in production we can point it into CACHE_DIR.
View Source
var MaxCacheSizeBytes = int64(50 * 1024 * 1024 * 1024)
MaxCacheSizeBytes is the maximum size of the cache directory after evicting entries. Defaults to 50 GB.
Functions ¶
This section is empty.
Types ¶
type ArchiveFS ¶
type ArchiveFS struct { // EvictOnClose when true will evict the underlying archive from the // archive cache when closed. EvictOnClose bool // contains filtered or unexported fields }
ArchiveFS is a ctxvfs.FileSystem backed by an Archiver.
func NewGitHubRepoVFS ¶
NewGitHubRepoVFS creates a new VFS backed by a GitHub downloadable repository archive.
func NewZipVFS ¶
func NewZipVFS(ctx context.Context, url string, onFetchStart, onFetchFailed func(), evictOnClose bool) (*ArchiveFS, error)
NewZipVFS downloads a zip archive from a URL (or fetches from the local cache on disk) and returns a new VFS backed by that zip archive.
func (*ArchiveFS) ListAllFiles ¶
type Evicter ¶
type Evicter interface {
// Evict evicts an item from a cache.
Evict()
}
Evicter implements Evict
type GitRepoVFS ¶
type GitRepoVFS struct { CloneURL string // Git clone URL (e.g., "https://github.com/foo/bar") Rev string // Git revision (should be absolute, 40-char for consistency, unless nondeterminism is OK) Subtree string // only include this subtree // contains filtered or unexported fields }
func (*GitRepoVFS) Open ¶
func (fs *GitRepoVFS) Open(ctx context.Context, path string) (ctxvfs.ReadSeekCloser, error)
func (*GitRepoVFS) String ¶
func (fs *GitRepoVFS) String() string
Click to show internal directories.
Click to hide internal directories.