workspace

package
v0.1.0-rc.20 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

File history belongs to paths on the workspace host, including paths shared by nested workspace and repository roots. Only completed snapshots are visible.

Package workspace owns filesystem roots and versioned documents without GUI dependencies. A Store belongs to one protocol connection and one goroutine.

Index

Constants

View Source
const SaveTemporaryPrefix = ".pencode-save-"

SaveTemporaryPrefix identifies files staged for an atomic save.

Variables

This section is empty.

Functions

func DiskStorage

func DiskStorage(ctx context.Context, resources, extensions string, clean protocol.StorageMask) (protocol.StorageReport, error)

DiskStorage measures host-owned data. Only fixed categories are accepted on the wire.

func ErrorCode

func ErrorCode(err error) protocol.Code

func HistoryDirectory

func HistoryDirectory() (string, error)

func ReadFileHistory

func ReadFileHistory(root string, v protocol.FileVersion) ([]byte, error)

Types

type FileHistory

type FileHistory struct {
	SettingsPath string
	// contains filtered or unexported fields
}

FileHistory reads host settings once per settings file revision. An absent settings file (or a nil FileHistory) selects the editor defaults.

func (*FileHistory) List

func (h *FileHistory) List(ctx context.Context, root, scope string, recursive bool, before protocol.FileVersion) ([]protocol.FileVersion, bool, error)

func (*FileHistory) Restore

func (h *FileHistory) Restore(root *os.Root, v protocol.FileVersion) error

func (*FileHistory) Saved

func (h *FileHistory) Saved(root *os.Root, name string, size int64, known *[sha256.Size]byte)

Saved records a successful editor or file-service save.

type Store

type Store struct {
	History *FileHistory
	// contains filtered or unexported fields
}

func (*Store) Change

func (s *Store) Change(id, version, offset uint64, start, end uint32, text string) (uint64, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) CloseDocument

func (s *Store) CloseDocument(id uint64)

func (*Store) CloseProject

func (s *Store) CloseProject(id uint64) error

func (*Store) Create

func (s *Store) Create(id uint64, name string, directory bool) error

func (*Store) CreateDocument

func (s *Store) CreateDocument(workspace uint64, name, content string) (protocol.Document, error)

func (*Store) Import

func (s *Store) Import(targetID uint64, filename, directory string, overwrite bool) (string, error)

func (*Store) Move

func (s *Store) Move(id, projectID uint64, name string) error

func (*Store) Open

func (s *Store) Open(directory string) (protocol.Workspace, error)

func (*Store) OpenDocument

func (s *Store) OpenDocument(projectID uint64, name string, mode protocol.DocumentMode) (protocol.Document, error)

func (*Store) ReadDirectory

func (s *Store) ReadDirectory(id uint64, name string) ([]protocol.Entry, error)

func (*Store) ReadDocument

func (s *Store) ReadDocument(id, version, offset uint64) (protocol.Document, error)

func (*Store) Remove

func (s *Store) Remove(id uint64, name string) error

func (*Store) Rename

func (s *Store) Rename(id uint64, from, to string) error

func (*Store) Save

func (s *Store) Save(id, version uint64) error

func (*Store) Transfer

func (s *Store) Transfer(sourceID, targetID uint64, from, directory string, cut, duplicate bool) (string, error)

Jump to

Keyboard shortcuts

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