diff

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 17 Imported by: 0

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
⌂ 换网址