Documentation ¶
Index ¶
- Constants
- Variables
- func BatchRemoveAssetsQueue(hashes []string)
- func BatchRemoveTreeQueue(rootIDs []string)
- func CacheRef(tree *parse.Tree, refNode *ast.Node)
- func ClearCache()
- func ClearQueue()
- func CloseDatabase()
- func DefRefs(condition string) (ret []map[*Block]*Block)
- func DeleteAssetContentsByPathQueue(path string)
- func DeleteBoxQueue(boxID string)
- func DeleteBoxRefsQueue(boxID string)
- func DeleteOutdatedHistories(before string)
- func DeleteRefsTreeQueue(tree *parse.Tree)
- func FlushAssetContentQueue()
- func FlushAssetContentTxJob()
- func FlushHistoryQueue()
- func FlushHistoryTxJob()
- func FlushQueue()
- func FlushTxJob()
- func GetContainerText(container *ast.Node) string
- func GetDuplicatedRootIDs(blocksTable string) (ret []string)
- func GetRefDuplicatedDefRootIDs() (ret []string)
- func GetRefText(defBlockID string) (ret string)
- func GetRootUpdated() (ret map[string]string, err error)
- func IndexAssetContentsQueue(assetContents []*AssetContent)
- func IndexHistoriesQueue(histories []*History)
- func IndexNodeQueue(id string)
- func IndexTreeQueue(tree *parse.Tree)
- func InitAssetContentDatabase(forceRebuild bool)
- func InitDatabase(forceRebuild bool) (err error)
- func InitHistoryDatabase(forceRebuild bool)
- func InsertRefsTreeQueue(tree *parse.Tree)
- func IsEmptyQueue() bool
- func Query(stmt string, limit int) (ret []map[string]interface{}, err error)
- func QueryAssetContentNoLimit(stmt string) (ret []map[string]interface{}, err error)
- func QueryBlockAliases(rootID string) (ret []string)
- func QueryBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []string)
- func QueryBlockNamesByRootID(rootID string) (ret []string)
- func QueryBookmarkLabels() (ret []string)
- func QueryChildDefIDsByRootDefID(rootDefID string) (ret []string)
- func QueryHistory(stmt string) (ret []map[string]interface{}, err error)
- func QueryNoLimit(stmt string) (ret []map[string]interface{}, err error)
- func QueryRefCount(defIDs []string) (ret map[string]int)
- func QueryRefIDsByAnnotationID(annotationID string) (refIDs, refTexts []string)
- func QueryRefIDsByDefID(defID string, containChildren bool) (refIDs, refTexts []string)
- func QueryRefRootBlocksByDefRootIDs(defRootIDs []string) (ret map[string][]*Block)
- func QueryRootBlockRefCount() (ret map[string]int)
- func QueryRootChildrenRefCount(defRootID string) (ret map[string]int)
- func QueryVirtualRefKeywords(name, alias, anchor, doc bool) (ret []string)
- func RemoveTreePathQueue(treeBox, treePathPrefix string)
- func RemoveTreeQueue(rootID string)
- func RenameSubTreeQueue(tree *parse.Tree)
- func RenameTreeQueue(tree *parse.Tree)
- func SetCaseSensitive(b bool)
- func SetIndexAssetPath(b bool)
- func UpdateBlockContentQueue(block *Block)
- func UpdateRefsTreeQueue(tree *parse.Tree)
- func UpsertTreeQueue(tree *parse.Tree)
- func WaitForWritingDatabase()
- type Asset
- type AssetContent
- type Attribute
- type Block
- func BuildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block)
- func GetAllChildBlocks(rootIDs []string, condition string) (ret []*Block)
- func GetAllRootBlocks() (ret []*Block)
- func GetBlock(id string) (ret *Block)
- func GetBlocks(ids []string) (ret []*Block)
- func GetChildBlocks(parentID, condition string) (ret []*Block)
- func QueryBlockByNameOrAlias(rootID, text string) (ret *Block)
- func QueryBookmarkBlocks() (ret []*Block)
- func QueryBookmarkBlocksByKeyword(bookmark string) (ret []*Block)
- func QueryDefRootBlocksByRefRootID(refRootID string) (ret []*Block)
- func QueryEmptyContentEmbedBlocks() (ret []*Block)
- func QueryRecentUpdatedBlocks() (ret []*Block)
- func QueryRootBlockByCondition(condition string) (ret []*Block)
- func SelectBlocksRawStmt(stmt string, page, limit int) (ret []*Block)
- func SelectBlocksRawStmtNoParse(stmt string, limit int) (ret []*Block)
- type FileAnnotationRef
- type History
- type Ref
- type Span
- type Stat
Constants ¶
View Source
const ( AssetContentsFTSCaseInsensitiveInsert = "INSERT INTO asset_contents_fts_case_insensitive (id, name, ext, path, size, updated, content) VALUES %s" AssetContentsPlaceholder = "(?, ?, ?, ?, ?, ?, ?)" )
View Source
const ( HistoriesFTSCaseInsensitiveInsert = "INSERT INTO histories_fts_case_insensitive (id, type, op, title, content, path, created) VALUES %s" HistoriesPlaceholder = "(?, ?, ?, ?, ?, ?, ?)" )
View Source
const ( BlocksInsert = "" /* 182-byte string literal not displayed */ BlocksFTSInsert = "" /* 186-byte string literal not displayed */ BlocksFTSCaseInsensitiveInsert = "" /* 203-byte string literal not displayed */ BlocksPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" SpansInsert = "INSERT INTO spans (id, block_id, root_id, box, path, content, markdown, type, ial) VALUES %s" SpansPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?)" AssetsPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?)" AttributesPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?)" RefsPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" FileAnnotationRefsPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?)" )
Variables ¶
View Source
var (
IndexIgnoreCached bool
)
Functions ¶
func BatchRemoveAssetsQueue ¶
func BatchRemoveAssetsQueue(hashes []string)
func BatchRemoveTreeQueue ¶
func BatchRemoveTreeQueue(rootIDs []string)
func ClearCache ¶
func ClearCache()
func ClearQueue ¶
func ClearQueue()
func CloseDatabase ¶
func CloseDatabase()
func DeleteAssetContentsByPathQueue ¶
func DeleteAssetContentsByPathQueue(path string)
func DeleteBoxQueue ¶
func DeleteBoxQueue(boxID string)
func DeleteBoxRefsQueue ¶
func DeleteBoxRefsQueue(boxID string)
func DeleteOutdatedHistories ¶
func DeleteOutdatedHistories(before string)
func DeleteRefsTreeQueue ¶
func FlushAssetContentQueue ¶
func FlushAssetContentQueue()
func FlushAssetContentTxJob ¶
func FlushAssetContentTxJob()
func FlushHistoryQueue ¶
func FlushHistoryQueue()
func FlushHistoryTxJob ¶
func FlushHistoryTxJob()
func FlushQueue ¶
func FlushQueue()
func FlushTxJob ¶
func FlushTxJob()
func GetContainerText ¶
func GetDuplicatedRootIDs ¶
func GetRefDuplicatedDefRootIDs ¶
func GetRefDuplicatedDefRootIDs() (ret []string)
func GetRefText ¶
func GetRootUpdated ¶
func IndexAssetContentsQueue ¶
func IndexAssetContentsQueue(assetContents []*AssetContent)
func IndexHistoriesQueue ¶
func IndexHistoriesQueue(histories []*History)
func IndexNodeQueue ¶
func IndexNodeQueue(id string)
func IndexTreeQueue ¶
func InitAssetContentDatabase ¶
func InitAssetContentDatabase(forceRebuild bool)
func InitDatabase ¶
func InitHistoryDatabase ¶
func InitHistoryDatabase(forceRebuild bool)
func InsertRefsTreeQueue ¶
func IsEmptyQueue ¶
func IsEmptyQueue() bool
func QueryBlockAliases ¶
func QueryBlockNamesByRootID ¶
func QueryBookmarkLabels ¶
func QueryBookmarkLabels() (ret []string)
func QueryHistory ¶
func QueryNoLimit ¶
func QueryRefCount ¶
func QueryRefIDsByDefID ¶
func QueryRootBlockRefCount ¶
func QueryVirtualRefKeywords ¶
func RemoveTreePathQueue ¶
func RemoveTreePathQueue(treeBox, treePathPrefix string)
func RemoveTreeQueue ¶
func RemoveTreeQueue(rootID string)
func RenameSubTreeQueue ¶
func RenameTreeQueue ¶
func SetCaseSensitive ¶
func SetCaseSensitive(b bool)
func SetIndexAssetPath ¶
func SetIndexAssetPath(b bool)
func UpdateBlockContentQueue ¶
func UpdateBlockContentQueue(block *Block)
func UpdateRefsTreeQueue ¶
func UpsertTreeQueue ¶
func WaitForWritingDatabase ¶
func WaitForWritingDatabase()
Types ¶
type Asset ¶
type Asset struct { ID string BlockID string RootID string Box string DocPath string Path string Name string Title string Hash string }
func QueryAssetByHash ¶
type AssetContent ¶
type AssetContent struct { ID string Name string Ext string Path string Size int64 Updated int64 Content string }
func SelectAssetContentsRawStmt ¶
func SelectAssetContentsRawStmt(stmt string, page, limit int) (ret []*AssetContent)
func SelectAssetContentsRawStmtNoParse ¶
func SelectAssetContentsRawStmtNoParse(stmt string, limit int) (ret []*AssetContent)
type Block ¶
type Block struct { ID string ParentID string RootID string Hash string Box string Path string HPath string Name string Alias string Memo string Tag string Content string FContent string Markdown string Length int Type string SubType string IAL string Sort int Created string Updated string }
func GetAllChildBlocks ¶
func GetAllRootBlocks ¶
func GetAllRootBlocks() (ret []*Block)
func GetChildBlocks ¶
func QueryBlockByNameOrAlias ¶
func QueryBookmarkBlocks ¶
func QueryBookmarkBlocks() (ret []*Block)
func QueryEmptyContentEmbedBlocks ¶
func QueryEmptyContentEmbedBlocks() (ret []*Block)
func QueryRecentUpdatedBlocks ¶
func QueryRecentUpdatedBlocks() (ret []*Block)
func SelectBlocksRawStmt ¶
func (*Block) IsContainerBlock ¶
type FileAnnotationRef ¶
type History ¶
type History struct { ID string Type int Op string Title string Content string Created string Path string }
func SelectHistoriesRawStmt ¶
type Ref ¶
type Ref struct { ID string DefBlockID string DefBlockParentID string DefBlockRootID string DefBlockPath string BlockID string RootID string Box string Path string Content string Markdown string Type string }
func GetRefsCacheByDefID ¶
func QueryRefsByDefID ¶
func QueryRefsByDefIDRefID ¶
func QueryRefsRecent ¶
type Span ¶
type Span struct { ID string BlockID string RootID string Box string Path string Content string Markdown string Type string IAL string }
func QueryTagSpans ¶
func QueryTagSpansByKeyword ¶
func QueryTagSpansByLabel ¶
func SelectSpansRawStmt ¶
Click to show internal directories.
Click to hide internal directories.