Documentation
¶
Overview ¶
Package server provides the HTTP API for Engram.
This is how external clients (OpenCode plugin, Claude Code hooks, any agent) communicate with the memory engine. Simple JSON REST API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) SetOnWrite ¶ added in v1.8.0
func (s *Server) SetOnWrite(fn func())
SetOnWrite configures a callback invoked after every successful local write. This is used to notify autosync.Manager via NotifyDirty().
func (*Server) SetSyncStatus ¶ added in v1.8.0
func (s *Server) SetSyncStatus(provider SyncStatusProvider)
SetSyncStatus configures the sync status provider for the /sync/status endpoint.
type SyncStatus ¶ added in v1.8.0
type SyncStatus struct {
Phase string `json:"phase"`
LastError string `json:"last_error,omitempty"`
ConsecutiveFailures int `json:"consecutive_failures"`
BackoffUntil *time.Time `json:"backoff_until,omitempty"`
LastSyncAt *time.Time `json:"last_sync_at,omitempty"`
}
SyncStatus mirrors autosync.Status to avoid a direct import cycle.
type SyncStatusProvider ¶ added in v1.8.0
type SyncStatusProvider interface {
Status() SyncStatus
}
SyncStatusProvider returns the current sync status. This is implemented by autosync.Manager and injected from cmd/engram/main.go.
Click to show internal directories.
Click to hide internal directories.