Documentation
¶
Index ¶
- type AISettingsDTO
- type App
- func (a *App) AIChat(pagePath, userMessage string) (string, error)
- func (a *App) ApplySlashOp(blockID, op string) error
- func (a *App) CycleBlockTodo(blockID string) error
- func (a *App) EnsurePage(path string) error
- func (a *App) ExportPageHTML(pagePath, destPath string) error
- func (a *App) GetAISettings() (AISettingsDTO, error)
- func (a *App) GetAppVersion() string
- func (a *App) GetBacklinks(pagePath string) ([]domain.Block, error)
- func (a *App) GetLocale() (string, error)
- func (a *App) GetPage(path string) ([]PageBlock, error)
- func (a *App) GetSemanticGraphEdges() ([]storage.WikiGraphSemanticEdge, error)
- func (a *App) GetSemanticRelatedForPage(pagePath string, limit int) ([]SemanticRelatedDTO, error)
- func (a *App) GetSyncSettings() (SyncSettingsDTO, error)
- func (a *App) GetTheme() (string, error)
- func (a *App) GetWikiGraph() (storage.WikiGraph, error)
- func (a *App) HealthResetLocalSearchIndex() error
- func (a *App) IndentBlock(blockID string) error
- func (a *App) InsertBlockAfter(blockID, initialText string) error
- func (a *App) IsAIReachable() bool
- func (a *App) ListLANSyncPeers() ([]LANPeerDTO, error)
- func (a *App) ListPagesByProperty(key, value string) ([]string, error)
- func (a *App) ListVaultPages() ([]string, error)
- func (a *App) NotesRoot() string
- func (a *App) OutdentBlock(blockID string) error
- func (a *App) PairLANSyncWith(host string, port int, pin string) error
- func (a *App) QueryBlocks(dsl string) ([]domain.Block, error)
- func (a *App) ReorderBlockBefore(movingID, beforeID string) error
- func (a *App) ResolveWikilink(target string) (string, error)
- func (a *App) SearchBlocks(query string) ([]storage.BlockSearchHit, error)
- func (a *App) SetAISettings(dto AISettingsDTO) error
- func (a *App) SetHealthRescan(fn func(context.Context) error)
- func (a *App) SetLocale(tag string) error
- func (a *App) SetSyncSettings(dto SyncSettingsDTO) error
- func (a *App) SetTheme(theme string) error
- func (a *App) StartAIInlineStream(opID, blockID, instruction string) error
- func (a *App) StartLANSyncAdvertise() (string, error)
- func (a *App) Startup(ctx context.Context)
- func (a *App) StopLANSyncAdvertise()
- func (a *App) SuggestTagsForBlock(blockID string) ([]string, error)
- func (a *App) SyncVaultS3() error
- func (a *App) SyncVaultWebDAV() error
- func (a *App) UpdateBlock(blockID, newContent string) error
- type LANPeerDTO
- type PageBlock
- type SemanticRelatedDTO
- type SyncSettingsDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AISettingsDTO ¶ added in v1.3.0
type AISettingsDTO struct {
Provider string `json:"provider"`
Model string `json:"model"`
Endpoint string `json:"endpoint"`
APIKey string `json:"apiKey"`
Temperature float64 `json:"temperature"`
EmbeddingsModel string `json:"embeddingsModel"`
DisableEmbeddings bool `json:"disableEmbeddings"`
SystemPrompt string `json:"systemPrompt"`
SemanticTopK int `json:"semanticTopK"`
}
AISettingsDTO is persisted AI configuration exposed to the Svelte UI.
type App ¶
type App struct {
// EventEmitter is optional (Android WebView). When set, code that would use Wails runtime events
// should prefer this path so the native shell can forward to JavaScript.
EventEmitter func(name string, payload map[string]any)
// contains filtered or unexported fields
}
App is the Wails-facing API surface (bound to the frontend).
func (*App) AIChat ¶ added in v1.3.0
AIChat uses RAG: current page Markdown plus top semantic hits from the vault.
func (*App) ApplySlashOp ¶
ApplySlashOp applies a slash command to the block: today, todo, h1, h2, h3, code.
func (*App) CycleBlockTodo ¶
CycleBlockTodo cycles TODO → DOING → DONE → (clear) on the first line of the block in the file.
func (*App) EnsurePage ¶
EnsurePage creates path if missing (vault-relative or absolute under vault).
func (*App) ExportPageHTML ¶
ExportPageHTML writes a standalone HTML file for a vault page using Goldmark. destPath should be absolute.
func (*App) GetAISettings ¶ added in v1.3.0
func (a *App) GetAISettings() (AISettingsDTO, error)
GetAISettings returns persisted AI options (API key is local-only, like cloudToken).
func (*App) GetAppVersion ¶
GetAppVersion returns the build version (set via -ldflags for release binaries).
func (*App) GetBacklinks ¶
GetBacklinks returns blocks (any page) whose content links to the given vault-relative page via [[wikilinks]].
func (*App) GetLocale ¶
GetLocale returns the persisted locale tag (e.g. en, zh-CN) or empty if never set (first run).
func (*App) GetPage ¶
GetPage loads all blocks for a vault-relative or absolute Markdown path and returns a tree of roots.
func (*App) GetSemanticGraphEdges ¶ added in v1.3.0
func (a *App) GetSemanticGraphEdges() ([]storage.WikiGraphSemanticEdge, error)
GetSemanticGraphEdges returns page–page edges derived from embedding similarity (local SQLite only).
func (*App) GetSemanticRelatedForPage ¶ added in v1.3.0
func (a *App) GetSemanticRelatedForPage(pagePath string, limit int) ([]SemanticRelatedDTO, error)
GetSemanticRelatedForPage finds blocks on other pages similar to the page's Markdown (vector search).
func (*App) GetSyncSettings ¶ added in v1.3.1
func (a *App) GetSyncSettings() (SyncSettingsDTO, error)
GetSyncSettings returns WebDAV and LAN pairing options (secrets are local-only).
func (*App) GetWikiGraph ¶
GetWikiGraph returns indexed pages as nodes and resolved wikilinks as directed edges.
func (*App) HealthResetLocalSearchIndex ¶ added in v1.4.6
HealthResetLocalSearchIndex wipes the local SQLite search index (blocks, FTS, embeddings metadata, page props/aliases) and re-indexes from Markdown on disk. Markdown files in the vault are not deleted.
func (*App) IndentBlock ¶
IndentBlock increases list indentation by two spaces for the block (and nested list lines under it).
func (*App) InsertBlockAfter ¶
InsertBlockAfter appends a new Markdown line after the given block (Logseq-style Enter).
func (*App) IsAIReachable ¶ added in v1.4.5
IsAIReachable returns true when the configured LLM endpoint responds (Ollama /api/tags or OpenAI root ping).
func (*App) ListLANSyncPeers ¶ added in v1.3.1
func (a *App) ListLANSyncPeers() ([]LANPeerDTO, error)
ListLANSyncPeers discovers other Dingovault desktops advertising on the LAN.
func (*App) ListPagesByProperty ¶
ListPagesByProperty returns vault-relative .md paths whose YAML frontmatter has prop_key = prop_value (case-insensitive).
func (*App) ListVaultPages ¶
ListVaultPages returns vault-relative .md paths for all indexed pages, most recently updated first.
func (*App) OutdentBlock ¶
OutdentBlock decreases list indentation by two spaces for the same span.
func (*App) PairLANSyncWith ¶ added in v1.3.1
PairLANSyncWith connects to a peer, verifies the PIN, and stores received sync settings (WebDAV and optional S3) locally.
func (*App) QueryBlocks ¶
QueryBlocks runs a small query DSL: "key:value" for properties, otherwise FTS on content.
func (*App) ReorderBlockBefore ¶
ReorderBlockBefore moves movingID immediately before beforeID among sibling blocks in the same file.
func (*App) ResolveWikilink ¶
ResolveWikilink returns the absolute .md path for a [[wikilink]] target string.
func (*App) SearchBlocks ¶
func (a *App) SearchBlocks(query string) ([]storage.BlockSearchHit, error)
SearchBlocks queries the FTS5 index (blocks_fts) and returns ranked hits with snippets.
func (*App) SetAISettings ¶ added in v1.3.0
func (a *App) SetAISettings(dto AISettingsDTO) error
SetAISettings saves AI options. Empty apiKey preserves the previous key when provider stays OpenAI.
func (*App) SetHealthRescan ¶ added in v1.4.6
SetHealthRescan registers a callback that re-walks the vault after the SQLite index is cleared (desktop / mobile). Optional; required for HealthResetLocalSearchIndex.
func (*App) SetSyncSettings ¶ added in v1.3.1
func (a *App) SetSyncSettings(dto SyncSettingsDTO) error
SetSyncSettings saves sync options. Empty webdavPassword preserves the previous password.
func (*App) SetTheme ¶
SetTheme persists theme and should be paired with updating document.documentElement.dataset.theme in the UI.
func (*App) StartAIInlineStream ¶ added in v1.3.0
StartAIInlineStream begins a streaming LLM refactor for one block. Chunks are emitted as Wails events:
- "ai-inline-chunk" payload: { opID, chunk }
- "ai-inline-done" payload: { opID }
- "ai-inline-error" payload: { opID, message }
func (*App) StartLANSyncAdvertise ¶ added in v1.3.1
StartLANSyncAdvertise opens the PIN pairing server and publishes mDNS; returns the 4-digit PIN to show locally.
func (*App) StopLANSyncAdvertise ¶ added in v1.3.1
func (a *App) StopLANSyncAdvertise()
StopLANSyncAdvertise tears down mDNS and the pairing listener.
func (*App) SuggestTagsForBlock ¶ added in v1.3.0
SuggestTagsForBlock suggests existing vault #tags that are semantically similar to the block text.
func (*App) SyncVaultS3 ¶ added in v1.3.2
SyncVaultS3 performs a bidirectional .md sync with the configured S3 bucket (or S3-compatible API).
func (*App) SyncVaultWebDAV ¶ added in v1.3.1
SyncVaultWebDAV performs a bidirectional .md sync with the configured WebDAV server.
func (*App) UpdateBlock ¶
UpdateBlock surgically replaces the block's line span in the backing file and re-indexes.
type LANPeerDTO ¶ added in v1.3.1
type LANPeerDTO struct {
Name string `json:"name"`
Host string `json:"host"`
IP string `json:"ip"`
Port int `json:"port"`
TXT []string `json:"txt,omitempty"`
}
LANPeerDTO is one discovered Dingovault instance on the LAN.
type SemanticRelatedDTO ¶ added in v1.3.0
type SemanticRelatedDTO struct {
BlockID string `json:"blockId"`
SourcePath string `json:"sourcePath"`
RelPath string `json:"relPath"`
Preview string `json:"preview"`
Score float32 `json:"score"`
}
SemanticRelatedDTO is one semantically similar block on another page.
type SyncSettingsDTO ¶ added in v1.3.1
type SyncSettingsDTO struct {
WebDAVURL string `json:"webdavUrl"`
WebDAVUser string `json:"webdavUser"`
WebDAVPassword string `json:"webdavPassword"`
WebDAVRemoteRoot string `json:"webdavRemoteRoot"`
PairingPort int `json:"pairingPort"`
LANInstanceName string `json:"lanInstanceName"`
S3Region string `json:"s3Region"`
S3Bucket string `json:"s3Bucket"`
S3Prefix string `json:"s3Prefix"`
S3AccessKey string `json:"s3AccessKey"`
S3SecretKey string `json:"s3SecretKey"`
S3Endpoint string `json:"s3Endpoint"`
}
SyncSettingsDTO is persisted sync configuration for the Svelte UI.