代码拉取完成,页面将自动刷新
package ipfs
import (
"fmt"
"runtime"
"github.com/ipfs/kubo/repo/fsrepo"
)
// CurrentCommit is the current git commit, this is set as a ldflag in the Makefile.
var CurrentCommit string
// CurrentVersionNumber is the current application's version literal.
const CurrentVersionNumber = "0.33.0-dev"
const ApiVersion = "/kubo/" + CurrentVersionNumber + "/" //nolint
// GetUserAgentVersion is the libp2p user agent used by go-ipfs.
//
// Note: This will end in `/` when no commit is available. This is expected.
func GetUserAgentVersion() string {
userAgent := "kubo/" + CurrentVersionNumber + "/" + CurrentCommit
if userAgentSuffix != "" {
if CurrentCommit != "" {
userAgent += "/"
}
userAgent += userAgentSuffix
}
return userAgent
}
var userAgentSuffix string
func SetUserAgentSuffix(suffix string) {
userAgentSuffix = suffix
}
type VersionInfo struct {
Version string
Commit string
Repo string
System string
Golang string
}
func GetVersionInfo() *VersionInfo {
return &VersionInfo{
Version: CurrentVersionNumber,
Commit: CurrentCommit,
Repo: fmt.Sprint(fsrepo.RepoVersion),
System: runtime.GOARCH + "/" + runtime.GOOS, // TODO: Precise version here
Golang: runtime.Version(),
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。