cephconn
This commit is contained in:
parent
fd57dc9b95
commit
45097b6b76
15
ceph/ceph.go
Normal file
15
ceph/ceph.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ceph/go-ceph/rados"
|
||||
)
|
||||
|
||||
|
||||
func main() {
|
||||
connection,err := rados.NewConnWithClusterAndUser("ceph","client.admin")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(connection)
|
||||
}
|
||||
8
ceph/go.mod
Normal file
8
ceph/go.mod
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module main
|
||||
|
||||
go 1.24.6
|
||||
|
||||
require (
|
||||
github.com/ceph/go-ceph v0.35.0 // indirect
|
||||
golang.org/x/sys v0.34.0 // indirect
|
||||
)
|
||||
4
ceph/go.sum
Normal file
4
ceph/go.sum
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
github.com/ceph/go-ceph v0.35.0 h1:wcDUbsjeNJ7OfbWCE7I5prqUL794uXchopw3IvrGQkk=
|
||||
github.com/ceph/go-ceph v0.35.0/go.mod h1:ILF8WKhQQ2p2YuX1oWigkmsfT39U8T/HS2NrqxExq2s=
|
||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
10
ceph/types.go
Normal file
10
ceph/types.go
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package main
|
||||
|
||||
import "time"
|
||||
|
||||
const config = "/etc/ceph/ceph.conf"
|
||||
|
||||
type params struct {
|
||||
duration time.Duration
|
||||
blockSize uint64
|
||||
}
|
||||
18
flags/flags.go
Normal file
18
flags/flags.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/juju/gnuflag"
|
||||
)
|
||||
|
||||
func main() {
|
||||
wordPtr := gnuflag.String("word","foo","a string")
|
||||
|
||||
var svar string
|
||||
gnuflag.StringVar(&svar,"svar","bar","a svar string")
|
||||
|
||||
gnuflag.Parse(false)
|
||||
|
||||
fmt.Println("word ", *wordPtr)
|
||||
fmt.Println("svar ",svar)
|
||||
}
|
||||
5
flags/go.mod
Normal file
5
flags/go.mod
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
module main
|
||||
|
||||
go 1.24.6
|
||||
|
||||
require github.com/juju/gnuflag v1.0.0 // indirect
|
||||
2
flags/go.sum
Normal file
2
flags/go.sum
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
github.com/juju/gnuflag v1.0.0 h1:E6OmPEi2nqJYanlIw7a+bUF+FDiK3uSBHftRmQi3muQ=
|
||||
github.com/juju/gnuflag v1.0.0/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
|
||||
BIN
flags/main
Executable file
BIN
flags/main
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user