Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) AppendBlockInPage(_ context.Context, page string, content string) (*types.BlockEntity, error)
- func (c *Client) BuildBacklinks()
- func (c *Client) CreatePage(_ context.Context, name string, properties map[string]any, opts map[string]any) (*types.PageEntity, error)
- func (c *Client) DatascriptQuery(_ context.Context, query string, inputs ...any) (json.RawMessage, error)
- func (c *Client) FindBlocksByTag(_ context.Context, tag string, includeChildren bool) ([]backend.TagResult, error)
- func (c *Client) FindByProperty(_ context.Context, key, value, operator string) ([]backend.PropertyResult, error)
- func (c *Client) GetAllPages(_ context.Context) ([]types.PageEntity, error)
- func (c *Client) GetBlock(_ context.Context, uuid string, opts ...map[string]any) (*types.BlockEntity, error)
- func (c *Client) GetPage(_ context.Context, nameOrID any) (*types.PageEntity, error)
- func (c *Client) GetPageBlocksTree(_ context.Context, nameOrID any) ([]types.BlockEntity, error)
- func (c *Client) GetPageLinkedReferences(_ context.Context, nameOrID any) (json.RawMessage, error)
- func (c *Client) InsertBlock(_ context.Context, srcBlock any, content string, opts map[string]any) (*types.BlockEntity, error)
- func (c *Client) Load() error
- func (c *Client) MoveBlock(_ context.Context, uuid string, targetUUID string, opts map[string]any) error
- func (c *Client) Ping(_ context.Context) error
- func (c *Client) PrependBlockInPage(_ context.Context, page string, content string) (*types.BlockEntity, error)
- func (c *Client) RemoveBlock(_ context.Context, uuid string) error
- func (c *Client) SearchJournals(_ context.Context, query, from, to string) ([]backend.JournalResult, error)
- func (c *Client) UpdateBlock(_ context.Context, uuid string, content string, opts ...map[string]any) error
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupported = fmt.Errorf("operation not supported by obsidian backend")
ErrNotSupported is returned for Logseq-specific operations (DataScript queries).
var ErrReadOnly = fmt.Errorf("obsidian backend is read-only")
ErrReadOnly is returned for write operations on the read-only Obsidian backend.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements backend.Backend for an Obsidian vault on disk. It reads all .md files on initialization and serves queries from memory.
func (*Client) AppendBlockInPage ¶
func (*Client) BuildBacklinks ¶
func (c *Client) BuildBacklinks()
BuildBacklinks must be called after Load() to build the reverse link index.
func (*Client) CreatePage ¶
func (*Client) DatascriptQuery ¶
func (*Client) FindBlocksByTag ¶
func (c *Client) FindBlocksByTag(_ context.Context, tag string, includeChildren bool) ([]backend.TagResult, error)
FindBlocksByTag scans all pages for blocks containing the given #tag. Implements backend.TagSearcher.
func (*Client) FindByProperty ¶
func (c *Client) FindByProperty(_ context.Context, key, value, operator string) ([]backend.PropertyResult, error)
FindByProperty scans all pages for matching frontmatter properties. Implements backend.PropertySearcher.
func (*Client) GetAllPages ¶
func (*Client) GetPageBlocksTree ¶
func (*Client) GetPageLinkedReferences ¶
func (*Client) InsertBlock ¶
func (*Client) PrependBlockInPage ¶
func (*Client) SearchJournals ¶
func (c *Client) SearchJournals(_ context.Context, query, from, to string) ([]backend.JournalResult, error)
SearchJournals scans daily notes for matching content. Implements backend.JournalSearcher.