Documentation
¶
Index ¶
- Constants
- Variables
- func BatchGetBlockAttrs(ids []string) (ret map[string]map[string]string)
- func BatchGetBlockAttrsWitTrees(ids []string, trees map[string]*parse.Tree) (ret map[string]map[string]string)
- 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, limit int) (ret []map[*Block]*Block)
- func DeleteAssetContentsByPathQueue(path string)
- func DeleteBoxQueue(boxID string)
- func DeleteBoxRefsQueue(boxID string)
- func DeleteOutdatedHistories(before int64)
- func DeleteRefsTreeQueue(tree *parse.Tree)
- func FillAttributeViewNilValue(value *av.Value, typ av.KeyType)
- func FlushAssetContentQueue()
- func FlushAssetContentTxJob()
- func FlushHistoryQueue()
- func FlushHistoryTxJob()
- func FlushQueue()
- func FlushTxJob()
- func GetBlockAttrs(id string) (ret map[string]string)
- func GetContainerText(container *ast.Node) string
- func GetDuplicatedRootIDs(blocksTable string) (ret []string)
- func GetFurtherCollections(attrView *av.AttributeView, cachedAttrViews map[string]*av.AttributeView) (ret map[string]av.Collection)
- func GetRefDuplicatedDefRootIDs() (ret []string)
- func GetRefText(defBlockID string) (ret string)
- func GetRootUpdated() (ret map[string]string, err error)
- func GetTemplateKeyRelevantKeys(attrView *av.AttributeView, templateKey *av.Key) (ret []*av.Key)
- func GetTemplateKeysByResolutionOrder(attrView *av.AttributeView) (ret []*av.Key, resolved bool)
- 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 NodeStaticContent(node *ast.Node, excludeTypes []string, ...) string
- 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 QueryChildRefDefIDsByRootDefID(rootDefID string) (ret map[string][]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 []string)
- func QueryRefIDsByDefID(defID string, containChildren bool) (refIDs []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 RenderAttributeViewGallery(attrView *av.AttributeView, view *av.View, query string, depth *int, ...) (ret *av.Gallery)
- func RenderAttributeViewKanban(attrView *av.AttributeView, view *av.View, query string, depth *int, ...) (ret *av.Kanban)
- func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query string, depth *int, ...) (ret *av.Table)
- func RenderGroupView(attrView *av.AttributeView, view, groupView *av.View, query string) (ret av.Viewable)
- func RenderView(attrView *av.AttributeView, view *av.View, query string) (ret av.Viewable)
- func SQLTemplateFuncs(templateFuncMap *template.FuncMap)
- func SetCaseSensitive(b bool)
- func SetIndexAssetPath(b bool)
- func UpdateBlockContentQueue(block *Block)
- func UpdateRefsTreeQueue(tree *parse.Tree)
- func UpsertTreeQueue(tree *parse.Tree)
- func Vacuum()
- func WaitFlushTx()
- type Asset
- type AssetContent
- type Attribute
- type Block
- func BuildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block)
- func GetAllChildBlocks(rootIDs []string, condition string, limit int) (ret []*Block)
- func GetAllRootBlocks() (ret []*Block)
- func GetBlock(id string) (ret *Block)
- func GetBlocks(ids []string) (ret []*Block)
- func GetChildBlocks(parentID, condition string, limit int) (ret []*Block)
- func QueryBookmarkBlocks() (ret []*Block)
- func QueryBookmarkBlocksByKeyword(bookmark string) (ret []*Block)
- func QueryDefRootBlocksByRefRootID(refRootID string) (ret []*Block)
- func QueryEmptyContentEmbedBlocks() (ret []*Block)
- func QueryRootBlockByCondition(condition string, limit int) (ret []*Block)
- func SelectBlocksRawStmt(stmt string, page, limit int) (ret []*Block)
- func SelectBlocksRawStmtNoParse(stmt string, limit int) (ret []*Block)
- func SelectBlocksRegex(stmt string, exp *regexp.Regexp, name, alias, memo, ial bool, ...) (ret []*Block)
- func ToBlocks(result []map[string]interface{}) (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 int64)
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 GetBlockAttrs ¶
func GetContainerText ¶
func GetDuplicatedRootIDs ¶
func GetFurtherCollections ¶
func GetFurtherCollections(attrView *av.AttributeView, cachedAttrViews map[string]*av.AttributeView) (ret map[string]av.Collection)
func GetRefDuplicatedDefRootIDs ¶
func GetRefDuplicatedDefRootIDs() (ret []string)
func GetRefText ¶
func GetRootUpdated ¶
func GetTemplateKeysByResolutionOrder ¶
func GetTemplateKeysByResolutionOrder(attrView *av.AttributeView) (ret []*av.Key, resolved bool)
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 NodeStaticContent ¶
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 RenderGroupView ¶
func RenderView ¶
func SQLTemplateFuncs ¶
func SetCaseSensitive ¶
func SetCaseSensitive(b bool)
func SetIndexAssetPath ¶
func SetIndexAssetPath(b bool)
func UpdateBlockContentQueue ¶
func UpdateBlockContentQueue(block *Block)
func UpdateRefsTreeQueue ¶
func UpsertTreeQueue ¶
func WaitFlushTx ¶
func WaitFlushTx()
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 QueryBookmarkBlocks ¶
func QueryBookmarkBlocks() (ret []*Block)
func QueryEmptyContentEmbedBlocks ¶
func QueryEmptyContentEmbedBlocks() (ret []*Block)
func SelectBlocksRawStmt ¶
func SelectBlocksRegex ¶
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 ¶
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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.