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 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 AutoGenerateFileHistory()
- func AutoPurgeRepoJob()
- func AutoSpace(rootID string) (err error)
- func BatchExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipPath string)
- func BatchSetBlockAttrs(blockAttrs []map[string]interface{}) (err error)
- func BatchUpdateBazaarPackages(frontend string)
- 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 BlocksWordCount(ids []string) (ret *util.BlockStatResult)
- 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 CardDavPath2DirectoryPath(cardDavPath string) string
- 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 CheckEditRole(c *gin.Context)
- func CheckReadRole(c *gin.Context)
- func CheckReadonly(c *gin.Context)
- func CheckUpdate(showMsg bool)
- func CheckoutRepo(id string)
- 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 ContentStat(content string) (ret *util.BlockStatResult)
- 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 DeactivateUser() (err error)
- func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath 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 ExportAv2CSV(avID, blockID string) (zipPath 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) (hPath, exportedMd string)
- func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string)
- func ExportNotebookMarkdown(boxID, folderPath string) (zipPath string)
- func ExportNotebookSY(id string) (zipPath string)
- func ExportPandocConvertZip(id, pandocTo, ext string) (name, zipPath string)
- func ExportResources(resourcePaths []string, mainName string) (exportFilePath string, err error)
- func ExportSY(id string) (name, zipPath string)
- func ExportStdMarkdown(id string) string
- func ExportSystemLog() (zipPath 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 GetAssetAbsPath(relativePath string) (ret string, err error)
- func GetAttributeView(avID string) (ret *av.AttributeView)
- func GetAttributeViewFilterSort(avID, blockID string) (filters []*av.ViewFilter, sorts []*av.ViewSort)
- func GetAttributeViewKeysByAvID(avID string) (ret []*av.Key)
- func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int) (attributeViewName string, databaseBlockIDs []string, keyValues *av.KeyValues, ...)
- func GetBlockDOM(id string) (ret string)
- func GetBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []string)
- func GetBlockIndex(id string) (ret int)
- func GetBlockKramdown(id string) (ret string)
- func GetBlockRefIDsByFileAnnotationID(id string) (refIDs, refTexts []string)
- func GetBlockRefText(id string) string
- func GetBlockRefs(defID string) (refIDs, refTexts, defIDs []string)
- 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 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) (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) (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 GetPackageREADME(repoURL, repoHash, packageType string) (ret string)
- func GetPathByID(id string) (path string, err error)
- func GetRepoFile(fileID string) (ret []byte, p string, err error)
- func GetTokenClaims(token *jwt.Token) jwt.MapClaims
- 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 HandleSignal()
- func Heading2Doc(srcHeadingID, targetBoxID, targetPath string) (srcRootBlockID, newTargetPath string, err error)
- func HideConfSecret(c *AppConf)
- func HomeSetPathPath() string
- 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 IndexAssetContent(absPath string)
- 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, assetPaths []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 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 string) (srcRootBlockID, newTargetPath string, 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 MissingAssets() (ret []string)
- func Mount(boxID string) (alreadyMount bool, err error)
- func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{}) (err error)
- 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 ParseJWT(tokenString string) (*jwt.Token, error)
- func ParseXAuthToken(r *http.Request) *jwt.Token
- func PerformTransactions(transactions *[]*Transaction)
- func Preview(id string) (retStdHTML string)
- func ProcessPDF(id, p string, merge, removeAssets, watermark bool) (err error)
- func PurgeCloud() (err error)
- func PurgeRepo() (err error)
- func Recover(c *gin.Context)
- func RefreshBacklink(id string)
- func RefreshCheckJob()
- func RefreshUser(token string)
- func ReindexAssetContent()
- func ReindexHistory()
- func ReloadAttrView(avID string)
- 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 RemoveIndexAssetContent(absPath string)
- func RemoveIndexes(paths []string)
- func RemoveLocalStorageVals(keys []string) (err error)
- func RemoveRecentDoc(ids []string)
- 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 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(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(avID, created string) (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 RollbackDocHistory(boxID, historyPath string) (err error)
- func RollbackNotebookHistory(historyPath string) (err 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 SearchDocsByKeyword(keyword string, flashcard bool) (ret []map[string]string)
- func SearchTags(keyword string) (ret []string)
- 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, 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 SetSnippet(snippets []*conf.Snippet) (err error)
- func SetSyncEnable(b bool)
- func SetSyncGenerateConflictDoc(b bool)
- func SetSyncMode(mode int)
- func SetSyncPerception(b bool)
- func SetSyncProvider(provider int) (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 StatTree(id string) (ret *util.BlockStatResult)
- 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 UnusedAssets() (ret []string)
- func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueData interface{}) (val *av.Value, err error)
- func UpdateEmbedBlock(id, content string) (err error)
- func UpdatedPackages(frontend string) (plugins []*bazaar.Plugin, widgets []*bazaar.Widget, icons []*bazaar.Icon, ...)
- func Upload(c *gin.Context)
- func UploadAssets2Cloud(rootID string) (count int, err error)
- func UploadCloudSnapshot(tag, id string) (err error)
- func UpsertIndexes(paths []string)
- func UseActivationcode(code string) (err error)
- func WatchAssets()
- func WatchEmojis()
- 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 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 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 ChildBlock
- type ClaimsKeyType
- type CloudGPT
- type Contacts
- func (c *Contacts) CreateAddressBook(addressBookMetaData *carddav.AddressBook) (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 History
- type HistoryItem
- type LeftRightDiff
- type OnlineKernel
- type OpenAIGPT
- type Operation
- 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 PathDepth
- type PdfAssetParser
- type Petal
- type PptxAssetParser
- type RecentDoc
- type RiffCard
- type Role
- type SearchAttributeViewResult
- type SetFlashcardDueTime
- type Snapshot
- type Sync
- type Tag
- type TagBlocks
- type Tags
- type Transaction
- type TxErr
- type TxtAssetParser
- type TypeCount
- type XlsxAssetParser
Constants ¶
const ( TxtAssetContentMaxSize = 1024 * 1024 * 4 PDFAssetContentMaxPage = 1024 )
const ( XAuthTokenKey = "X-Auth-Token" ClaimsContextKey = "claims" ClaimsKeyRole string = "role" )
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" )
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 )
const ( TxErrCodeBlockNotFound = 0 TxErrCodeDataIsSyncing = 1 TxErrCodeWriteTree = 2 TxErrWriteAttributeView = 3 )
const (
RoleContextKey = "role"
)
Variables ¶
var ( ErrorNotFound = errors.New("CardDAV: not found") ErrorPathInvalid = errors.New("CardDAV: path is invalid") ErrorBookNotFound = errors.New("CardDAV: address book not found") ErrorBookPathInvalid = errors.New("CardDAV: address book path is invalid") ErrorAddressNotFound = errors.New("CardDAV: address not found") ErrorAddressFileExtensionNameInvalid = 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") )
var (
AssetsSearchEnabled = true
)
var CustomEmojis = sync.Map{}
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 AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, blockID, previousBlockID string, ignoreFillFilter bool) (err error)
func AddAttributeViewKey ¶
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 AutoGenerateFileHistory ¶
func AutoGenerateFileHistory()
func AutoPurgeRepoJob ¶
func AutoPurgeRepoJob()
AutoPurgeRepoJob 自动清理数据仓库 https://github.com/siyuan-note/siyuan/issues/13091
func BatchSetBlockAttrs ¶
func BatchUpdateBazaarPackages ¶
func BatchUpdateBazaarPackages(frontend string)
func BazaarIcons ¶
func BazaarPlugins ¶
func BazaarTemplates ¶
func BazaarThemes ¶
func BazaarWidgets ¶
func BlocksWordCount ¶
func BlocksWordCount(ids []string) (ret *util.BlockStatResult)
func BookmarkLabels ¶
func BookmarkLabels() (ret []string)
func BootSyncData ¶
func BootSyncData()
func BuildGraph ¶
func BuildTreeGraph ¶
func CacheVirtualBlockRefJob ¶
func CacheVirtualBlockRefJob()
func CardDavPath2DirectoryPath ¶
CardDavPath2DirectoryPath converts CardDAV path to absolute path of the file system
func ChangeBoxSort ¶
func ChangeBoxSort(boxIDs []string)
func ChangeFileTreeSort ¶
func ChangeHistoryTick ¶
func ChangeHistoryTick(minutes int)
func ChatGPTWithAction ¶
func CheckActivationcode ¶
func CheckAdminRole ¶
func CheckEditRole ¶
func CheckReadRole ¶
func CheckReadonly ¶
func CheckUpdate ¶
func CheckUpdate(showMsg bool)
func CheckoutRepo ¶
func CheckoutRepo(id string)
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 ContentStat ¶
func ContentStat(content string) (ret *util.BlockStatResult)
func ControlConcurrency ¶
func CreateCloudSyncDir ¶
func CreateDocByMd ¶
func CreateWithMarkdown ¶
func DeactivateUser ¶
func DeactivateUser() (err error)
func Doc2Heading ¶
func DocImageAssets ¶
func DocSaveAsTemplate ¶
func DownloadCloudSnapshot ¶
func DuplicateDatabaseBlock ¶
func DuplicateDoc ¶
func Export2Liandi ¶
func ExportAv2CSV ¶
func ExportData ¶
func ExportDataInFolder ¶
func ExportDocx ¶
func ExportHTML ¶
func ExportMarkdownContent ¶
func ExportMarkdownHTML ¶
func ExportNotebookMarkdown ¶
func ExportNotebookSY ¶
func ExportPandocConvertZip ¶
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 GetAssetAbsPath ¶
func GetAttributeView ¶
func GetAttributeView(avID string) (ret *av.AttributeView)
func GetAttributeViewFilterSort ¶
func GetAttributeViewFilterSort(avID, blockID string) (filters []*av.ViewFilter, sorts []*av.ViewSort)
func GetBlockDOM ¶
func GetBlockDefIDsByRefText ¶
func GetBlockIndex ¶
func GetBlockKramdown ¶
func GetBlockRefText ¶
func GetBlockRefs ¶
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 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 GetPackageREADME ¶
func GetPathByID ¶
func GetTokenClaims ¶
func GetTokenClaims(token *jwt.Token) jwt.MapClaims
func HTML2Markdown ¶
func HandleSignal ¶
func HandleSignal()
func Heading2Doc ¶
func HideConfSecret ¶
func HideConfSecret(c *AppConf)
REF: https://github.com/siyuan-note/siyuan/issues/11364 HideConfSecret 隐藏设置中的秘密信息
func HomeSetPathPath ¶
func HomeSetPathPath() string
HomeSetPathPath returns the absolute path of the address book home set directory
func HookDesktopUIProcJob ¶
func HookDesktopUIProcJob()
func ImportData ¶
func ImportFromLocalPath ¶
func ImportRepoKey ¶
func IndexAssetContent ¶
func IndexAssetContent(absPath string)
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 IsReadOnlyRole ¶
func IsSubscriber ¶
func IsSubscriber() bool
func IsSyncingFile ¶
func IsUserGuide ¶
func IsValidRole ¶
func ListItem2Doc ¶
func LoadFlashcards ¶
func LoadFlashcards()
func LoadSnippets ¶
func LoadUploadToken ¶
func LoadUploadToken() (err error)
func LogoutAuth ¶
func LogoutUser ¶
func LogoutUser()
func MissingAssets ¶
func MissingAssets() (ret []string)
func NetAssets2LocalAssets ¶
func OCRAssetsJob ¶
func OCRAssetsJob()
func OpenRepoSnapshotDoc ¶
func ParseAddressPath ¶
ParseAddressPath parses address path to address book path and address ID
func ParseXAuthToken ¶
func PerformTransactions ¶
func PerformTransactions(transactions *[]*Transaction)
func ProcessPDF ¶
func PurgeCloud ¶
func PurgeCloud() (err error)
func RefreshBacklink ¶
func RefreshBacklink(id string)
func RefreshCheckJob ¶
func RefreshCheckJob()
func RefreshUser ¶
func RefreshUser(token string)
func ReindexAssetContent ¶
func ReindexAssetContent()
func ReindexHistory ¶
func ReindexHistory()
func RemoveAttributeViewKey ¶
func RemoveBookmark ¶
func RemoveCloudRepoTag ¶
func RemoveCloudShorthands ¶
func RemoveCloudSyncDir ¶
func RemoveCriterion ¶
func RemoveDeck ¶
func RemoveDocs ¶
func RemoveDocs(paths []string)
func RemoveIndexAssetContent ¶
func RemoveIndexAssetContent(absPath string)
func RemoveIndexes ¶
func RemoveIndexes(paths []string)
func RemoveLocalStorageVals ¶
func RemoveRecentDoc ¶
func RemoveRecentDoc(ids []string)
func RemoveTagSnapshot ¶
func RemoveTemplate ¶
func RemoveUnusedAsset ¶
func RemoveUnusedAssets ¶
func RemoveUnusedAssets() (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 SearchAssetsByName ¶
func SearchDocsByKeyword ¶
func SearchTags ¶
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 SetSnippet ¶
func SetSyncEnable ¶
func SetSyncEnable(b bool)
func SetSyncGenerateConflictDoc ¶
func SetSyncGenerateConflictDoc(b bool)
func SetSyncMode ¶
func SetSyncMode(mode int)
func SetSyncPerception ¶
func SetSyncPerception(b bool)
func SetSyncProvider ¶
func SetSyncProviderS3 ¶
func SetSyncProviderWebDAV ¶
func SkipReviewFlashcard ¶
func SortAttributeViewKey ¶
func StartFreeTrial ¶
func StartFreeTrial() (err error)
func StatTree ¶
func StatTree(id string) (ret *util.BlockStatResult)
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 UnusedAssets ¶
func UnusedAssets() (ret []string)
func UpdateAttributeViewCell ¶
func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueData interface{}) (val *av.Value, err error)
func UpdateEmbedBlock ¶
func UpdatedPackages ¶
func UploadAssets2Cloud ¶
func UploadCloudSnapshot ¶
func UpsertIndexes ¶
func UpsertIndexes(paths []string)
func UseActivationcode ¶
func WatchAssets ¶
func WatchAssets()
func WatchEmojis ¶
func WatchEmojis()
Types ¶
type Account ¶
func GetBasicAuthAccount ¶
type AccountsMap ¶
type AddressBook ¶
type AddressObject ¶
type AddressObject struct { Changed bool FilePath string BookPath string Data *carddav.AddressObject }
type Announcement ¶
type Announcement struct { Id string `json:"id"` Title string `json:"title"` URL string `json:"url"` Region int `json:"region"` }
func GetAnnouncements ¶
func GetAnnouncements() (ret []*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"` // 是否是以只读模式运行 LocalIPs []string `json:"localIPs"` // 本地 IP 列表 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:未索引 // 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 Backlink ¶
type Backlink struct { DOM string `json:"dom"` BlockPaths []*BlockPath `json:"blockPaths"` Expand bool `json:"expand"` // contains filtered or unexported fields }
func GetBacklinkDoc ¶
func GetBackmentionDoc ¶
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"` 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(blockID 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 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 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) 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"` }
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 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"` // 用于标识是否未绑定块,仅存在于属性视图中 IgnoreFillFilterVal bool `json:"ignoreFillFilter"` // 用于标识是否忽略填充筛选值 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"` // 属性视图删除关联目标 }
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"` // 子块计数 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 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"` Title string `json:"title"` }
func GetRecentDocs ¶
type Role ¶
type Role uint
func GetClaimRole ¶
func GetClaimRole(claims jwt.MapClaims) Role
func GetGinContextRole ¶
type SearchAttributeViewResult ¶
type SearchAttributeViewResult struct { AvID string `json:"avID"` AvName string `json:"avName"` BlockID string `json:"blockID"` HPath string `json:"hPath"` }
func SearchAttributeView ¶
func SearchAttributeView(keyword string, excludeAvIDs []string) (ret []*SearchAttributeViewResult)
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 GetHeadingLevelTransaction ¶
func GetHeadingLevelTransaction(id string, level int) (transaction *Transaction, err error)
func (*Transaction) WaitForCommit ¶
func (tx *Transaction) WaitForCommit()
type TxtAssetParser ¶
type TxtAssetParser struct { }
func (*TxtAssetParser) Parse ¶
func (parser *TxtAssetParser) Parse(absPath string) (ret *AssetParseResult)
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
- auth.go
- backlink.go
- bazzar.go
- block.go
- blockial.go
- blockinfo.go
- bookmark.go
- box.go
- carddav.go
- cloud_service.go
- conf.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
- plugin.go
- process.go
- push_reload.go
- render.go
- repository.go
- role.go
- search.go
- session.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