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
- func DiskStorage(ctx context.Context, resources, extensions string, clean protocol.StorageMask) (protocol.StorageReport, error)
- func ErrorCode(err error) protocol.Code
- func HistoryDirectory() (string, error)
- func ReadFileHistory(root string, v protocol.FileVersion) ([]byte, error)
- type FileHistory
- type Store
- func (s *Store) Change(id, version, offset uint64, start, end uint32, text string) (uint64, error)
- func (s *Store) Close()
- func (s *Store) CloseDocument(id uint64)
- func (s *Store) CloseProject(id uint64) error
- func (s *Store) Create(id uint64, name string, directory bool) error
- func (s *Store) CreateDocument(workspace uint64, name, content string) (protocol.Document, error)
- func (s *Store) Import(targetID uint64, filename, directory string, overwrite bool) (string, error)
- func (s *Store) Move(id, projectID uint64, name string) error
- func (s *Store) Open(directory string) (protocol.Workspace, error)
- func (s *Store) OpenDocument(projectID uint64, name string, mode protocol.DocumentMode) (protocol.Document, error)
- func (s *Store) ReadDirectory(id uint64, name string) ([]protocol.Entry, error)
- func (s *Store) ReadDocument(id, version, offset uint64) (protocol.Document, error)
- func (s *Store) Remove(id uint64, name string) error
- func (s *Store) Rename(id uint64, from, to string) error
- func (s *Store) Save(id, version uint64) error
- func (s *Store) Transfer(sourceID, targetID uint64, from, directory string, cut, duplicate bool) (string, error)
Constants ¶
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 HistoryDirectory ¶
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
type Store ¶
type Store struct {
History *FileHistory
// contains filtered or unexported fields
}