Documentation
¶
Index ¶
- func NormalizePath(raw string) string
- type Manager
- func (m *Manager) Clear() error
- func (m *Manager) Close() error
- func (m *Manager) Enabled() bool
- func (m *Manager) FileSizeCap() uint64
- func (m *Manager) ForgetFile(filePath string) error
- func (m *Manager) GetContent(revisionID int64) ([]byte, error)
- func (m *Manager) List(filePath string) ([]RevisionInfo, error)
- func (m *Manager) RecordEdit(filePath string, before, after []byte, userUUID string) (int64, error)
- func (m *Manager) RenameFile(oldPath, newPath string) error
- func (m *Manager) RevisionPath(revisionID int64) (string, bool, error)
- type RevisionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizePath ¶
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 (*Manager) FileSizeCap ¶
func (*Manager) ForgetFile ¶
func (*Manager) RecordEdit ¶
RecordEdit stores the successfully written content as a compressed snapshot.
func (*Manager) RenameFile ¶
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.
Click to show internal directories.
Click to hide internal directories.