Documentation
¶
Index ¶
- Constants
- Variables
- func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, ...) (err error)
- func AddAttributeViewKey(avID, keyID, keyName, keyType, keyIcon, previousKeyID string) (err error)
- func AddCustomEmoji(emojiName, imgSrc string)
- func AddMicrosoftDefenderExclusion() error
- func AddSession(sessionID, username string)
- func AddVirtualBlockRefExclude(keyword []string)
- func AddVirtualBlockRefInclude(keyword []string)
- func AddressBooksMetaDataFilePath() string
- func AddressPropsFilter(address *carddav.AddressObject, req *carddav.AddressDataRequest) *carddav.AddressObject
- func AppendAttributeViewDetachedBlocksWithValues(avID string, blocksValues [][]*av.Value) (err error)
- func AppendHeadingChildren(id, childrenDOM string)
- func AutoCheckMicrosoftDefenderJob()
- func AutoGenerateFileHistory()
- func AutoPurgeRepoJob()
- func AutoSpace(rootID string) (err error)
- func BatchReplaceAttributeViewBlocks(avID string, isDetached bool, oldNew []map[string]string) (err error)
- func BatchSetBlockAttrs(blockAttrs []map[string]interface{}) (err error)
- func BatchUpdateAttributeViewCells(tx *Transaction, avID string, values []interface{}) (err error)
- func BatchUpdateBazaarPackages(frontend string)
- func BatchUpdateRecentDocCloseTime(rootIDs []string) (err error)
- func BazaarIcons(keyword string) (icons []*bazaar.Icon)
- func BazaarPlugins(frontend, keyword string) (plugins []*bazaar.Plugin)
- func BazaarTemplates(keyword string) (templates []*bazaar.Template)
- func BazaarThemes(keyword string) (ret []*bazaar.Theme)
- func BazaarWidgets(keyword string) (widgets []*bazaar.Widget)
- func BookmarkLabels() (ret []string)
- func BootSyncData()
- func BuildGraph(query string) (boxID string, nodes []*GraphNode, links []*GraphLink)
- func BuildTreeGraph(id, query string) (boxID string, nodes []*GraphNode, links []*GraphLink)
- func CacheVirtualBlockRefJob()
- func CalendarsMetaDataFilePath() string
- func ChangeAttrViewLayout(blockID, avID string, newLayout av.LayoutType) (err error)
- func ChangeBoxSort(boxIDs []string)
- func ChangeFileTreeSort(boxID string, paths []string)
- func ChangeHistoryTick(minutes int)
- func ChatGPT(msg string) (ret string)
- func ChatGPTWithAction(ids []string, action string) (ret string)
- func CheckActivationcode(code string) (retCode int, msg string)
- func CheckAdminRole(c *gin.Context)
- func CheckAuth(c *gin.Context)
- func CheckBlockRef(ids []string) bool
- func CheckEditRole(c *gin.Context)
- func CheckReadRole(c *gin.Context)
- func CheckReadonly(c *gin.Context)
- func CheckUpdate(showMsg bool)
- func CheckoutRepo(id string)
- func ClearCustomEmojis()
- func ClearOutdatedHistoryDirJob()
- func ClearTempFiles()
- func ClearWorkspaceHistory() (err error)
- func Close(force, setCurrentWorkspace bool, execInstallPkg int) (exitCode int)
- func CloseWatchAssets()
- func CloseWatchEmojis()
- func CloudChatGPT(msg string, contextMsgs []string) (ret string, stop bool, err error)
- func ControlConcurrency(c *gin.Context)
- func CreateBox(name string) (id string, err error)
- func CreateCloudSyncDir(name string) (err error)
- func CreateDailyNote(boxID string) (p string, existed bool, err error)
- func CreateDeck(name string) (deck *riff.Deck, err error)
- func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree, err error)
- func CreateWithMarkdown(tags, boxID, hPath, md, parentID, id string, withMath bool, ...) (retID string, err error)
- func DavPath2DirectoryPath(davPath string) string
- func DeactivateUser() (err error)
- func DeleteSession(sessionID string)
- func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath string, err error)
- func DocAssets(rootID string) (ret []string, err error)
- func DocImageAssets(rootID string) (ret []string, err error)
- func DocSaveAsTemplate(id, name string, overwrite bool) (code int, err error)
- func DownloadCloudSnapshot(tag, id string) (err error)
- func DuplicateDatabaseBlock(avID string) (newAvID, newBlockID string, err error)
- func DuplicateDoc(tree *parse.Tree)
- func Export2Liandi(id string) (err error)
- func ExportAddressBook(addressBookPath string) (cardContent string, err error)
- func ExportAv2CSV(avID, blockID string) (zipPath string, err error)
- func ExportCodeBlock(blockID string) (filePath string, err error)
- func ExportData() (zipPath string, err error)
- func ExportDataInFolder(exportFolder string) (name string, err error)
- func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string, err error)
- func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, dom string, node *ast.Node)
- func ExportMarkdownContent(id string, refMode, embedMode int, ...) (hPath, exportedMd string)
- func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string)
- func ExportNotebookMarkdown(boxID string) (zipPath string)
- func ExportNotebookSY(id string) (zipPath string)
- func ExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipPath string)
- func ExportPreview(id string, fillCSSVar bool) (retStdHTML string)
- func ExportResources(resourcePaths []string, mainName string) (exportFilePath string, err error)
- func ExportSYs(ids []string) (zipPath string)
- func ExportStdMarkdown(id string, ...) string
- func ExportSystemLog() (zipPath string)
- func FileETag(fileInfo fs.FileInfo) string
- func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids []string, ...) (err error)
- func FlushAssetsTextsJob()
- func FlushTxQueue()
- func FlushUpdateRefTextRenameDocJob()
- func FullReindex()
- func FullTextSearchHistory(query, box, op string, typ, page int) (ret []string, pageCount, totalCount int)
- func GenerateAssetsThumbnail(sourceImgPath, resizedImgPath string) (err error)
- func GenerateFileHistory()
- func GetAssetAbsPath(relativePath string) (ret string, err error)
- func GetAssetImgSize(assetPath string) (width, height int)
- func GetAssetPathByHash(hash string) string
- func GetAttrViewAddingBlockDefaultValues(avID, viewID, groupID, previousBlockID, addingBlockID string) (ret map[string]*av.Value)
- func GetAttributeView(avID string) (ret *av.AttributeView)
- func GetAttributeViewBoundBlockIDs(avID string, itemIDs []string) (ret map[string]string)
- func GetAttributeViewFilterSort(avID, blockID string) (filters []*av.ViewFilter, sorts []*av.ViewSort)
- func GetAttributeViewItemIDs(avID string, blockIDs []string) (ret map[string]string)
- func GetAttributeViewKeysByID(avID string, keyIDs ...string) (ret []*av.Key)
- func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int) (attributeViewName string, databaseBlockIDs []string, keyValues *av.KeyValues, ...)
- func GetBasicAuthUsernameBySessionID(sessionID string) string
- func GetBlockDOM(id string) (ret string)
- func GetBlockDOMWithEmbed(id string) (ret string)
- func GetBlockDOMs(ids []string) (ret map[string]string)
- func GetBlockDOMsWithEmbed(ids []string) (ret map[string]string)
- func GetBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []string)
- func GetBlockIndex(id string) (ret int)
- func GetBlockKramdown(id, mode string) (ret string)
- func GetBlockKramdowns(ids []string, mode string) (ret map[string]string)
- func GetBlockRefIDsByFileAnnotationID(id string) []string
- func GetBlockRefText(id string) string
- func GetBlockRelevantIDs(id string) (parentID, previousID, nextID string, err error)
- func GetBlockSiblingID(id string) (parent, previous, next string)
- func GetBlockTreeInfos(ids []string) (ret map[string]*BlockTreeInfo)
- func GetBlocksIndexes(ids []string) (ret map[string]int)
- func GetCaptcha(c *gin.Context)
- func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount int, err error)
- func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error)
- func GetCloudShorthand(id string) (ret map[string]interface{}, err error)
- func GetCloudShorthands(page int) (result map[string]interface{}, err error)
- func GetCloudSpace() (s *Sync, b *Backup, ...)
- func GetCurrentAttributeViewImages(avID, viewID, query string) (ret []string, err error)
- func GetDOMText(dom string) (ret string)
- func GetDecks() (decks []*riff.Deck)
- func GetDoc(startID, endID, id string, index int, query string, queryTypes map[string]bool, ...) (blockCount int, dom, parentID, parent2ID, rootID, typ string, eof, scroll bool, ...)
- func GetDocHistoryContent(historyPath, keyword string, highlight bool) (id, rootID, content string, isLargeDoc bool, err error)
- func GetFullHPathByID(id string) (hPath string, err error)
- func GetHPathByID(id string) (hPath string, err error)
- func GetHPathByPath(boxID, p string) (hPath string, err error)
- func GetHPathsByPaths(paths []string) (hPaths []string, err error)
- func GetHeadingChildrenDOM(id string, removeFoldAttr bool) (ret string)
- func GetHeadingChildrenIDs(id string) (ret []string)
- func GetHistoryDir(suffix string) (ret string, err error)
- func GetIDsByHPath(hpath, boxID string) (ret []string, err error)
- func GetLocalStorage() (ret map[string]interface{})
- func GetNewSessionID() string
- func GetOutlineStorage(docID string) (ret map[string]interface{}, err error)
- func GetPackageREADME(repoURL, repoHash, packageType string) (ret string)
- func GetPathByID(id string) (path, boxID string, err error)
- func GetRepoFile(fileID string) (ret []byte, p string, err error)
- func GetTokenClaims(token *jwt.Token) jwt.MapClaims
- func GetUnfoldedParentID(id string) (parentID string)
- func HTML2Markdown(htmlStr string, luteEngine *lute.Lute) (markdown string, withMath bool, err error)
- func HTML2Tree(htmlStr string, luteEngine *lute.Lute) (tree *parse.Tree, withMath bool)
- func HandleAssetsChangeEvent(assetAbsPath string)
- func HandleAssetsRemoveEvent(assetAbsPath string)
- func HandleSignal()
- func Heading2Doc(srcHeadingID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error)
- func HideConfSecret(c *AppConf)
- func HookDesktopUIProcJob()
- func ImportData(zipPath string) (err error)
- func ImportFromLocalPath(boxID, localPath string, toPath string) (err error)
- func ImportRepoKey(base64Key string) (retKey string, err error)
- func ImportSY(zipPath, boxID, toPath string) (err error)
- func IncSync()
- func IndexEmbedBlockJob()
- func IndexRefs()
- func IndexRepo(memo string) (err error)
- func InitAccounts()
- func InitAppearance()
- func InitBoxes()
- func InitConf()
- func InitJWT()
- func InitRepoKey() (err error)
- func InitRepoKeyFromPassphrase(passphrase string) (err error)
- func InsertLocalAssets(id string, assetAbsPaths []string, isUpload bool) (succMap map[string]interface{}, err error)
- func InstallBazaarIcon(repoURL, repoHash, iconName string) error
- func InstallBazaarPlugin(repoURL, repoHash, pluginName string) error
- func InstallBazaarTemplate(repoURL, repoHash, templateName string) error
- func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bool) error
- func InstallBazaarWidget(repoURL, repoHash, widgetName string) error
- func InstalledIcons(keyword string) (icons []*bazaar.Icon)
- func InstalledPlugins(frontend, keyword string) (plugins []*bazaar.Plugin)
- func InstalledTemplates(keyword string) (templates []*bazaar.Template)
- func InstalledThemes(keyword string) (ret []*bazaar.Theme)
- func InstalledWidgets(keyword string) (widgets []*bazaar.Widget)
- func IsAdminRoleContext(c *gin.Context) bool
- func IsBlockFolded(id string) (isFolded, isRoot bool)
- func IsMoveOutlineHeading(transactions *[]*Transaction) bool
- func IsPaidUser() bool
- func IsPublishServiceToken(token *jwt.Token) bool
- func IsReadOnlyRole(role Role) bool
- func IsSubscriber() bool
- func IsSyncingFile(rootID string) (ret bool)
- func IsUserGuide(boxID string) bool
- func IsValidRole(role Role, roles []Role) bool
- func ListItem2Doc(srcListItemID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error)
- func LoadCalendarObject(filePath string) (calendar *ical.Calendar, err error)
- func LoadCards(filePath string) (cards []*vcard.Card, err error)
- func LoadFlashcards()
- func LoadSnippets() (ret []*conf.Snippet, err error)
- func LoadTreeByBlockID(id string) (ret *parse.Tree, err error)
- func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error)
- func LoadUploadToken() (err error)
- func Login(userName, password, captcha string, cloudRegion int) (ret *gulu.Result)
- func Login2fa(token, code string) (map[string]interface{}, error)
- func LoginAuth(c *gin.Context)
- func LogoutAuth(c *gin.Context)
- func LogoutUser()
- func Mount(boxID string) (alreadyMount bool, err error)
- func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{}) (err error)
- func MoveLocalShorthands(boxID, hPath, parentID string) (retIDs []string, err error)
- func NeedGenerateAssetsThumbnail(sourceImgPath string) bool
- func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err error)
- func NewLute() (ret *lute.Lute)
- func OCRAssetsJob()
- func OpenRepoSnapshotDoc(fileID string) (title, content string, displayInText bool, updated int64, err error)
- func ParseAddressPath(addressPath string) (addressBookPath string, addressID string, err error)
- func ParseCalendarObjectPath(objectPath string) (calendarPath string, objectID string, err error)
- func ParseJWT(tokenString string) (*jwt.Token, error)
- func ParseXAuthToken(r *http.Request) *jwt.Token
- func PathCleanWithSlash(p string) string
- func PathJoinWithSlash(elems ...string) string
- func PdfListLinks(ctx *model.Context) (assets, others []model.LinkAnnotation, err error)
- func PdfListToCLinks(ctx *model.Context) (ret []model.LinkAnnotation, err error)
- func PerformTransactions(transactions *[]*Transaction)
- func ProcessPDF(id, p string, merge, removeAssets, watermark bool) (err error)
- func PurgeCloud() (err error)
- func PurgeRepo() (err error)
- func PushReloadPlugin(...)
- func PushReloadSnippet(snippet *conf.Snpt)
- func Recover(c *gin.Context)
- func RefreshBacklink(id string)
- func RefreshCheckJob2H()
- func RefreshCheckJob6H()
- func RefreshUser(token string)
- func ReindexAssetContent()
- func ReindexHistory()
- func ReloadAttrView(avID string)
- func ReloadFiletree()
- func ReloadIcon()
- func ReloadProtyle(rootID string)
- func ReloadTag()
- func RemoveAttributeViewBlock(srcIDs []string, avID string) (err error)
- func RemoveAttributeViewKey(avID, keyID string, removeRelationDest bool) (err error)
- func RemoveBookmark(bookmark string) (err error)
- func RemoveBox(boxID string) (err error)
- func RemoveCloudRepoTag(tag string) (err error)
- func RemoveCloudShorthands(ids []string) (err error)
- func RemoveCloudSyncDir(name string) (err error)
- func RemoveCriterion(name string) (err error)
- func RemoveDeck(deckID string) (err error)
- func RemoveDoc(boxID, p string)
- func RemoveDocs(paths []string)
- func RemoveIndexes(paths []string)
- func RemoveLocalStorageVals(keys []string) (err error)
- func RemoveOutlineStorage(docID string) (err error)
- func RemoveSnippet(id string) (ret *conf.Snippet, err error)
- func RemoveTag(label string) (err error)
- func RemoveTagSnapshot(tag string) (err error)
- func RemoveTemplate(p string) (err error)
- func RemoveUnusedAsset(p string) (ret string)
- func RemoveUnusedAssets() (ret []string)
- func RemoveUnusedAttributeView(id string)
- func RemoveUnusedAttributeViews() (ret []string)
- func RenameAsset(oldPath, newName string) (newPath string, err error)
- func RenameBookmark(oldBookmark, newBookmark string) (err error)
- func RenameBox(boxID, name string) (err error)
- func RenameDeck(deckID, name string) (err error)
- func RenameDoc(boxID, p, title string) (err error)
- func RenameTag(oldLabel, newLabel string) (err error)
- func RenderAttributeView(blockID, avID, viewID, query string, page, pageSize int, ...) (viewable av.Viewable, attrView *av.AttributeView, err error)
- func RenderDynamicIconContentTemplate(content, id string) (ret string)
- func RenderGoTemplate(templateContent string) (ret string, err error)
- func RenderHistoryAttributeView(blockID, avID, viewID, query string, page, pageSize int, ...) (viewable av.Viewable, attrView *av.AttributeView, err error)
- func RenderRepoSnapshotAttributeView(indexID, avID string) (viewable av.Viewable, attrView *av.AttributeView, err error)
- func RenderTemplate(p, id string, preview bool) (tree *parse.Tree, dom string, err error)
- func ResetBlockAttrs(id string, nameValues map[string]string) (err error)
- func ResetFlashcards(typ, id, deckID string, blockIDs []string)
- func ResetRepo() (err error)
- func ResetVirtualBlockRefCache()
- func ReviewFlashcard(deckID, cardID string, rating riff.Rating, reviewedCardIDs []string) (err error)
- func RollbackAssetsHistory(historyPath string) (err error)
- func RollbackAttributeViewHistory(historyPath string) (err error)
- func RollbackDocHistory(boxID, historyPath string) (err error)
- func RollbackNotebookHistory(historyPath string) (err error)
- func SaveMetaData[T []*caldav.Calendar | []*carddav.AddressBook](metaData T, metaDataFilePath string) error
- func SearchAssetsByName(keyword string, exts []string) (ret []*cache.Asset)
- func SearchAttributeViewNonRelationKey(avID, keyword string) (ret []*av.Key)
- func SearchAttributeViewRelationKey(avID, keyword string) (ret []*av.Key)
- func SearchAttributeViewRollupDestKeys(avID, keyword string) (ret []*av.Key)
- func SearchDocs(keyword string, flashcard bool, excludeIDs []string) (ret []map[string]string)
- func SearchTags(keyword string) (ret []string)
- func SetAttributeViewGroup(avID, blockID string, group *av.ViewGroup) (err error)
- func SetBlockAttrs(id string, nameValues map[string]string) (err error)
- func SetBlockReminder(id string, timed string) (err error)
- func SetBoxIcon(boxID, icon string)
- func SetCloudBlockReminder(id, data string, timed int64) (err error)
- func SetCloudSyncDir(name string)
- func SetCriterion(criterion *Criterion) (err error)
- func SetDatabaseBlockView(blockID, avID, viewID string) (err error)
- func SetFlashcardsDueTime(cardDues []*SetFlashcardDueTime) (err error)
- func SetLocalStorage(val interface{}) (err error)
- func SetLocalStorageVal(key string, val interface{}) (err error)
- func SetOutlineStorage(docID string, val interface{}) (err error)
- func SetSnippet(snippets []*conf.Snippet) (err error)
- func SetSyncEnable(b bool)
- func SetSyncGenerateConflictDoc(b bool)
- func SetSyncInterval(interval int)
- func SetSyncMode(mode int)
- func SetSyncPerception(b bool)
- func SetSyncProvider(provider int) (err error)
- func SetSyncProviderLocal(local *conf.Local) (err error)
- func SetSyncProviderS3(s3 *conf.S3) (err error)
- func SetSyncProviderWebDAV(webdav *conf.WebDAV) (err error)
- func SkipReviewFlashcard(deckID, cardID string) (err error)
- func SortAttributeViewKey(avID, keyID, previousKeyID string) (err error)
- func SortAttributeViewViewKey(avID, blockID, keyID, previousKeyID string) (err error)
- func StartFreeTrial() (err error)
- func StatJob()
- func SwapBlockRef(refID, defID string, includeChildren bool) (err error)
- func SyncData(byHand bool)
- func SyncDataDownload()
- func SyncDataJob()
- func SyncDataUpload()
- func TagSnapshot(id, name string) (err error)
- func Timing(c *gin.Context)
- func TransferBlockRef(fromID, toID string, refIDs []string) (err error)
- func UninstallBazaarIcon(iconName string) error
- func UninstallBazaarPlugin(pluginName, frontend string) error
- func UninstallBazaarTemplate(templateName string) error
- func UninstallBazaarTheme(themeName string) error
- func UninstallBazaarWidget(widgetName string) error
- func Unmount(boxID string)
- func UpdateAttributeViewCell(tx *Transaction, avID, keyID, itemID string, valueData interface{}) (val *av.Value, err error)
- func UpdateEmbedBlock(id, content string) (err error)
- func UpdateRecentDocCloseTime(rootID string) (err error)
- func UpdateRecentDocOpenTime(rootID string) (err error)
- func UpdateRecentDocViewTime(rootID string) (err error)
- func UpdatedPackages(frontend string) (plugins []*bazaar.Plugin, widgets []*bazaar.Widget, icons []*bazaar.Icon, ...)
- func Upload(c *gin.Context)
- func UploadAssets2Cloud(id string, ignorePushMsg bool) (count int, err error)
- func UploadAssets2CloudByAssetsPaths(assetPaths []string, ignorePushMsg bool) (count int, err error)
- func UploadCloudSnapshot(tag, id string) (err error)
- func UpsertIndexes(paths []string)
- func UseActivationcode(code string) (err error)
- func VacuumDataIndex()
- func WatchAssets()
- func WatchEmojis()
- func WatchLocalShorthands()
- type Account
- type AccountsMap
- type AddressBook
- type AddressObject
- type Announcement
- type AppConf
- func (conf *AppConf) Box(boxID string) *Box
- func (conf *AppConf) BoxNames(boxIDs []string) (ret map[string]string)
- func (conf *AppConf) Close()
- func (conf *AppConf) GetBox(boxID string) *Box
- func (conf *AppConf) GetBoxes() (ret []*Box)
- func (conf *AppConf) GetClosedBoxes() (ret []*Box)
- func (conf *AppConf) GetOpenedBoxes() (ret []*Box)
- func (conf *AppConf) GetUILayout() *conf.UILayout
- func (conf *AppConf) GetUser() *conf.User
- func (conf *AppConf) Language(num int) (ret string)
- func (conf *AppConf) Save()
- func (conf *AppConf) SetUILayout(uiLayout *conf.UILayout)
- func (conf *AppConf) SetUser(user *conf.User)
- type AssetContent
- type AssetParseResult
- type AssetParser
- type AssetsSearcher
- type AttrView
- type AvSearchResult
- type AvSearchTempResult
- type Backlink
- type Backup
- type Block
- func FullTextSearchBlock(query string, boxes, paths []string, types map[string]bool, ...) (ret []*Block, matchedBlockCount, matchedRootCount, pageCount int, docMode bool)
- func GetBlock(id string, tree *parse.Tree) (ret *Block, err error)
- func GetDeckFlashcards(deckID string, page, pageSize int) (blocks []*Block, total, pageCount int)
- func GetFlashcardsByBlockIDs(blockIDs []string) (ret []*Block)
- func GetNotebookFlashcards(boxID string, page, pageSize int) (blocks []*Block, total, pageCount int)
- func GetTreeFlashcards(rootID string, page, pageSize int) (blocks []*Block, total, pageCount int)
- func ListInvalidBlockRefs(page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount, pageCount int)
- func RecentUpdatedBlocks() (ret []*Block)
- func SearchRefBlock(id, rootID, keyword string, beforeLen int, isSquareBrackets, isDatabase bool) (ret []*Block, newDoc bool)
- func SearchTemplate(keyword string) (ret []*Block)
- func SearchWidget(keyword string) (ret []*Block)
- type BlockAttributeViewKeys
- type BlockInfo
- type BlockPath
- type BlockTreeInfo
- type Bookmark
- type BookmarkBlocks
- type BookmarkLabel
- type Bookmarks
- type Box
- func (box *Box) Exist(p string) bool
- func (box *Box) GetConf() (ret *conf.BoxConf)
- func (box *Box) GetInfo() (ret *BoxInfo)
- func (box *Box) Index()
- func (box *Box) ListFiles(path string) (ret []*FileInfo)
- func (box *Box) Ls(p string) (ret []*FileInfo, totals int, err error)
- func (box *Box) Mkdir(path string) error
- func (box *Box) MkdirAll(path string) error
- func (box *Box) Move(oldPath, newPath string) error
- func (box *Box) Remove(path string) error
- func (box *Box) SaveConf(conf *conf.BoxConf)
- func (box *Box) Stat(p string) (ret *FileInfo)
- func (box *Box) Unindex()
- func (box *Box) UpdateHistoryGenerated()
- type BoxInfo
- type CalDavBackend
- func (b *CalDavBackend) CalendarHomeSetPath(ctx context.Context) (string, error)
- func (b *CalDavBackend) CreateCalendar(ctx context.Context, calendar *caldav.Calendar) (err error)
- func (b *CalDavBackend) CurrentUserPrincipal(ctx context.Context) (string, error)
- func (b *CalDavBackend) DeleteCalendar(ctx context.Context, calendarPath string) (err error)
- func (b *CalDavBackend) DeleteCalendarObject(ctx context.Context, objectPath string) (err error)
- func (b *CalDavBackend) GetCalendar(ctx context.Context, calendarPath string) (calendar *caldav.Calendar, err error)
- func (b *CalDavBackend) GetCalendarObject(ctx context.Context, objectPath string, req *caldav.CalendarCompRequest) (calendarObject *caldav.CalendarObject, err error)
- func (b *CalDavBackend) ListCalendarObjects(ctx context.Context, calendarPath string, req *caldav.CalendarCompRequest) (calendarObjects []caldav.CalendarObject, err error)
- func (b *CalDavBackend) ListCalendars(ctx context.Context) (calendars_ []caldav.Calendar, err error)
- func (b *CalDavBackend) PutCalendarObject(ctx context.Context, objectPath string, calendar *ical.Calendar, ...) (calendarObject *caldav.CalendarObject, err error)
- func (b *CalDavBackend) QueryCalendarObjects(ctx context.Context, calendarPath string, query *caldav.CalendarQuery) (calendarObjects []caldav.CalendarObject, err error)
- type CalDavPathDepth
- type Calendar
- type CalendarObject
- type Calendars
- func (c *Calendars) CreateCalendar(calendarMetaData *caldav.Calendar) (err error)
- func (c *Calendars) DeleteCalendar(calendarPath string) (err error)
- func (c *Calendars) DeleteCalendarObject(objectPath string) (err error)
- func (c *Calendars) DeleteObject(objectPath string) (calendar *Calendar, calendarObject *CalendarObject, err error)
- func (c *Calendars) GetCalendar(calendarPath string) (calendar *caldav.Calendar, err error)
- func (c *Calendars) GetCalendarObject(objectPath string, req *caldav.CalendarCompRequest) (calendarObject *caldav.CalendarObject, err error)
- func (c *Calendars) GetObject(objectPath string) (calendar *Calendar, calendarObject *CalendarObject, err error)
- func (c *Calendars) ListCalendarObjects(calendarPath string, req *caldav.CalendarCompRequest) (calendarObjects []caldav.CalendarObject, err error)
- func (c *Calendars) ListCalendars() (calendars []caldav.Calendar, err error)
- func (c *Calendars) Load() error
- func (c *Calendars) PutCalendarObject(objectPath string, calendarData *ical.Calendar, ...) (calendarObject *caldav.CalendarObject, err error)
- func (c *Calendars) QueryCalendarObjects(calendarPath string, query *caldav.CalendarQuery) (calendarObjects []caldav.CalendarObject, err error)
- type CardDavBackend
- func (b *CardDavBackend) AddressBookHomeSetPath(ctx context.Context) (string, error)
- func (b *CardDavBackend) CreateAddressBook(ctx context.Context, addressBook *carddav.AddressBook) (err error)
- func (b *CardDavBackend) CurrentUserPrincipal(ctx context.Context) (string, error)
- func (b *CardDavBackend) DeleteAddressBook(ctx context.Context, bookPath string) (err error)
- func (b *CardDavBackend) DeleteAddressObject(ctx context.Context, addressPath string) (err error)
- func (b *CardDavBackend) GetAddressBook(ctx context.Context, bookPath string) (addressBook *carddav.AddressBook, err error)
- func (b *CardDavBackend) GetAddressObject(ctx context.Context, addressPath string, req *carddav.AddressDataRequest) (addressObject *carddav.AddressObject, err error)
- func (b *CardDavBackend) ListAddressBooks(ctx context.Context) (addressBooks []carddav.AddressBook, err error)
- func (b *CardDavBackend) ListAddressObjects(ctx context.Context, bookPath string, req *carddav.AddressDataRequest) (addressObjects []carddav.AddressObject, err error)
- func (b *CardDavBackend) PutAddressObject(ctx context.Context, addressPath string, card vcard.Card, ...) (addressObject *carddav.AddressObject, err error)
- func (b *CardDavBackend) QueryAddressObjects(ctx context.Context, urlPath string, query *carddav.AddressBookQuery) (addressObjects []carddav.AddressObject, err error)
- type CardDavPathDepth
- type ChildBlock
- type ClaimsKeyType
- type CloudGPT
- type Contacts
- func (c *Contacts) CreateAddressBook(addressBookMetaData *carddav.AddressBook) (err error)
- func (c *Contacts) DeleteAddress(addressPath string) (addressBook *AddressBook, addressObject *AddressObject, err error)
- func (c *Contacts) DeleteAddressBook(path string) (err error)
- func (c *Contacts) DeleteAddressObject(addressPath string) (err error)
- func (c *Contacts) GetAddress(addressPath string) (addressBook *AddressBook, addressObject *AddressObject, err error)
- func (c *Contacts) GetAddressBook(path string) (addressBook *carddav.AddressBook, err error)
- func (c *Contacts) GetAddressObject(addressPath string, req *carddav.AddressDataRequest) (addressObject *carddav.AddressObject, err error)
- func (c *Contacts) ListAddressBooks() (addressBooks []carddav.AddressBook, err error)
- func (c *Contacts) ListAddressObjects(bookPath string, req *carddav.AddressDataRequest) (addressObjects []carddav.AddressObject, err error)
- func (c *Contacts) Load() error
- func (c *Contacts) PutAddressObject(addressPath string, card vcard.Card, opts *carddav.PutAddressObjectOptions) (addressObject *carddav.AddressObject, err error)
- func (c *Contacts) QueryAddressObjects(urlPath string, query *carddav.AddressBookQuery) (addressObjects []carddav.AddressObject, err error)
- type Criterion
- type CriterionReplaceTypes
- type CriterionTypes
- type DiffFile
- type DiffIndex
- type DocxAssetParser
- type EmbedBlock
- type EpubAssetParser
- type File
- type FileInfo
- type Flashcard
- type GPT
- type GraphArrows
- type GraphArrowsTo
- type GraphLink
- type GraphNode
- type GroupState
- type History
- type HistoryItem
- type LeftRightDiff
- type OnlineKernel
- type OpenAIGPT
- type Operation
- type OutlineDoc
- type Path
- func GetBacklink(id, keyword, mentionKeyword string, beforeLen int, containChildren bool) (boxID string, linkPaths, mentionPaths []*Path, ...)
- func GetBacklink2(id, keyword, mentionKeyword string, sortMode, mentionSortMode int, ...) (boxID string, backlinks, backmentions []*Path, ...)
- func Outline(rootID string, preview bool) (ret []*Path, err error)
- type PdfAssetParser
- type Petal
- type PptxAssetParser
- type RecentDoc
- type RefDefs
- type RiffCard
- type Role
- type SessionsMap
- type SetFlashcardDueTime
- type Snapshot
- type Sync
- type Tag
- type TagBlocks
- type Tags
- type Transaction
- type TxErr
- type TxtAssetParser
- type TypeCount
- type UnusedItem
- type XlsxAssetParser
Constants ¶
const ( TxtAssetContentMaxSize = 1024 * 1024 * 4 PDFAssetContentMaxPage = 1024 )
const ( XAuthTokenKey = "X-Auth-Token" SessionIdCookieName = "publish-visitor-session-id" ClaimsContextKey = "claims" ClaimsKeyRole string = "role" )
const ( // REF: https://developers.google.com/calendar/caldav/v2/guide CalDavPrefixPath = "/caldav" CalDavPrincipalsPath = CalDavPrefixPath + "/principals" // 0 resourceTypeRoot CalDavUserPrincipalPath = CalDavPrincipalsPath + "/main" // 1 resourceTypeUserPrincipal CalDavHomeSetPath = CalDavUserPrincipalPath + "/calendars" // 2 resourceTypeCalendarHomeSet CalDavDefaultCalendarPath = CalDavHomeSetPath + "/default" // 3 resourceTypeCalendar CalDavDefaultCalendarName = "default" CalDavCalendarsMetaDataFilePath = CalDavHomeSetPath + "/calendars.json" ICalendarFileExt = "." + ical.Extension // .ics )
const ( // REF: https://developers.google.com/people/carddav#resources CardDavPrefixPath = "/carddav" CardDavPrincipalsPath = CardDavPrefixPath + "/principals" // 0 resourceTypeRoot CardDavUserPrincipalPath = CardDavPrincipalsPath + "/main" // 1 resourceTypeUserPrincipal CardDavHomeSetPath = CardDavUserPrincipalPath + "/contacts" // 2 resourceTypeAddressBookHomeSet CardDavDefaultAddressBookPath = CardDavHomeSetPath + "/default" // 3 resourceTypeAddressBook CardDavDefaultAddressBookName = "default" CardDavAddressBooksMetaDataFilePath = CardDavHomeSetPath + "/address-books.json" VCardFileExt = "." + vcard.Extension // .vcf )
const ( MaskedUserData = "" MaskedAccessAuthCode = "*******" )
const ( HistoryOpClean = "clean" HistoryOpUpdate = "update" HistoryOpDelete = "delete" HistoryOpFormat = "format" HistoryOpSync = "sync" HistoryOpReplace = "replace" HistoryOpOutline = "outline" )
const ( HistoryTypeDocName = 0 // Search docs by doc name HistoryTypeDoc = 1 // Search docs by doc name and content HistoryTypeAsset = 2 // Search assets HistoryTypeDocID = 3 // Search docs by doc id HistoryTypeDatabase = 4 // Search databases by database id )
const ( TxErrCodeBlockNotFound = 0 TxErrCodeDataIsSyncing = 1 TxErrCodeWriteTree = 2 TxErrHandleAttributeView = 3 )
const DailyNoteAttrPrefix = "custom-dailynote-"
const (
NodeAttrRiffDecks = "custom-riff-decks"
)
const PdfOutlineScheme = "pdf-outline"
const (
RoleContextKey = "role"
)
Variables ¶
var ( ErrorCalDavPathInvalid = errors.New("CalDAV: path is invalid") ErrorCalDavCalendarNotFound = errors.New("CalDAV: calendar not found") ErrorCalDavCalendarPathInvalid = errors.New("CalDAV: calendar path is invalid") ErrorCalDavCalendarObjectNotFound = errors.New("CalDAV: calendar object not found") ErrorCalDavCalendarObjectPathInvalid = errors.New("CalDAV: calendar object path is invalid") )
var ( ErrorCardDavPathInvalid = errors.New("CardDAV: path is invalid") ErrorCardDavBookNotFound = errors.New("CardDAV: address book not found") ErrorCardDavBookPathInvalid = errors.New("CardDAV: address book path is invalid") ErrorCardDavAddressNotFound = errors.New("CardDAV: address not found") ErrorCardDavAddressFileExtensionNameInvalid = errors.New("CardDAV: address file extension name is invalid") )
var ( BasicAuthHeaderKey = "WWW-Authenticate" BasicAuthHeaderValue = "Basic realm=\"SiYuan Authorization Require\", charset=\"UTF-8\"" )
var ( BootSyncSucc = -1 // -1:未执行,0:执行成功,1:执行失败 ExitSyncSucc = -1 )
var ( ErrBoxNotFound = errors.New("notebook not found") ErrBlockNotFound = errors.New("block not found") ErrTreeNotFound = errors.New("tree not found") ErrIndexing = errors.New("indexing") ErrBoxUnindexed = errors.New("notebook unindexed") ErrInvalidID = errors.New("invalid id") )
var (
AssetsSearchEnabled = true
)
var (
Decks = map[string]*riff.Deck{}
)
var ErrFailedToConnectCloudServer = errors.New("failed to connect cloud server")
var KernelID = gulu.Rand.String(7)
var (
PDFAssetContentMaxSize uint64 = 1024 * 1024 * 128
)
Functions ¶
func AddAttributeViewBlock ¶
func AddAttributeViewKey ¶
func AddCustomEmoji ¶
func AddCustomEmoji(emojiName, imgSrc string)
func AddMicrosoftDefenderExclusion ¶
func AddMicrosoftDefenderExclusion() error
func AddSession ¶
func AddSession(sessionID, username string)
func AddVirtualBlockRefExclude ¶
func AddVirtualBlockRefExclude(keyword []string)
func AddVirtualBlockRefInclude ¶
func AddVirtualBlockRefInclude(keyword []string)
func AddressBooksMetaDataFilePath ¶
func AddressBooksMetaDataFilePath() string
AddressBooksMetaDataFilePath returns the absolute path of the address books meta data file
func AddressPropsFilter ¶
func AddressPropsFilter(address *carddav.AddressObject, req *carddav.AddressDataRequest) *carddav.AddressObject
AddressPropsFilter filters address properties
func AppendHeadingChildren ¶
func AppendHeadingChildren(id, childrenDOM string)
func AutoCheckMicrosoftDefenderJob ¶
func AutoCheckMicrosoftDefenderJob()
func AutoGenerateFileHistory ¶
func AutoGenerateFileHistory()
func AutoPurgeRepoJob ¶
func AutoPurgeRepoJob()
AutoPurgeRepoJob 自动清理数据仓库 https://github.com/siyuan-note/siyuan/issues/13091
func BatchSetBlockAttrs ¶
func BatchUpdateAttributeViewCells ¶
func BatchUpdateAttributeViewCells(tx *Transaction, avID string, values []interface{}) (err error)
func BatchUpdateBazaarPackages ¶
func BatchUpdateBazaarPackages(frontend string)
func BatchUpdateRecentDocCloseTime ¶
BatchUpdateRecentDocCloseTime 批量更新文档关闭时间
func BazaarIcons ¶
func BazaarPlugins ¶
func BazaarTemplates ¶
func BazaarThemes ¶
func BazaarWidgets ¶
func BookmarkLabels ¶
func BookmarkLabels() (ret []string)
func BootSyncData ¶
func BootSyncData()
func BuildGraph ¶
func BuildTreeGraph ¶
func CacheVirtualBlockRefJob ¶
func CacheVirtualBlockRefJob()
func CalendarsMetaDataFilePath ¶
func CalendarsMetaDataFilePath() string
CalendarsMetaDataFilePath returns the absolute path of the calendars' meta data file
func ChangeAttrViewLayout ¶
func ChangeAttrViewLayout(blockID, avID string, newLayout av.LayoutType) (err error)
func ChangeBoxSort ¶
func ChangeBoxSort(boxIDs []string)
func ChangeFileTreeSort ¶
func ChangeHistoryTick ¶
func ChangeHistoryTick(minutes int)
func ChatGPTWithAction ¶
func CheckActivationcode ¶
func CheckAdminRole ¶
func CheckBlockRef ¶
func CheckEditRole ¶
func CheckReadRole ¶
func CheckReadonly ¶
func CheckUpdate ¶
func CheckUpdate(showMsg bool)
func CheckoutRepo ¶
func CheckoutRepo(id string)
func ClearCustomEmojis ¶
func ClearCustomEmojis()
func ClearOutdatedHistoryDirJob ¶
func ClearOutdatedHistoryDirJob()
func ClearTempFiles ¶
func ClearTempFiles()
func ClearWorkspaceHistory ¶
func ClearWorkspaceHistory() (err error)
func Close ¶
Close 退出内核进程.
force:是否不执行同步过程而直接退出
setCurrentWorkspace:是否将当前工作空间放到工作空间列表的最后一个
execInstallPkg:是否执行新版本安装包
0:默认按照设置项 System.DownloadInstallPkg 检查并推送提示 1:不执行新版本安装 2:执行新版本安装
返回值 exitCode:
0:正常退出 1:同步执行失败 2:提示新安装包
当 force 为 true(强制退出)并且 execInstallPkg 为 0(默认检查更新)并且同步失败并且新版本安装版已经准备就绪时,执行新版本安装 https://github.com/siyuan-note/siyuan/issues/10288
func CloseWatchAssets ¶
func CloseWatchAssets()
func CloseWatchEmojis ¶
func CloseWatchEmojis()
func CloudChatGPT ¶
func ControlConcurrency ¶
func CreateCloudSyncDir ¶
func CreateDocByMd ¶
func CreateWithMarkdown ¶
func DavPath2DirectoryPath ¶
DavPath2DirectoryPath converts CalDAV/CardDAV path to absolute path of the file system
func DeactivateUser ¶
func DeactivateUser() (err error)
func DeleteSession ¶
func DeleteSession(sessionID string)
func Doc2Heading ¶
func DocImageAssets ¶
func DocSaveAsTemplate ¶
func DownloadCloudSnapshot ¶
func DuplicateDatabaseBlock ¶
func DuplicateDoc ¶
func Export2Liandi ¶
func ExportAddressBook ¶
ExportAddressBook exports a address book to a vCard file (*.vcf)
func ExportAv2CSV ¶
func ExportCodeBlock ¶
func ExportData ¶
func ExportDataInFolder ¶
func ExportDocx ¶
func ExportHTML ¶
func ExportMarkdownContent ¶
func ExportMarkdownHTML ¶
func ExportNotebookMarkdown ¶
func ExportNotebookSY ¶
func ExportPandocConvertZip ¶
func ExportPreview ¶
func ExportResources ¶
func ExportStdMarkdown ¶
func ExportSystemLog ¶
func ExportSystemLog() (zipPath string)
func FindReplace ¶
func FlushAssetsTextsJob ¶
func FlushAssetsTextsJob()
func FlushTxQueue ¶
func FlushTxQueue()
func FlushUpdateRefTextRenameDocJob ¶
func FlushUpdateRefTextRenameDocJob()
func FullReindex ¶
func FullReindex()
func FullTextSearchHistory ¶
func GenerateAssetsThumbnail ¶
func GenerateFileHistory ¶
func GenerateFileHistory()
func GetAssetAbsPath ¶
func GetAssetImgSize ¶
func GetAssetPathByHash ¶
func GetAttributeView ¶
func GetAttributeView(avID string) (ret *av.AttributeView)
func GetAttributeViewFilterSort ¶
func GetAttributeViewFilterSort(avID, blockID string) (filters []*av.ViewFilter, sorts []*av.ViewSort)
func GetAttributeViewItemIDs ¶
func GetBlockDOM ¶
func GetBlockDOMWithEmbed ¶
func GetBlockDOMs ¶
func GetBlockDOMsWithEmbed ¶
func GetBlockDefIDsByRefText ¶
func GetBlockIndex ¶
func GetBlockKramdown ¶
func GetBlockRefText ¶
func GetBlockRelevantIDs ¶
func GetBlockSiblingID ¶
func GetBlockTreeInfos ¶
func GetBlockTreeInfos(ids []string) (ret map[string]*BlockTreeInfo)
func GetBlocksIndexes ¶
func GetCaptcha ¶
func GetCloudRepoSnapshots ¶
func GetCloudShorthand ¶
func GetCloudShorthands ¶
func GetCloudSpace ¶
func GetDOMText ¶
func GetDoc ¶
func GetDoc(startID, endID, id string, index int, query string, queryTypes map[string]bool, queryMethod, mode int, size int, isBacklink bool, originalRefBlockIDs map[string]string, highlight bool) ( blockCount int, dom, parentID, parent2ID, rootID, typ string, eof, scroll bool, boxID, docPath string, isBacklinkExpand bool, keywords []string, err error)
func GetDocHistoryContent ¶
func GetFullHPathByID ¶
func GetHPathByID ¶
func GetHPathByPath ¶
func GetHPathsByPaths ¶
func GetHeadingChildrenDOM ¶
func GetHeadingChildrenIDs ¶
func GetHistoryDir ¶
func GetIDsByHPath ¶
func GetLocalStorage ¶
func GetLocalStorage() (ret map[string]interface{})
func GetNewSessionID ¶
func GetNewSessionID() string
func GetOutlineStorage ¶
func GetPackageREADME ¶
func GetPathByID ¶
func GetUnfoldedParentID ¶
func HTML2Markdown ¶
func HandleAssetsChangeEvent ¶
func HandleAssetsChangeEvent(assetAbsPath string)
func HandleAssetsRemoveEvent ¶
func HandleAssetsRemoveEvent(assetAbsPath string)
func HandleSignal ¶
func HandleSignal()
func Heading2Doc ¶
func HideConfSecret ¶
func HideConfSecret(c *AppConf)
HideConfSecret 隐藏设置中的秘密信息 REF: https://github.com/siyuan-note/siyuan/issues/11364
func HookDesktopUIProcJob ¶
func HookDesktopUIProcJob()
func ImportData ¶
func ImportFromLocalPath ¶
func ImportRepoKey ¶
func IndexEmbedBlockJob ¶
func IndexEmbedBlockJob()
IndexEmbedBlockJob 嵌入块支持搜索 https://github.com/siyuan-note/siyuan/issues/7112
func InitAccounts ¶
func InitAccounts()
func InitAppearance ¶
func InitAppearance()
func InitRepoKey ¶
func InitRepoKey() (err error)
func InsertLocalAssets ¶
func InstallBazaarIcon ¶
func InstallBazaarPlugin ¶
func InstallBazaarTemplate ¶
func InstallBazaarTheme ¶
func InstallBazaarWidget ¶
func InstalledIcons ¶
func InstalledPlugins ¶
func InstalledTemplates ¶
func InstalledThemes ¶
func InstalledWidgets ¶
func IsAdminRoleContext ¶
func IsBlockFolded ¶
func IsMoveOutlineHeading ¶
func IsMoveOutlineHeading(transactions *[]*Transaction) bool
func IsPaidUser ¶
func IsPaidUser() bool
func IsPublishServiceToken ¶
IsPublishServiceToken 检查 token 是否来自发布服务
func IsReadOnlyRole ¶
func IsSubscriber ¶
func IsSubscriber() bool
func IsSyncingFile ¶
func IsUserGuide ¶
func IsValidRole ¶
func ListItem2Doc ¶
func LoadCalendarObject ¶
LoadCalendarObject loads a iCalendar file (*.ics)
func LoadFlashcards ¶
func LoadFlashcards()
func LoadSnippets ¶
func LoadUploadToken ¶
func LoadUploadToken() (err error)
func LogoutAuth ¶
func LogoutUser ¶
func LogoutUser()
func MoveLocalShorthands ¶
func NetAssets2LocalAssets ¶
func OCRAssetsJob ¶
func OCRAssetsJob()
func OpenRepoSnapshotDoc ¶
func ParseAddressPath ¶
ParseAddressPath parses address path to address book path and address ID
func ParseCalendarObjectPath ¶
GetCardDavPathDepth parses
func PathCleanWithSlash ¶
PathCleanWithSlash cleans the path
func PathJoinWithSlash ¶
PathJoinWithSlash joins the elements to a path with slash ('/') character
func PdfListLinks ¶
func PdfListLinks(ctx *model.Context) (assets, others []model.LinkAnnotation, err error)
func PdfListToCLinks ¶
func PdfListToCLinks(ctx *model.Context) (ret []model.LinkAnnotation, err error)
func PerformTransactions ¶
func PerformTransactions(transactions *[]*Transaction)
func ProcessPDF ¶
func PurgeCloud ¶
func PurgeCloud() (err error)
func PushReloadPlugin ¶
func PushReloadSnippet ¶
func RefreshBacklink ¶
func RefreshBacklink(id string)
func RefreshCheckJob2H ¶
func RefreshCheckJob2H()
func RefreshCheckJob6H ¶
func RefreshCheckJob6H()
func RefreshUser ¶
func RefreshUser(token string)
func ReindexAssetContent ¶
func ReindexAssetContent()
func ReindexHistory ¶
func ReindexHistory()
func ReloadFiletree ¶
func ReloadFiletree()
func ReloadIcon ¶
func ReloadIcon()
func ReloadProtyle ¶
func ReloadProtyle(rootID string)
func RemoveAttributeViewKey ¶
func RemoveBookmark ¶
func RemoveCloudRepoTag ¶
func RemoveCloudShorthands ¶
func RemoveCloudSyncDir ¶
func RemoveCriterion ¶
func RemoveDeck ¶
func RemoveDocs ¶
func RemoveDocs(paths []string)
func RemoveIndexes ¶
func RemoveIndexes(paths []string)
func RemoveLocalStorageVals ¶
func RemoveOutlineStorage ¶
func RemoveTagSnapshot ¶
func RemoveTemplate ¶
func RemoveUnusedAsset ¶
func RemoveUnusedAssets ¶
func RemoveUnusedAssets() (ret []string)
func RemoveUnusedAttributeView ¶
func RemoveUnusedAttributeView(id string)
func RemoveUnusedAttributeViews ¶
func RemoveUnusedAttributeViews() (ret []string)
func RenameAsset ¶
func RenameBookmark ¶
func RenameDeck ¶
func RenderAttributeView ¶
func RenderGoTemplate ¶
func RenderTemplate ¶
func ResetFlashcards ¶
func ResetVirtualBlockRefCache ¶
func ResetVirtualBlockRefCache()
func ReviewFlashcard ¶
func RollbackAssetsHistory ¶
func RollbackDocHistory ¶
func RollbackNotebookHistory ¶
func SaveMetaData ¶
func SearchAssetsByName ¶
func SearchDocs ¶
func SearchTags ¶
func SetAttributeViewGroup ¶
func SetBlockReminder ¶
func SetBoxIcon ¶
func SetBoxIcon(boxID, icon string)
func SetCloudBlockReminder ¶
func SetCloudSyncDir ¶
func SetCloudSyncDir(name string)
func SetCriterion ¶
func SetDatabaseBlockView ¶
func SetFlashcardsDueTime ¶
func SetFlashcardsDueTime(cardDues []*SetFlashcardDueTime) (err error)
func SetLocalStorage ¶
func SetLocalStorage(val interface{}) (err error)
func SetLocalStorageVal ¶
func SetOutlineStorage ¶
func SetSnippet ¶
func SetSyncEnable ¶
func SetSyncEnable(b bool)
func SetSyncGenerateConflictDoc ¶
func SetSyncGenerateConflictDoc(b bool)
func SetSyncInterval ¶
func SetSyncInterval(interval int)
func SetSyncMode ¶
func SetSyncMode(mode int)
func SetSyncPerception ¶
func SetSyncPerception(b bool)
func SetSyncProvider ¶
func SetSyncProviderLocal ¶
func SetSyncProviderS3 ¶
func SetSyncProviderWebDAV ¶
func SkipReviewFlashcard ¶
func SortAttributeViewKey ¶
func StartFreeTrial ¶
func StartFreeTrial() (err error)
func SwapBlockRef ¶
func SyncDataDownload ¶
func SyncDataDownload()
func SyncDataJob ¶
func SyncDataJob()
func SyncDataUpload ¶
func SyncDataUpload()
func TagSnapshot ¶
func TransferBlockRef ¶
func UninstallBazaarIcon ¶
func UninstallBazaarPlugin ¶
func UninstallBazaarTemplate ¶
func UninstallBazaarTheme ¶
func UninstallBazaarWidget ¶
func UpdateAttributeViewCell ¶
func UpdateAttributeViewCell(tx *Transaction, avID, keyID, itemID string, valueData interface{}) (val *av.Value, err error)
func UpdateEmbedBlock ¶
func UpdateRecentDocCloseTime ¶
UpdateRecentDocCloseTime 更新文档关闭时间
func UpdateRecentDocOpenTime ¶
UpdateRecentDocOpenTime 更新文档打开时间(只在第一次从文档树加载到页签时调用)
func UpdateRecentDocViewTime ¶
UpdateRecentDocViewTime 更新文档浏览时间
func UpdatedPackages ¶
func UploadAssets2Cloud ¶
func UploadCloudSnapshot ¶
func UpsertIndexes ¶
func UpsertIndexes(paths []string)
func UseActivationcode ¶
func VacuumDataIndex ¶
func VacuumDataIndex()
func WatchAssets ¶
func WatchAssets()
func WatchEmojis ¶
func WatchEmojis()
func WatchLocalShorthands ¶
func WatchLocalShorthands()
Types ¶
type Account ¶
func GetBasicAuthAccount ¶
type AccountsMap ¶
type AddressBook ¶
type AddressObject ¶
type AddressObject struct {
Changed bool
FilePath string
BookPath string
Data *carddav.AddressObject
}
func ImportAddressBook ¶
func ImportAddressBook(addressBookPath, cardContent string) (addresses []*AddressObject, err error)
ImportVCardFile imports a address book from a vCard file (*.vcf)
type Announcement ¶
type AppConf ¶
type AppConf struct {
LogLevel string `json:"logLevel"` // 日志级别:off, trace, debug, info, warn, error, fatal
Appearance *conf.Appearance `json:"appearance"` // 外观
Langs []*conf.Lang `json:"langs"` // 界面语言列表
Lang string `json:"lang"` // 选择的界面语言,同 Appearance.Lang
FileTree *conf.FileTree `json:"fileTree"` // 文档面板
Tag *conf.Tag `json:"tag"` // 标签面板
Editor *conf.Editor `json:"editor"` // 编辑器配置
Export *conf.Export `json:"export"` // 导出配置
Graph *conf.Graph `json:"graph"` // 关系图配置
UILayout *conf.UILayout `json:"uiLayout"` // 界面布局。不要直接使用,使用 GetUILayout() 和 SetUILayout() 方法
UserData string `json:"userData"` // 社区用户信息,对 User 加密存储
User *conf.User `json:"-"` // 社区用户内存结构,不持久化。不要直接使用,使用 GetUser() 和 SetUser() 方法
Account *conf.Account `json:"account"` // 帐号配置
ReadOnly bool `json:"readonly"` // 是否是以只读模式运行
ServerAddrs []string `json:"serverAddrs"` // 本地服务器地址列表
AccessAuthCode string `json:"accessAuthCode"` // 访问授权码
System *conf.System `json:"system"` // 系统配置
Keymap *conf.Keymap `json:"keymap"` // 快捷键配置
Sync *conf.Sync `json:"sync"` // 同步配置
Search *conf.Search `json:"search"` // 搜索配置
Flashcard *conf.Flashcard `json:"flashcard"` // 闪卡配置
AI *conf.AI `json:"ai"` // 人工智能配置
Bazaar *conf.Bazaar `json:"bazaar"` // 集市配置
Stat *conf.Stat `json:"stat"` // 统计
Api *conf.API `json:"api"` // API
Repo *conf.Repo `json:"repo"` // 数据仓库
Publish *conf.Publish `json:"publish"` // 发布服务
OpenHelp bool `json:"openHelp"` // 启动后是否需要打开用户指南
ShowChangelog bool `json:"showChangelog"` // 是否显示版本更新日志
CloudRegion int `json:"cloudRegion"` // 云端区域,0:中国大陆,1:北美
Snippet *conf.Snpt `json:"snippet"` // 代码片段
DataIndexState int `json:"dataIndexState"` // 数据索引状态,0:已索引,1:未索引
CookieKey string `json:"cookieKey"` // 用于加密 Cookie 的密钥
// contains filtered or unexported fields
}
AppConf 维护应用元数据,保存在 ~/.siyuan/conf.json。
var Conf *AppConf
func GetMaskedConf ¶
func NewAppConf ¶
func NewAppConf() *AppConf
func (*AppConf) GetClosedBoxes ¶
func (*AppConf) GetOpenedBoxes ¶
func (*AppConf) GetUILayout ¶
func (*AppConf) SetUILayout ¶
type AssetContent ¶
type AssetContent struct {
ID string `json:"id"`
Name string `json:"name"`
Ext string `json:"ext"`
Path string `json:"path"`
Size int64 `json:"size"`
HSize string `json:"hSize"`
Updated int64 `json:"updated"`
Content string `json:"content"`
}
func FullTextSearchAssetContent ¶
func FullTextSearchAssetContent(query string, types map[string]bool, method, orderBy, page, pageSize int) (ret []*AssetContent, matchedAssetCount, pageCount int)
FullTextSearchAssetContent 搜索资源文件内容。
method:0:关键字,1:查询语法,2:SQL,3:正则表达式 orderBy: 0:按相关度降序,1:按相关度升序,2:按更新时间升序,3:按更新时间降序
func GetAssetContent ¶
func GetAssetContent(id, query string, queryMethod int) (ret *AssetContent)
type AssetParseResult ¶
type AssetParser ¶
type AssetParser interface {
Parse(absPath string) *AssetParseResult
}
type AssetsSearcher ¶
type AssetsSearcher struct {
// contains filtered or unexported fields
}
func NewAssetsSearcher ¶
func NewAssetsSearcher() *AssetsSearcher
func (*AssetsSearcher) FullIndex ¶
func (searcher *AssetsSearcher) FullIndex()
func (*AssetsSearcher) GetParser ¶
func (searcher *AssetsSearcher) GetParser(ext string) AssetParser
type AvSearchResult ¶
type AvSearchResult struct {
AvID string `json:"avID"`
AvName string `json:"avName"`
ViewName string `json:"viewName"`
ViewID string `json:"viewID"`
ViewLayout av.LayoutType `json:"viewLayout"`
BlockID string `json:"blockID"`
HPath string `json:"hPath"`
Children []*AvSearchResult `json:"children,omitempty"`
}
func SearchAttributeView ¶
func SearchAttributeView(keyword string, excludeAvIDs []string) (ret []*AvSearchResult)
type AvSearchTempResult ¶
type Backlink ¶
type Backlink struct {
DOM string `json:"dom"`
BlockPaths []*BlockPath `json:"blockPaths"`
Expand bool `json:"expand"`
// contains filtered or unexported fields
}
func GetBacklinkDoc ¶
type Block ¶
type Block struct {
Box string `json:"box"`
Path string `json:"path"`
HPath string `json:"hPath"`
ID string `json:"id"`
RootID string `json:"rootID"`
ParentID string `json:"parentID"`
Name string `json:"name"`
Alias string `json:"alias"`
Memo string `json:"memo"`
Tag string `json:"tag"`
Content string `json:"content"`
FContent string `json:"fcontent"`
Markdown string `json:"markdown"`
Folded bool `json:"folded"`
Type string `json:"type"`
SubType string `json:"subType"`
RefText string `json:"refText"`
Defs []*Block `json:"-"` // 当前块引用了这些块,避免序列化 JSON 时产生循环引用
Refs []*Block `json:"refs"` // 当前块被这些块引用
DefID string `json:"defID"`
DefPath string `json:"defPath"`
IAL map[string]string `json:"ial"`
Children []*Block `json:"children"`
Depth int `json:"depth"`
Count int `json:"count"`
RefCount int `json:"refCount"`
Sort int `json:"sort"`
Created string `json:"created"`
Updated string `json:"updated"`
RiffCardID string `json:"riffCardID"`
RiffCard *RiffCard `json:"riffCard"`
}
Block 描述了内容块。
func FullTextSearchBlock ¶
func FullTextSearchBlock(query string, boxes, paths []string, types map[string]bool, method, orderBy, groupBy, page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount, pageCount int, docMode bool)
FullTextSearchBlock 搜索内容块。
method:0:关键字,1:查询语法,2:SQL,3:正则表达式 orderBy: 0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时),6:按相关度升序,7:按相关度降序 groupBy:0:不分组,1:按文档分组
func GetDeckFlashcards ¶
func GetFlashcardsByBlockIDs ¶
func GetNotebookFlashcards ¶
func GetTreeFlashcards ¶
func ListInvalidBlockRefs ¶
func RecentUpdatedBlocks ¶
func RecentUpdatedBlocks() (ret []*Block)
func SearchRefBlock ¶
func SearchTemplate ¶
func SearchWidget ¶
func (*Block) IsContainerBlock ¶
type BlockAttributeViewKeys ¶
type BlockAttributeViewKeys struct {
AvID string `json:"avID"`
AvName string `json:"avName"`
BlockIDs []string `json:"blockIDs"`
KeyValues []*av.KeyValues `json:"keyValues"`
}
func GetBlockAttributeViewKeys ¶
func GetBlockAttributeViewKeys(nodeID string) (ret []*BlockAttributeViewKeys)
type BlockInfo ¶
type BlockInfo struct {
ID string `json:"id"`
RootID string `json:"rootID"`
Name string `json:"name"`
RefCount int `json:"refCount"`
SubFileCount int `json:"subFileCount"`
RefIDs []string `json:"refIDs"`
IAL map[string]string `json:"ial"`
Icon string `json:"icon"`
AttrViews []*AttrView `json:"attrViews"`
}
func GetDocInfo ¶
type BlockPath ¶
type BlockTreeInfo ¶
type Bookmark ¶
type Bookmark struct {
Name BookmarkLabel `json:"name"`
Blocks []*Block `json:"blocks"`
Type string `json:"type"` // "bookmark"
Depth int `json:"depth"`
Count int `json:"count"`
}
type BookmarkBlocks ¶
type BookmarkBlocks []*Block
type BookmarkLabel ¶
type BookmarkLabel string
type Bookmarks ¶
type Bookmarks []*Bookmark
func BuildBookmark ¶
func BuildBookmark() (ret *Bookmarks)
type Box ¶
type Box struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Sort int `json:"sort"`
SortMode int `json:"sortMode"`
Closed bool `json:"closed"`
NewFlashcardCount int `json:"newFlashcardCount"`
DueFlashcardCount int `json:"dueFlashcardCount"`
FlashcardCount int `json:"flashcardCount"`
}
Box 笔记本。
func GetFlashcardNotebooks ¶
func GetFlashcardNotebooks() (ret []*Box)
func ListNotebooks ¶
func (*Box) UpdateHistoryGenerated ¶
func (box *Box) UpdateHistoryGenerated()
type CalDavBackend ¶
type CalDavBackend struct{}
func (*CalDavBackend) CalendarHomeSetPath ¶
func (b *CalDavBackend) CalendarHomeSetPath(ctx context.Context) (string, error)
func (*CalDavBackend) CreateCalendar ¶
func (*CalDavBackend) CurrentUserPrincipal ¶
func (b *CalDavBackend) CurrentUserPrincipal(ctx context.Context) (string, error)
func (*CalDavBackend) DeleteCalendar ¶
func (b *CalDavBackend) DeleteCalendar(ctx context.Context, calendarPath string) (err error)
func (*CalDavBackend) DeleteCalendarObject ¶
func (b *CalDavBackend) DeleteCalendarObject(ctx context.Context, objectPath string) (err error)
func (*CalDavBackend) GetCalendar ¶
func (*CalDavBackend) GetCalendarObject ¶
func (b *CalDavBackend) GetCalendarObject(ctx context.Context, objectPath string, req *caldav.CalendarCompRequest) (calendarObject *caldav.CalendarObject, err error)
func (*CalDavBackend) ListCalendarObjects ¶
func (b *CalDavBackend) ListCalendarObjects(ctx context.Context, calendarPath string, req *caldav.CalendarCompRequest) (calendarObjects []caldav.CalendarObject, err error)
func (*CalDavBackend) ListCalendars ¶
func (*CalDavBackend) PutCalendarObject ¶
func (b *CalDavBackend) PutCalendarObject(ctx context.Context, objectPath string, calendar *ical.Calendar, opts *caldav.PutCalendarObjectOptions) (calendarObject *caldav.CalendarObject, err error)
func (*CalDavBackend) QueryCalendarObjects ¶
func (b *CalDavBackend) QueryCalendarObjects(ctx context.Context, calendarPath string, query *caldav.CalendarQuery) (calendarObjects []caldav.CalendarObject, err error)
type CalDavPathDepth ¶
type CalDavPathDepth int
func GetCalDavPathDepth ¶
func GetCalDavPathDepth(urlPath string) CalDavPathDepth
type CalendarObject ¶
type CalendarObject struct {
Changed bool
FilePath string
CalendarPath string
Data *caldav.CalendarObject
}
type Calendars ¶
type Calendars struct {
// contains filtered or unexported fields
}
func (*Calendars) CreateCalendar ¶
func (*Calendars) DeleteCalendar ¶
func (*Calendars) DeleteCalendarObject ¶
func (*Calendars) DeleteObject ¶
func (c *Calendars) DeleteObject(objectPath string) (calendar *Calendar, calendarObject *CalendarObject, err error)
func (*Calendars) GetCalendar ¶
func (*Calendars) GetCalendarObject ¶
func (c *Calendars) GetCalendarObject(objectPath string, req *caldav.CalendarCompRequest) (calendarObject *caldav.CalendarObject, err error)
func (*Calendars) GetObject ¶
func (c *Calendars) GetObject(objectPath string) (calendar *Calendar, calendarObject *CalendarObject, err error)
func (*Calendars) ListCalendarObjects ¶
func (c *Calendars) ListCalendarObjects(calendarPath string, req *caldav.CalendarCompRequest) (calendarObjects []caldav.CalendarObject, err error)
func (*Calendars) ListCalendars ¶
func (*Calendars) PutCalendarObject ¶
func (c *Calendars) PutCalendarObject(objectPath string, calendarData *ical.Calendar, opts *caldav.PutCalendarObjectOptions) (calendarObject *caldav.CalendarObject, err error)
func (*Calendars) QueryCalendarObjects ¶
func (c *Calendars) QueryCalendarObjects(calendarPath string, query *caldav.CalendarQuery) (calendarObjects []caldav.CalendarObject, err error)
type CardDavBackend ¶
type CardDavBackend struct{}
func (*CardDavBackend) AddressBookHomeSetPath ¶
func (b *CardDavBackend) AddressBookHomeSetPath(ctx context.Context) (string, error)
func (*CardDavBackend) CreateAddressBook ¶
func (b *CardDavBackend) CreateAddressBook(ctx context.Context, addressBook *carddav.AddressBook) (err error)
func (*CardDavBackend) CurrentUserPrincipal ¶
func (b *CardDavBackend) CurrentUserPrincipal(ctx context.Context) (string, error)
func (*CardDavBackend) DeleteAddressBook ¶
func (b *CardDavBackend) DeleteAddressBook(ctx context.Context, bookPath string) (err error)
func (*CardDavBackend) DeleteAddressObject ¶
func (b *CardDavBackend) DeleteAddressObject(ctx context.Context, addressPath string) (err error)
func (*CardDavBackend) GetAddressBook ¶
func (b *CardDavBackend) GetAddressBook(ctx context.Context, bookPath string) (addressBook *carddav.AddressBook, err error)
func (*CardDavBackend) GetAddressObject ¶
func (b *CardDavBackend) GetAddressObject(ctx context.Context, addressPath string, req *carddav.AddressDataRequest) (addressObject *carddav.AddressObject, err error)
func (*CardDavBackend) ListAddressBooks ¶
func (b *CardDavBackend) ListAddressBooks(ctx context.Context) (addressBooks []carddav.AddressBook, err error)
func (*CardDavBackend) ListAddressObjects ¶
func (b *CardDavBackend) ListAddressObjects(ctx context.Context, bookPath string, req *carddav.AddressDataRequest) (addressObjects []carddav.AddressObject, err error)
func (*CardDavBackend) PutAddressObject ¶
func (b *CardDavBackend) PutAddressObject(ctx context.Context, addressPath string, card vcard.Card, opts *carddav.PutAddressObjectOptions) (addressObject *carddav.AddressObject, err error)
func (*CardDavBackend) QueryAddressObjects ¶
func (b *CardDavBackend) QueryAddressObjects(ctx context.Context, urlPath string, query *carddav.AddressBookQuery) (addressObjects []carddav.AddressObject, err error)
type CardDavPathDepth ¶
type CardDavPathDepth int
func GetCardDavPathDepth ¶
func GetCardDavPathDepth(urlPath string) CardDavPathDepth
type ChildBlock ¶
type ChildBlock struct {
ID string `json:"id"`
Type string `json:"type"`
SubType string `json:"subType,omitempty"`
Content string `json:"content,omitempty"`
Markdown string `json:"markdown,omitempty"`
}
func GetChildBlocks ¶
func GetChildBlocks(id string) (ret []*ChildBlock)
func GetTailChildBlocks ¶
func GetTailChildBlocks(id string, n int) (ret []*ChildBlock)
type ClaimsKeyType ¶
type ClaimsKeyType string
type Contacts ¶
type Contacts struct {
// contains filtered or unexported fields
}
func (*Contacts) CreateAddressBook ¶
func (c *Contacts) CreateAddressBook(addressBookMetaData *carddav.AddressBook) (err error)
func (*Contacts) DeleteAddress ¶
func (c *Contacts) DeleteAddress(addressPath string) (addressBook *AddressBook, addressObject *AddressObject, err error)
func (*Contacts) DeleteAddressBook ¶
func (*Contacts) DeleteAddressObject ¶
func (*Contacts) GetAddress ¶
func (c *Contacts) GetAddress(addressPath string) (addressBook *AddressBook, addressObject *AddressObject, err error)
func (*Contacts) GetAddressBook ¶
func (c *Contacts) GetAddressBook(path string) (addressBook *carddav.AddressBook, err error)
func (*Contacts) GetAddressObject ¶
func (c *Contacts) GetAddressObject(addressPath string, req *carddav.AddressDataRequest) (addressObject *carddav.AddressObject, err error)
func (*Contacts) ListAddressBooks ¶
func (c *Contacts) ListAddressBooks() (addressBooks []carddav.AddressBook, err error)
func (*Contacts) ListAddressObjects ¶
func (c *Contacts) ListAddressObjects(bookPath string, req *carddav.AddressDataRequest) (addressObjects []carddav.AddressObject, err error)
func (*Contacts) PutAddressObject ¶
func (c *Contacts) PutAddressObject(addressPath string, card vcard.Card, opts *carddav.PutAddressObjectOptions) (addressObject *carddav.AddressObject, err error)
func (*Contacts) QueryAddressObjects ¶
func (c *Contacts) QueryAddressObjects(urlPath string, query *carddav.AddressBookQuery) (addressObjects []carddav.AddressObject, err error)
type Criterion ¶
type Criterion struct {
Name string `json:"name"`
Sort int `json:"sort"` // 0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时)
Group int `json:"group"` // 0:不分组,1:按文档分组
HasReplace bool `json:"hasReplace"` // 是否有替换
Method int `json:"method"` // 0:文本,1:查询语法,2:SQL,3:正则表达式
HPath string `json:"hPath"`
IDPath []string `json:"idPath"`
K string `json:"k"` // 搜索关键字
R string `json:"r"` // 替换关键字
Types *CriterionTypes `json:"types"` // 类型过滤选项
ReplaceTypes *CriterionReplaceTypes `json:"replaceTypes"` // 替换类型过滤选项
}
func GetCriteria ¶
func GetCriteria() (ret []*Criterion)
type CriterionReplaceTypes ¶
type CriterionReplaceTypes struct {
Text bool `json:"text"`
ImgText bool `json:"imgText"`
ImgTitle bool `json:"imgTitle"`
ImgSrc bool `json:"imgSrc"`
AText bool `json:"aText"`
ATitle bool `json:"aTitle"`
AHref bool `json:"aHref"`
Code bool `json:"code"`
Em bool `json:"em"`
Strong bool `json:"strong"`
InlineMath bool `json:"inlineMath"`
InlineMemo bool `json:"inlineMemo"`
BlockRef bool `json:"blockRef"`
FileAnnotationRef bool `json:"fileAnnotationRef"`
Kbd bool `json:"kbd"`
Mark bool `json:"mark"`
S bool `json:"s"`
Sub bool `json:"sub"`
Sup bool `json:"sup"`
Tag bool `json:"tag"`
U bool `json:"u"`
DocTitle bool `json:"docTitle"`
CodeBlock bool `json:"codeBlock"`
MathBlock bool `json:"mathBlock"`
HtmlBlock bool `json:"htmlBlock"`
}
type CriterionTypes ¶
type CriterionTypes struct {
MathBlock bool `json:"mathBlock"`
Table bool `json:"table"`
Blockquote bool `json:"blockquote"`
SuperBlock bool `json:"superBlock"`
Paragraph bool `json:"paragraph"`
Document bool `json:"document"`
Heading bool `json:"heading"`
List bool `json:"list"`
ListItem bool `json:"listItem"`
CodeBlock bool `json:"codeBlock"`
HtmlBlock bool `json:"htmlBlock"`
EmbedBlock bool `json:"embedBlock"`
DatabaseBlock bool `json:"databaseBlock"`
AudioBlock bool `json:"audioBlock"`
VideoBlock bool `json:"videoBlock"`
IFrameBlock bool `json:"iframeBlock"`
WidgetBlock bool `json:"widgetBlock"`
Callout bool `json:"callout"`
}
type DocxAssetParser ¶
type DocxAssetParser struct {
}
func (*DocxAssetParser) Parse ¶
func (parser *DocxAssetParser) Parse(absPath string) (ret *AssetParseResult)
type EmbedBlock ¶
func GetEmbedBlock ¶
func GetEmbedBlock(embedBlockID string, includeIDs []string, headingMode int, breadcrumb bool) (ret []*EmbedBlock)
func SearchEmbedBlock ¶
func SearchEmbedBlock(embedBlockID, stmt string, excludeIDs []string, headingMode int, breadcrumb bool) (ret []*EmbedBlock)
type EpubAssetParser ¶
type EpubAssetParser struct {
}
func (*EpubAssetParser) Parse ¶
func (parser *EpubAssetParser) Parse(absPath string) (ret *AssetParseResult)
type File ¶
type File struct {
Path string `json:"path"`
Name string `json:"name"` // 标题,即 ial["title"]
Icon string `json:"icon"`
Name1 string `json:"name1"` // 命名,即 ial["name"]
Alias string `json:"alias"`
Memo string `json:"memo"`
Bookmark string `json:"bookmark"`
ID string `json:"id"`
Count int `json:"count"`
Size uint64 `json:"size"`
HSize string `json:"hSize"`
Mtime int64 `json:"mtime"`
CTime int64 `json:"ctime"`
HMtime string `json:"hMtime"`
HCtime string `json:"hCtime"`
Sort int `json:"sort"`
SubFileCount int `json:"subFileCount"`
Hidden bool `json:"hidden"`
NewFlashcardCount int `json:"newFlashcardCount"`
DueFlashcardCount int `json:"dueFlashcardCount"`
FlashcardCount int `json:"flashcardCount"`
}
type Flashcard ¶
type Flashcard struct {
DeckID string `json:"deckID"`
CardID string `json:"cardID"`
BlockID string `json:"blockID"`
Lapses int `json:"lapses"`
Reps int `json:"reps"`
State riff.State `json:"state"`
LastReview int64 `json:"lastReview"`
NextDues map[riff.Rating]string `json:"nextDues"`
}
func GetDueFlashcards ¶
type GraphArrows ¶
type GraphArrows struct {
To *GraphArrowsTo `json:"to"`
}
type GraphArrowsTo ¶
type GraphArrowsTo struct {
Enabled bool `json:"enabled"`
}
type GraphLink ¶
type GraphLink struct {
From string `json:"from"`
To string `json:"to"`
Ref bool `json:"ref"`
Arrows *GraphArrows `json:"arrows"`
}
type GroupState ¶
GroupState 用于临时记录每个分组视图的状态,以便后面重新生成分组后可以恢复这些状态。
type History ¶
type History struct {
HCreated string `json:"hCreated"`
Items []*HistoryItem `json:"items"`
}
func GetNotebookHistory ¶
type HistoryItem ¶
type HistoryItem struct {
Title string `json:"title"`
Path string `json:"path"`
Op string `json:"op"`
Notebook string `json:"notebook"` // 仅用于文档历史
}
func FullTextSearchHistoryItems ¶
func FullTextSearchHistoryItems(created, query, box, op string, typ int) (ret []*HistoryItem)
type LeftRightDiff ¶
type LeftRightDiff struct {
LeftIndex *DiffIndex `json:"leftIndex"`
RightIndex *DiffIndex `json:"rightIndex"`
AddsLeft []*DiffFile `json:"addsLeft"`
UpdatesLeft []*DiffFile `json:"updatesLeft"`
UpdatesRight []*DiffFile `json:"updatesRight"`
RemovesRight []*DiffFile `json:"removesRight"`
}
func DiffRepoSnapshots ¶
func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error)
type OnlineKernel ¶
type OnlineKernel struct {
ID string `json:"id"`
Hostname string `json:"hostname"`
OS string `json:"os"`
Ver string `json:"ver"`
}
func GetOnlineKernels ¶
func GetOnlineKernels() (ret []*OnlineKernel)
type Operation ¶
type Operation struct {
Action string `json:"action"`
Data interface{} `json:"data"`
ID string `json:"id"`
ParentID string `json:"parentID"`
PreviousID string `json:"previousID"`
NextID string `json:"nextID"`
RetData interface{} `json:"retData"`
BlockIDs []string `json:"blockIDs"`
BlockID string `json:"blockID"`
DeckID string `json:"deckID"` // 用于添加/删除闪卡
AvID string `json:"avID"` // 属性视图 ID
SrcIDs []string `json:"srcIDs"` // 用于从属性视图中删除行
Srcs []map[string]interface{} `json:"srcs"` // 用于添加属性视图行(包括绑定块){id, content, isDetached}
IsDetached bool `json:"isDetached"` // 用于标识是否未绑定块,仅存在于属性视图中
Name string `json:"name"` // 属性视图列名
Typ string `json:"type"` // 属性视图列类型
Format string `json:"format"` // 属性视图列格式化
KeyID string `json:"keyID"` // 属性视图字段 ID
RowID string `json:"rowID"` // 属性视图行 ID
IsTwoWay bool `json:"isTwoWay"` // 属性视图关联列是否是双向关系
BackRelationKeyID string `json:"backRelationKeyID"` // 属性视图关联列回链关联列的 ID
RemoveDest bool `json:"removeDest"` // 属性视图删除关联目标
Layout av.LayoutType `json:"layout"` // 属性视图布局类型
GroupID string `json:"groupID"` // 属性视图分组视图 ID
TargetGroupID string `json:"targetGroupID"` // 属性视图目标分组视图 ID
ViewID string `json:"viewID"` // 属性视图视图 ID
IgnoreDefaultFill bool `json:"ignoreDefaultFill"` // 是否忽略默认填充
Context map[string]interface{} `json:"context"` // 上下文信息
}
type OutlineDoc ¶
type Path ¶
type Path struct {
ID string `json:"id"` // 块 ID
Box string `json:"box"` // 块 Box
Name string `json:"name"` // 当前路径
HPath string `json:"hPath"` // 人类可读路径
Type string `json:"type"` // "path"
NodeType string `json:"nodeType"` // 节点类型
SubType string `json:"subType"` // 节点子类型
Blocks []*Block `json:"blocks,omitempty"` // 子块节点
Children []*Path `json:"children,omitempty"` // 子路径节点
Depth int `json:"depth"` // 层级深度
Count int `json:"count"` // 子块计数
Folded bool `json:"folded"` // 是否折叠
Updated string `json:"updated"` // 更新时间
Created string `json:"created"` // 创建时间
}
func GetBacklink ¶
func GetBacklink2 ¶
type PdfAssetParser ¶
type PdfAssetParser struct {
}
PdfAssetParser parser factory product
func (*PdfAssetParser) Parse ¶
func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult)
Parse will parse a PDF document using PDFium webassembly module using a worker pool
type Petal ¶
type Petal struct {
Name string `json:"name"` // Plugin name
DisplayName string `json:"displayName"` // Plugin display name
Enabled bool `json:"enabled"` // Whether enabled
Incompatible bool `json:"incompatible"` // Whether incompatible
DisabledInPublish bool `json:"disabledInPublish"` // Whether disabled in publish mode
DisallowInstall bool `json:"disallowInstall"` // Whether disallow install
JS string `json:"js"` // JS code
CSS string `json:"css"` // CSS code
I18n map[string]interface{} `json:"i18n"` // i18n text
}
Petal represents a plugin's management status.
func LoadPetals ¶
type PptxAssetParser ¶
type PptxAssetParser struct {
}
func (*PptxAssetParser) Parse ¶
func (parser *PptxAssetParser) Parse(absPath string) (ret *AssetParseResult)
type RecentDoc ¶
type RecentDoc struct {
RootID string `json:"rootID"`
Icon string `json:"icon,omitempty"`
Title string `json:"title,omitempty"`
ViewedAt int64 `json:"viewedAt,omitempty"` // 浏览时间字段
ClosedAt int64 `json:"closedAt,omitempty"` // 关闭时间字段
OpenAt int64 `json:"openAt,omitempty"` // 文档第一次从文档树加载到页签的时间
}
func GetRecentDocs ¶
type SessionsMap ¶
type SetFlashcardDueTime ¶
type Sync ¶
type Sync struct {
Size int64 `json:"size"`
HSize string `json:"hSize"`
Updated string `json:"updated"`
CloudName string `json:"cloudName"` // 云端同步数据存放目录名
SaveDir string `json:"saveDir"` // 本地同步数据存放目录路径
}
func ListCloudSyncDir ¶
type Transaction ¶
type Transaction struct {
Timestamp int64 `json:"timestamp"`
DoOperations []*Operation `json:"doOperations"`
UndoOperations []*Operation `json:"undoOperations"`
// contains filtered or unexported fields
}
func GetHeadingDeleteTransaction ¶
func GetHeadingDeleteTransaction(id string) (transaction *Transaction, err error)
func GetHeadingInsertTransaction ¶
func GetHeadingInsertTransaction(id string) (transaction *Transaction, err error)
func GetHeadingLevelTransaction ¶
func GetHeadingLevelTransaction(id string, level int) (transaction *Transaction, err error)
func (*Transaction) GetChangedRootIDs ¶
func (tx *Transaction) GetChangedRootIDs() (ret []string)
func (*Transaction) WaitForCommit ¶
func (tx *Transaction) WaitForCommit()
type TxtAssetParser ¶
type TxtAssetParser struct {
}
func (*TxtAssetParser) Parse ¶
func (parser *TxtAssetParser) Parse(absPath string) (ret *AssetParseResult)
type UnusedItem ¶
func MissingAssets ¶
func MissingAssets() (ret []*UnusedItem)
func UnusedAssets ¶
func UnusedAssets() (ret []*UnusedItem)
func UnusedAttributeViews ¶
func UnusedAttributeViews() (ret []*UnusedItem)
type XlsxAssetParser ¶
type XlsxAssetParser struct {
}
func (*XlsxAssetParser) Parse ¶
func (parser *XlsxAssetParser) Parse(absPath string) (ret *AssetParseResult)
Source Files
¶
- ai.go
- appearance.go
- asset_content.go
- assets.go
- assets_watcher.go
- attribute_view.go
- attribute_view_fix.go
- attribute_view_render.go
- auth.go
- backlink.go
- bazzar.go
- block.go
- blockial.go
- blockinfo.go
- bookmark.go
- box.go
- caldav.go
- carddav.go
- cloud_service.go
- conf.go
- dav.go
- elevator.go
- emojis_watcher.go
- export.go
- export_merge.go
- file.go
- flashcard.go
- format.go
- graph.go
- heading.go
- history.go
- import.go
- index.go
- index_fix.go
- listitem.go
- mount.go
- ocr.go
- outline.go
- path.go
- pdf.go
- plugin.go
- process.go
- push_reload.go
- render.go
- repository.go
- role.go
- search.go
- session.go
- shortcuts.go
- snippet.go
- storage.go
- sync.go
- tag.go
- template.go
- theme.go
- transaction.go
- tree.go
- updater.go
- upload.go
- virutalref.go
- widget.go