1 Star 0 Fork 0

zhangv2012/kubo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
version.go 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
Marcin Rataj 提交于 2024-10-30 17:44 . chore: bump master to 0.33.0-dev
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(),
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangv2012/kubo.git
git@gitee.com:zhangv2012/kubo.git
zhangv2012
kubo
kubo
master

搜索帮助