Documentation
¶
Index ¶
- type Entry
- type EntryType
- type WAL
- func (w *WAL) Append(entryType EntryType, version string, data map[string]interface{}, ...) (*Entry, error)
- func (w *WAL) Clear() error
- func (w *WAL) Close() error
- func (w *WAL) Commit(id string) error
- func (w *WAL) Compact() error
- func (w *WAL) Get(id string) (*Entry, error)
- func (w *WAL) GetLatestLSN() int64
- func (w *WAL) GetStats() map[string]int64
- func (w *WAL) List(entryType EntryType, status string) []*Entry
- func (w *WAL) ListCommitted() []*Entry
- func (w *WAL) ListPending() []*Entry
- func (w *WAL) Recover(handler func(entry *Entry) error) error
- func (w *WAL) Rollback(id string) error
- type WALOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"id"`
Type EntryType `json:"type"`
Timestamp time.Time `json:"timestamp"`
Version string `json:"version,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Checksum string `json:"checksum"`
Status string `json:"status"` // pending, committed, rolled_back
}
Entry represents a single WAL entry
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
WAL implements write-ahead logging for atomic operations
func (*WAL) Append ¶
func (w *WAL) Append(entryType EntryType, version string, data map[string]interface{}, metadata map[string]string) (*Entry, error)
Append appends a new entry to the WAL
func (*WAL) GetLatestLSN ¶
GetLatestLSN returns the latest log sequence number
func (*WAL) ListCommitted ¶
ListCommitted returns all committed entries
func (*WAL) ListPending ¶
ListPending returns all pending entries
type WALOptions ¶
WALOptions for configuring the WAL
func DefaultWALOptions ¶
func DefaultWALOptions() *WALOptions
DefaultWALOptions returns default WAL options
Click to show internal directories.
Click to hide internal directories.