Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bodhiye/paste
/ functions
Functions
81 in github.com/bodhiye/paste
⨍
Functions
81
◇
Types & classes
18
↓ 5 callers
Function
format
* {@link https://wcoder.github.io/notes/string-format-for-string-formating-in-javascript} * @param {string} format * @param {array} args
web/src/utils/highlightjs-line-numbers.js:260
↓ 4 callers
Method
SnippetsLength
()
server/util/limit.go:20
↓ 3 callers
Method
Get
(ctx context.Context, key, password string)
server/db/paste.go:27
↓ 3 callers
Method
Set
(ctx context.Context, entry PasteEntry)
server/db/paste.go:26
↓ 3 callers
Function
setI18nLanguage
(lang)
web/src/assets/i18n.js:16
↓ 2 callers
Function
GenReqID
GenReqID 生成一个新的请求ID 该ID是由进程ID和当前的纳秒时间戳组成的,并使用Base64 URL编码格式返回
server/util/reqid.go:23
↓ 2 callers
Method
ImagesCount
()
server/util/limit.go:38
↓ 2 callers
Method
ImagesSize
()
server/util/limit.go:32
↓ 2 callers
Method
Init
Init 方法用于初始化 MongoDB 的集合,例如创建索引
server/db/paste.go:80
↓ 2 callers
Method
SnippetsCount
()
server/util/limit.go:26
↓ 2 callers
Function
getLines
(text)
web/src/utils/highlightjs-line-numbers.js:242
↓ 2 callers
Function
r
(n)
web/src/utils/markdown-it-mermaid.js:4
↓ 2 callers
Function
setDefaultLimits
设置默认限制值
server/util/limit.go:70
↓ 2 callers
Function
u
(e)
web/src/utils/markdown-it-mermaid.js:28
↓ 1 callers
Function
EnsureWithReqId
EnsureWithReqId 确保上下文中有一个请求ID 如果没有请求ID,则生成一个新的请求ID并将其添加到上下文中 返回更新后的上下文和请求ID
server/util/reqid.go:66
↓ 1 callers
Function
FileToBase64
将文件转换为base64编码
server/storage/storage.go:85
↓ 1 callers
Method
GetSignedURL
(ctx context.Context, objectKey string)
server/storage/oss.go:26
↓ 1 callers
Function
Instance
(key = "", problem_id = "")
web/src/utils/markdown-it.js:9
↓ 1 callers
Function
NewOSSWithFactory
(provider string)
server/storage/oss.go:29
↓ 1 callers
Function
NewTencentOSS
()
server/storage/tencent.go:33
↓ 1 callers
Method
SetLifeCycle
(ctx context.Context)
server/storage/tencent.go:102
↓ 1 callers
Function
StorageInCloud
StorageInCloud 将文件上传到云存储并返回 ObjectKey
server/storage/storage.go:181
↓ 1 callers
Method
Upload
(ctx context.Context, content io.Reader, opts UploadOptions)
server/storage/oss.go:24
↓ 1 callers
Function
WithReqId
WithReqId 将请求ID添加到上下文中 返回一个包含该请求ID的新上下文
server/util/reqid.go:58
↓ 1 callers
Function
addLineNumbersBlockFor
(inputHtml, firstLineIndex)
web/src/utils/highlightjs-line-numbers.js:160
↓ 1 callers
Function
addStyles
()
web/src/utils/highlightjs-line-numbers.js:124
↓ 1 callers
Function
async
(func)
web/src/utils/highlightjs-line-numbers.js:251
↓ 1 callers
Function
duplicateMultilineNode
* Method for fix multi-line elements implementation in highlight.js * @param {HTMLElement} element
web/src/utils/highlightjs-line-numbers.js:225
↓ 1 callers
Function
duplicateMultilineNodes
* Recursive method for fix multi-line elements implementation in highlight.js * Doing deep passage on child nodes. * @param {HTMLElement} element
web/src/utils/highlightjs-line-numbers.js:204
↓ 1 callers
Function
edgeGetSelectedCodeLines
(selection)
web/src/utils/highlightjs-line-numbers.js:41
↓ 1 callers
Function
ensureValidLimits
确保所有限制值都是有效的
server/util/limit.go:78
↓ 1 callers
Function
getHljsLnTable
(hljsLnDomElt)
web/src/utils/highlightjs-line-numbers.js:28
↓ 1 callers
Function
getLinesCount
(text)
web/src/utils/highlightjs-line-numbers.js:247
↓ 1 callers
Function
isHljsLnCodeDescendant
(domElt)
web/src/utils/highlightjs-line-numbers.js:17
↓ 1 callers
Method
isOnceDocument
isOnceDocument 检查文档是否是一次性文档
server/db/paste.go:172
↓ 1 callers
Function
lineNumbersInternal
(element, options)
web/src/utils/highlightjs-line-numbers.js:146
↓ 1 callers
Function
markdownPack
(html)
web/src/utils/markdown-it.js:35
↓ 1 callers
Function
preToSegment
(html)
web/src/utils/markdown-it.js:40
↓ 1 callers
Function
withLogger
withLogger 将一个 *logrus.Entry 实例添加到 context 中,并返回一个新的 context
server/util/logger.go:42
Function
EnsureWithLogger
EnsureWithLogger 确保 context 中存在一个 *logrus.Entry 实例 如果 context 中已存在 logger,则直接返回该 context 和 logger 如果不存在,则创建一个新的 logger(包含请求 ID),将其添加到 context 中 然后返回新的
server/util/logger.go:50
Method
Get
Get 方法根据提供的键和密码检索相应的 PasteEntry
server/db/paste.go:137
Method
GetCollection
()
server/db/paste.go:28
Method
GetCollection
GetCollection 返回 MongoDB 的集合
server/db/paste.go:110
Function
GetLogger
(ctx context.Context)
server/util/logger.go:30
Function
GetMongoClient
GetMongoClient 返回全局MongoDB客户端实例
server/db/paste.go:44
Method
GetPaste
获取分享内容
server/service/service.go:219
Function
GetReqID
GetReqID 从给定的上下文中获取请求ID 如果上下文中没有请求ID,生成并返回一个新的请求ID
server/util/reqid.go:39
Function
GetServerHost
GetServerHost 尝试替换原本从配置文件中设置的 服务器地址的端口号
server/util/service.go:53
Method
GetSignedURL
GetSignedURL 生成带签名的临时访问 URL
server/storage/tencent.go:151
Function
Init
注册路由
server/router/router.go:12
Function
InitializeLimits
InitializeLimits 从 Viper 加载 limit 配置
server/util/limit.go:45
Function
InitializeStorage
InitializeStorage 初始化存储配置
server/storage/storage.go:57
Function
LoadConfig
加载配置
server/util/service.go:16
Function
NewPaste
(ctx context.Context, viper_ *viper.Viper)
server/db/paste.go:50
Method
PostPaste
创建分享内容
server/service/service.go:23
Method
PostPasteOnce
创建一次性分享内容
server/service/service.go:131
Function
RandString
RandString 返回一个指定长度的随机字符串
server/util/util.go:28
Function
ReqID
中间件,用于为每个请求生成或提取唯一的请求 ID。
server/middleware/logger.go:29
Function
RunServer
启动服务器
server/util/service.go:29
Method
Set
Set 方法将新的 PasteEntry 存储到 MongoDB 中,并返回生成的唯一键
server/db/paste.go:115
Method
SetLifeCycle
(ctx context.Context)
server/storage/oss.go:25
Function
ShutdownServer
ShutdownServer 优雅地关闭服务器,等待当前活动连接完成
server/util/service.go:38
Function
String2bcrypt
String2bcryt 返回输入字符串的 bcrypt 哈希值
server/util/util.go:53
Method
Upload
(ctx context.Context, content io.Reader, opts UploadOptions)
server/storage/tencent.go:78
Function
UploadImages
获取图片
server/storage/storage.go:97
Function
_baseUpdate
(object)
web/src/mixins/stateMixin.js:3
Function
emptyFunc
()
web/src/router/router.js:5
Function
i
(e)
web/src/utils/markdown-it-mermaid.js:36
Function
init
()
server/util/logger.go:12
Function
init
(state)
web/src/store/store.js:18
Function
lineNumbersBlock
(element, options)
web/src/utils/highlightjs-line-numbers.js:138
Function
main
()
server/main.go:22
Function
markdownItLinkTarget
(md, config)
web/src/utils/markdown-it-links.js:2
Function
updateContent
(content)
web/src/mixins/stateMixin.js:6
Function
updateKey
(key)
web/src/mixins/stateMixin.js:12
Function
updateLangtype
(langtype)
web/src/mixins/stateMixin.js:9
Function
updateMode
(state, payload)
web/src/store/store.js:21
Function
updateNotFound
(state, payload)
web/src/store/store.js:24
Function
updateState
(state, payload)
web/src/store/store.js:27
Function
updateView
(view)
web/src/mixins/stateMixin.js:15
Function
uslugify
web/src/utils/markdown-it.js:7