diff

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 17 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizePath

func NormalizePath(raw string) string

NormalizePath returns the slash-free path key shared with collaborative editing.

Types

type Manager

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

Manager owns the revision database for one server.

func NewManager

func NewManager(serverUUID string, logger *log.Entry) *Manager

func (*Manager) Clear

func (m *Manager) Clear() error

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Enabled

func (m *Manager) Enabled() bool

func (*Manager) FileSizeCap

func (m *Manager) FileSizeCap() uint64

func (*Manager) ForgetFile

func (m *Manager) ForgetFile(filePath string) error

func (*Manager) GetContent

func (m *Manager) GetContent(revisionID int64) ([]byte, error)

func (*Manager) List

func (m *Manager) List(filePath string) ([]RevisionInfo, error)

func (*Manager) RecordEdit

func (m *Manager) RecordEdit(filePath string, before, after []byte, userUUID string) (int64, error)

RecordEdit stores the successfully written content as a compressed snapshot.

func (*Manager) RenameFile

func (m *Manager) RenameFile(oldPath, newPath string) error

func (*Manager) RevisionPath

func (m *Manager) RevisionPath(revisionID int64) (string, bool, error)

type RevisionInfo

type RevisionInfo struct {
	ID         int64     `json:"id"`
	Size       int64     `json:"size"`
	StoredSize int64     `json:"stored_size"`
	User       *string   `json:"user,omitempty"`
	IsSnapshot bool      `json:"is_snapshot"`
	Created    time.Time `json:"created"`
}

RevisionInfo is the Calagopus-compatible representation of a file revision.

Jump to

Keyboard shortcuts

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