Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AcquireContentLock(sessionID string) (bool, error)
- func (m *Manager) AcquireLock(sessionID string, hookEvent ...string) (bool, error)
- func (m *Manager) CheckEarlyDuplicate(sessionID string, hookEvent ...string) bool
- func (m *Manager) Cleanup(maxAge int64) error
- func (m *Manager) CleanupForSession(sessionID string) error
- func (m *Manager) ReleaseContentLock(sessionID string) error
- func (m *Manager) ReleaseLock(sessionID string, hookEvent ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles deduplication using two-phase locking
func (*Manager) AcquireContentLock ¶
AcquireContentLock acquires a lock for content-based deduplication Uses a separate lock file with longer TTL (5s) to prevent race conditions between different hook types (Stop, Notification) with same content
func (*Manager) AcquireLock ¶
AcquireLock performs Phase 2 lock acquisition Returns true if lock was successfully acquired hookEvent parameter is optional - if provided, uses hook-specific lock file
func (*Manager) CheckEarlyDuplicate ¶
CheckEarlyDuplicate performs Phase 1 check for duplicates Returns true if this is a duplicate and should be skipped hookEvent parameter is optional - if provided, checks hook-specific lock file
func (*Manager) CleanupForSession ¶
CleanupForSession cleans up lock file for a specific session
func (*Manager) ReleaseContentLock ¶
ReleaseContentLock releases the content-based deduplication lock