Documentation
¶
Index ¶
- type ChangeSet
- type Options
- type RecordChange
- type Server
- func (s *Server) AppMetadata() map[string]interface{}
- func (s *Server) Close() error
- func (s *Server) Config() appconfig.Config
- func (s *Server) Info() (map[string]interface{}, error)
- func (s *Server) RecordResult() (recordpipe.Result, error)
- func (s *Server) Records() (map[string]interface{}, error)
- func (s *Server) RecordsPayload() (interface{}, error)
- func (s *Server) Refresh()
- func (s *Server) ReplaceConfig(cfg appconfig.Config) (appconfig.Config, error)
- func (s *Server) Router() http.Handler
- func (s *Server) ShowToast(req ToastRequest) error
- func (s *Server) Start(addr string) error
- func (s *Server) StartWatching(debounceDuration time.Duration) error
- func (s *Server) Status() map[string]interface{}
- func (s *Server) SubscribeEvents(buffer int) (<-chan map[string]interface{}, func())
- type ToastRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeSet ¶
type ChangeSet = recorddiff.ChangeSet
type RecordChange ¶
type RecordChange = recorddiff.RecordChange
Compatibility aliases keep the existing server API while sharing one diff implementation with CLI watch-mode webhooks.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP/WebSocket server
func NewServerWithOptions ¶
func (*Server) AppMetadata ¶
AppMetadata returns version/resource/config metadata for embedded and IPC clients.
func (*Server) Info ¶
Info returns database schema and metadata using the same shape served by GET /api/info.
func (*Server) RecordResult ¶
func (s *Server) RecordResult() (recordpipe.Result, error)
func (*Server) Records ¶
Records returns the current records using the same transformed shape served by GET /api/records.
func (*Server) RecordsPayload ¶
func (*Server) Refresh ¶
func (s *Server) Refresh()
Refresh forces a data refresh broadcast to browser, IPC, and embedded subscribers.
func (*Server) ReplaceConfig ¶
ReplaceConfig persists and broadcasts a new configuration snapshot.
func (*Server) Router ¶
Router returns the HTTP router used by the standalone server. Embedded hosts can mount it in their own HTTP stack instead of opening a patris-export port.
func (*Server) ShowToast ¶
func (s *Server) ShowToast(req ToastRequest) error
ShowToast displays a native notification and/or broadcasts it to connected browser, IPC, and embedded subscribers.
func (*Server) StartWatching ¶
StartWatching starts watching the database file for changes with the specified debounce duration
func (*Server) Status ¶
Status returns process and database lock status using the same shape served by GET /api/status.
func (*Server) SubscribeEvents ¶
SubscribeEvents subscribes to the same event stream used by the WebSocket broadcaster. The returned unsubscribe function must be called by the host.
type ToastRequest ¶
type ToastRequest struct {
Type string `json:"type,omitempty"`
Title string `json:"title"`
Message string `json:"message"`
Icon string `json:"icon,omitempty"`
Source string `json:"source,omitempty"`
Native *bool `json:"native,omitempty"`
Broadcast *bool `json:"broadcast,omitempty"`
}
ToastRequest represents a desktop/browser notification request.