Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentRequest ¶
CurrentRequest represents a request for the current serial number
type CurrentResponse ¶
type CurrentResponse struct {
NodeID string `json:"node_id"`
RelayURL string `json:"relay_url"`
Serial uint64 `json:"serial"`
}
CurrentResponse returns the current serial number
type FetchRequest ¶
type FetchRequest struct {
NodeID string `json:"node_id"`
RelayURL string `json:"relay_url"`
From uint64 `json:"from"`
To uint64 `json:"to"`
}
FetchRequest represents a request for events in a serial range
type FetchResponse ¶
type FetchResponse struct {
Events []string `json:"events"` // JSONL formatted events
}
FetchResponse contains the requested events as JSONL
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles distributed synchronization between relay peers using serial numbers as clocks
func NewManager ¶
func NewManager(ctx context.Context, db *database.D, nodeID, relayURL string, peers []string) *Manager
NewManager creates a new sync manager
func (*Manager) GetCurrentSerial ¶
GetCurrentSerial returns the current serial number
func (*Manager) HandleCurrentRequest ¶
func (m *Manager) HandleCurrentRequest(w http.ResponseWriter, r *http.Request)
HandleCurrentRequest handles requests for current serial number
Source Files
¶
- manager.go
Click to show internal directories.
Click to hide internal directories.