sheetdoc

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSheetID = "s1"

DefaultSheetID is the id of the single sheet created for a brand-new workbook.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager owns the in-memory sheet documents and serializes operations per document (total order), persisting each op and a workbook snapshot.

func NewManager

func NewManager(store db.DataStore) *Manager

func (*Manager) OpsSince

func (m *Manager) OpsSince(padId string, sinceRev int) ([]sheet.Op, error)

OpsSince returns the rebased ops applied after sinceRev (for reconnect).

func (*Manager) SetWorkbook

func (m *Manager) SetWorkbook(padId string, wb *sheet.Workbook) error

SetWorkbook replaces the document's workbook (e.g. from an xlsx import), resetting it to revision 0 with an empty op-log. Existing persisted ops are cleared so the write-once sheet_op primary key does not block later edits.

func (*Manager) Snapshot

func (m *Manager) Snapshot(padId string) (sheet.WorkbookSnapshot, int, error)

Snapshot returns the current workbook snapshot and head (for the initial client state on connect).

func (*Manager) Submit

func (m *Manager) Submit(padId string, op sheet.Op, authorId *string, tsMillis int64) (sheet.Op, int, error)

Submit rebases, applies, and persists one op, returning the rebased op (for broadcast) and the new head revision.

Jump to

Keyboard shortcuts

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