This commit is contained in:
Alexander Pivkin 2025-09-05 15:58:57 +03:00
parent 25bae7a7e1
commit 5b253ebafb
2 changed files with 8 additions and 1 deletions

View File

@ -2,15 +2,21 @@ package main
import ( import (
"fmt" "fmt"
"log"
"github.com/ceph/go-ceph/rados" "github.com/ceph/go-ceph/rados"
) )
func main() { func main() {
params := params{"ceph","admin"} params := params{"ceph","admin","/etc/ceph/ceph.conf"}
connection,err := rados.NewConnWithClusterAndUser(params.cluster,params.user) connection,err := rados.NewConnWithClusterAndUser(params.cluster,params.user)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
} }
fmt.Printf("%#v", connection) fmt.Printf("%#v", connection)
if err = connection.ReadConfigFile(params.config); err != nil {
log.Fatalln("Cannot read config file")
}
} }

View File

@ -5,4 +5,5 @@ const config = "/etc/ceph/ceph.conf"
type params struct { type params struct {
cluster string cluster string
user string user string
config string
} }