Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
01f9ef3c
提交
01f9ef3c
authored
1月 10, 2015
作者:
Juan Batiz-Benet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added fuseversion for osxfuse
上级
05a0a944
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
163 行增加
和
0 行删除
+163
-0
Godeps.json
Godeps/Godeps.json
+4
-0
README.md
...workspace/src/github.com/jbenet/go-fuse-version/README.md
+45
-0
.gitignore
...rc/github.com/jbenet/go-fuse-version/fuseprint/.gitignore
+1
-0
README.md
...src/github.com/jbenet/go-fuse-version/fuseprint/README.md
+2
-0
index.go
.../src/github.com/jbenet/go-fuse-version/fuseprint/index.go
+21
-0
version.go
...orkspace/src/github.com/jbenet/go-fuse-version/version.go
+37
-0
version_bsd.go
...pace/src/github.com/jbenet/go-fuse-version/version_bsd.go
+11
-0
version_darwin.go
...e/src/github.com/jbenet/go-fuse-version/version_darwin.go
+24
-0
version_linux.go
...ce/src/github.com/jbenet/go-fuse-version/version_linux.go
+9
-0
version_windows.go
.../src/github.com/jbenet/go-fuse-version/version_windows.go
+9
-0
没有找到文件。
Godeps/Godeps.json
浏览文件 @
01f9ef3c
...
...
@@ -109,6 +109,10 @@
"Rev"
:
"6a1c83bda2a71a9bdc936749fdb507df958ed949"
},
{
"ImportPath"
:
"github.com/jbenet/go-fuse-version"
,
"Rev"
:
"ff72c39433f95ada15f116fa493a51eeec2bd52e"
},
{
"ImportPath"
:
"github.com/jbenet/go-is-domain"
,
"Rev"
:
"93b717f2ae17838a265e30277275ee99ee7198d6"
},
...
...
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/README.md
0 → 100644
浏览文件 @
01f9ef3c
# go-fuse-version
Simple package to get the user's FUSE libraries information.
-
Godoc: https://godoc.org/github.com/jbenet/go-fuse-version
**Warning**
Currently only supports OSXFUSE. if you want more, add them, it's really trivial now.
## Example
```
Go
package main
import (
"fmt"
"os"
fuseversion "github.com/jbenet/go-fuse-version"
)
func main() {
sys, err := fuseversion.LocalFuseSystems()
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
}
fmt.Printf("FuseVersion, AgentVersion, Agent\n")
for _, s := range *sys {
fmt.Printf("%s, %s, %s\n", s.FuseVersion, s.AgentVersion, s.AgentName)
}
}
```
## fuseprint
If you dont use Go, you can also install the example as the silly util fuseprint:
```
> go get github.com/jbenet/go-fuse-version/fuseprint
> go install github.com/jbenet/go-fuse-version/fuseprint
> fuseprint
FuseVersion, AgentVersion, Agent
27, 2.7.2, OSXFUSE
```
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/fuseprint/.gitignore
0 → 100644
浏览文件 @
01f9ef3c
fuseprint
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/fuseprint/README.md
0 → 120000
浏览文件 @
01f9ef3c
../README.md
\ No newline at end of file
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/fuseprint/index.go
0 → 100644
浏览文件 @
01f9ef3c
package
main
import
(
"fmt"
"os"
fuseversion
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-fuse-version"
)
func
main
()
{
sys
,
err
:=
fuseversion
.
LocalFuseSystems
()
if
err
!=
nil
{
fmt
.
Fprintf
(
os
.
Stderr
,
"%s
\n
"
,
err
)
os
.
Exit
(
1
)
}
fmt
.
Printf
(
"FuseVersion, AgentVersion, Agent
\n
"
)
for
_
,
s
:=
range
*
sys
{
fmt
.
Printf
(
"%s, %s, %s
\n
"
,
s
.
FuseVersion
,
s
.
AgentVersion
,
s
.
AgentName
)
}
}
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/version.go
0 → 100644
浏览文件 @
01f9ef3c
// package fuseversion simply exposes the version of FUSE installed
// in the user's machine. For reasoning, see:
// - https://github.com/jbenet/go-ipfs/issues/177
// - https://github.com/jbenet/go-ipfs/issues/202
// - https://github.com/osxfuse/osxfuse/issues/175#issuecomment-61888505
package
fuseversion
type
Systems
map
[
string
]
FuseSystem
type
FuseSystem
struct
{
// FuseVersion is the version of the FUSE protocol
FuseVersion
string
// AgentName identifies the system implementing FUSE, or Agent
AgentName
string
// AgentVersion is the version of the Agent program
// (it fights for the user! Sometimes it fights the user...)
AgentVersion
string
}
// LocalFuseSystems returns a map of FuseSystems, keyed by name.
// For example:
//
// systems := fuseversion.LocalFuseSystems()
// for n, sys := range systems {
// fmt.Printf("%s, %s, %s", n, sys.FuseVersion, sys.AgentVersion)
// }
// // Outputs:
// // OSXFUSE, , 2.7.2
//
func
LocalFuseSystems
()
(
*
Systems
,
error
)
{
return
getLocalFuseSystems
()
// implemented by each platform
}
var
notImplYet
=
`Error: not implemented for %s yet. :(
Please do it: https://github.com/jbenet/go-fuse-version`
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/version_bsd.go
0 → 100644
浏览文件 @
01f9ef3c
// +build dragonfly freebsd netbsd openbsd
package
fuseversion
import
(
"runtime"
)
func
getLocalFuseSystems
()
(
*
Systems
,
error
)
{
return
nil
,
fmt
.
Sprintf
(
notImplYet
,
runtime
.
GOARCH
())
}
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/version_darwin.go
0 → 100644
浏览文件 @
01f9ef3c
package
fuseversion
// #cgo CFLAGS: -I /usr/local/include/osxfuse/ -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=25
// #cgo LDFLAGS: /usr/local/lib/libosxfuse.dylib
//
// #include <fuse/fuse.h>
// #include <fuse/fuse_common.h>
// #include <fuse/fuse_darwin.h>
import
"C"
import
"fmt"
func
getLocalFuseSystems
()
(
*
Systems
,
error
)
{
sys
:=
Systems
{}
sys
[
"OSXFUSE"
]
=
getOSXFUSE
()
return
&
sys
,
nil
}
func
getOSXFUSE
()
FuseSystem
{
return
FuseSystem
{
FuseVersion
:
fmt
.
Sprintf
(
"%d"
,
int
(
C
.
fuse_version
())),
AgentName
:
"OSXFUSE"
,
AgentVersion
:
C
.
GoString
(
C
.
osxfuse_version
()),
}
}
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/version_linux.go
0 → 100644
浏览文件 @
01f9ef3c
package
fuseversion
import
(
"runtime"
)
func
getLocalFuseSystems
()
(
*
Systems
,
error
)
{
return
nil
,
fmt
.
Sprintf
(
notImplYet
,
runtime
.
GOARCH
())
}
Godeps/_workspace/src/github.com/jbenet/go-fuse-version/version_windows.go
0 → 100644
浏览文件 @
01f9ef3c
package
fuseversion
import
(
"runtime"
)
func
getLocalFuseSystems
()
(
*
Systems
,
error
)
{
return
nil
,
fmt
.
Sprintf
(
notImplYet
,
runtime
.
GOARCH
())
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论