Versions in this module Expand all Collapse all v0 v0.0.2 Jan 30, 2023 Changes in this version + const AliyunServer + const BLOCK_BITS + const BLOCK_SIZE + const BazaarOSSServer + const BazaarStatServer + const ContainerAndroid + const ContainerDocker + const ContainerIOS + const ContainerStd + const DatabaseVer + const ExitCodeBlockTreeErr + const ExitCodeCreateConfDirErr + const ExitCodeCreateWorkspaceDirErr + const ExitCodeFatal + const ExitCodeOk + const ExitCodeReadOnlyDatabase + const ExitCodeUnavailablePort + const ExitCodeWorkspaceLocked + const FixedPort + const FrontendQueueInterval + const IsInsider + const LiandiServer + const LocalHost + const PushProgressCodeEnd + const PushProgressCodeEndless + const PushProgressCodeProgressed + const SQLFlushInterval + const SiYuanSyncServer + const SortModeAlphanumASC + const SortModeAlphanumDESC + const SortModeCreatedASC + const SortModeCreatedDESC + const SortModeCustom + const SortModeNameASC + const SortModeNameDESC + const SortModeRefCountASC + const SortModeRefCountDESC + const SortModeSizeASC + const SortModeSizeDESC + const SortModeSubDocCountASC + const SortModeSubDocCountDESC + const SortModeUpdatedASC + const SortModeUpdatedDESC + const Ver + var AccessAuthCode string + var AppearancePath string + var AssetsTexts = map[string]string + var AssetsTextsChanged = false + var AssetsTextsLock = sync.Mutex + var BlockTreePath string + var ConfDir string + var Container string + var DBName = "siyuan.db" + var DBPath string + var DataDir string + var HistoryDBPath string + var HistoryDir string + var HomeDir = gulu.OS.Home() + var HttpServing = false + var ISMicrosoftStore bool + var IconsPath string + var IsNewbie bool + var Lang = "" + var LocalIPs []string + var LogPath string + var Mode = "prod" + var PandocBinPath string + var ReadOnly bool + var RepoDir string + var SK = []byte("696D897C9AA0611B") + var SSL = false + var ServerPort = "0" + var SnippetsPath string + var TempDir string + var TesseractEnabled bool + var TesseractLangs []string + var ThemesPath string + var UIProcessIDs = sync.Map + var UserAgent = "SiYuan/" + Ver + var WebSocketServer = melody.New() + var WorkingDir = os.Getwd() + var WorkspaceDir string + var WorkspaceLock *flock.Flock + var WrongAuthCount int + func AESDecrypt(cryptStr string) []byte + func AESEncrypt(str string) string + func AddPushChan(session *melody.Session) + func AssetName(name string) string + func BlockCount(fsize int64) int + func Boot() + func BootMobile(container, appDir, workspaceBaseDir, lang string) + func Broadcast(msg []byte) + func BroadcastByType(typ, cmd string, code int, msg string, data interface{}) + func CalSha1(b []byte, r io.Reader) ([]byte, error) + func CeilSize(size int64) int64 + func ClearPushProgress(total int) + func ClosePushChan(id string) + func ContextPushMsg(context map[string]interface{}, msg string) + func CountSessions() (ret int) + func CurrentTimeMillis() int64 + func CurrentTimeSecondsStr() string + func DataSize() (dataSize, assetsSize int64) + func EscapeHTML(s string) string + func FilterFileName(name string) string + func FilterFilePath(p string) (ret string) + func FilterMoveDocFromPaths(fromPaths []string, toPath string) (ret []string) + func FilterSelfChildDocs(paths []string) (ret []string) + func FilterUploadFileName(name string) string + func GBK2UTF8(src []byte) (string, error) + func GetAssetText(asset string) string + func GetBootProgress() float64 + func GetBootProgressDetails() (float64, string) + func GetChildDocDepth(treeAbsPath string) (ret int) + func GetDataAssetsAbsPath() (ret string) + func GetDeviceID() string + func GetEtag(filename string) (etag string, err error) + func GetEtagByHandle(f io.Reader, size int64) (etag string, err error) + func GetLocalIPs() (ret []string) + func GetRemoteAddr(session *melody.Session) string + func GetRhyResult(force bool) (map[string]interface{}, error) + func GetSysFonts(currentLanguage string) (ret []string) + func IncBootProgress(progress float64, details string) + func IsAssetLinkDest(dest []byte) bool + func IsBooted() bool + func IsCorruptedSYData(data []byte) bool + func IsEmptyDir(p string) bool + func IsIDPattern(str string) bool + func IsMutexLocked(m *sync.Mutex) bool + func IsRelativePath(dest string) bool + func IsReservedFilename(baseName string) bool + func IsSubFolder(parent, sub string) bool + func IsValidPandocBin(binPath string) bool + func IsWorkspaceLocked(workspacePath string) bool + func JsonArg(c *gin.Context, result *gulu.Result) (arg map[string]interface{}, ok bool) + func LastID(p string) (name, id string) + func LatestTmpFile(p string) string + func Millisecond2Time(t int64) time.Time + func NeedCaptcha() bool + func NeedWarnDiskUsage(dataSize int64) bool + func NewLute() (ret *lute.Lute) + func NormalizeEndpoint(endpoint string) string + func NormalizeTimeout(timeout int) int + func PinYinCompare(str1, str2 string) bool + func PushClearAllMsg() + func PushClearMsg(msgId string) + func PushClearProgress() + func PushDownloadProgress(id string, percent float32) + func PushEndlessProgress(msg string) + func PushErrMsg(msg string, timeout int) (msgId string) + func PushEvent(event *Result) + func PushMsg(msg string, timeout int) (msgId string) + func PushProgress(code, current, total int, msg string) + func PushStatusBar(msg string) + func PushTxErr(msg string, code int, data interface{}) + func PushUpdateMsg(msgId string, msg string, timeout int) + func RandomSleep(minMills, maxMills int) + func ReadWorkspacePaths() (ret []string, err error) + func ReloadUI() + func RemoveEmoji(text string) string + func RemoveID(name string) string + func RemovePushChan(session *melody.Session) + func RemoveWorkspaceSession(session *SessionData) + func Reverse(s string) string + func SessionsByType(typ string) (ret []*melody.Session) + func SetBootDetails(details string) + func SetBooted() + func SetNetworkProxy(proxyURL string) + func ShortPathForBootingDisplay(p string) string + func SizeOfDirectory(path string) (size int64, err error) + func Tesseract(imgAbsPath string) string + func TimeFromID(id string) (ret string) + func UTF82GBK(src string) ([]byte, error) + func UnlockWorkspace() + func WriteWorkspacePaths(workspacePaths []string) (err error) + type BlockStatResult struct + ImageCount int + LinkCount int + RefCount int + RuneCount int + WordCount int + type PushMode int + const PushModeBroadcast + const PushModeBroadcastApp + const PushModeBroadcastExcludeSelf + const PushModeBroadcastExcludeSelfApp + const PushModeBroadcastMainExcludeSelfApp + const PushModeSingleSelf + type Result struct + AppId string + Callback interface{} + Cmd string + Code int + Data interface{} + Msg string + PushMode PushMode + ReqId float64 + SessionId string + func NewCmdResult(cmdName string, cmdId float64, pushMode PushMode) *Result + func NewResult() *Result + func (r *Result) Bytes() []byte + type SessionData struct + Workspaces map[string]*WorkspaceSession + func GetSession(c *gin.Context) *SessionData + func (sd *SessionData) Save(c *gin.Context) error + type WorkspaceSession struct + AccessAuthCode string + Captcha string + func GetWorkspaceSession(session *SessionData) (ret *WorkspaceSession)