Documentation
¶
Overview ¶
Package content provides markdown file monitoring, caching, and change notification services.
Index ¶
- type Event
- type Options
- type Service
- func (s *Service) Close() error
- func (s *Service) CreateDocument(ctx context.Context, relPath string, data []byte) error
- func (s *Service) CurrentTree(ctx context.Context) (*tree.Node, error)
- func (s *Service) DebugStatus() map[string]any
- func (s *Service) DeleteDocument(ctx context.Context, relPath string) error
- func (s *Service) Document(ctx context.Context, relPath string) (renderer.Document, error)
- func (s *Service) RenameDocument(ctx context.Context, fromPath, toPath string) error
- func (s *Service) SaveDocument(ctx context.Context, relPath string, data []byte) error
- func (s *Service) Subscribe(ctx context.Context) <-chan Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
Path string `json:"path,omitempty"`
}
Event describes change notifications emitted to subscribers.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates content rendering, indexing, and change notifications.
func NewService ¶
func NewService(parentCtx context.Context, root string, rendererSvc *renderer.Service, logger *slog.Logger, opts Options) (*Service, error)
NewService initializes content monitoring rooted at path.
func (*Service) CreateDocument ¶
CreateDocument creates a new markdown document with the provided contents.
func (*Service) CurrentTree ¶
CurrentTree returns the cached tree snapshot.
func (*Service) DebugStatus ¶
DebugStatus returns diagnostic information for testing.
func (*Service) DeleteDocument ¶
DeleteDocument removes a markdown document from disk.
func (*Service) RenameDocument ¶
RenameDocument renames an existing markdown document to a new path.
func (*Service) SaveDocument ¶
SaveDocument writes updated markdown contents to an existing document.