cache

package
v0.0.0-...-60bfa88 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoizedFS

type MemoizedFS struct {
	// contains filtered or unexported fields
}

A MemoizedFS is a file source that memoizes reads, to reduce IO.

func NewMemoizedFS

func NewMemoizedFS() *MemoizedFS

func (*MemoizedFS) ReadFile

func (fs *MemoizedFS) ReadFile(ctx context.Context, uri protocol.DocumentURI) (file.Handle, error)

ReadFile stats and (maybe) reads the file, updates the cache, and returns it.

type OverlayFS

type OverlayFS struct {
	// contains filtered or unexported fields
}

An OverlayFS is a file.Source that keeps track of overlays on top of a delegate FileSource.

func NewOverlayFS

func NewOverlayFS(delegate file.Source) *OverlayFS

func (*OverlayFS) Overlays

func (fs *OverlayFS) Overlays() []*overlay

Overlays returns a new unordered array of overlays.

func (*OverlayFS) ReadFile

func (fs *OverlayFS) ReadFile(ctx context.Context, uri protocol.DocumentURI) (file.Handle, error)

func (*OverlayFS) UpdateOverlays

func (fs *OverlayFS) UpdateOverlays(ctx context.Context, changes []file.Modification) error

Precondition: caller holds s.viewMu lock. TODO(rfindley): move this to fs_overlay.go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL