workspace

package
v0.1.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 19 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

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 ErrorCode

func ErrorCode(err error) protocol.Code

Types

type Store

type Store struct {
	// 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) 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