项目作者: myENA

项目描述 :
Ceph Rados Gateway Admin API Go Language Bindings
高级语言: Go
项目地址: git://github.com/myENA/radosgwadmin.git
创建时间: 2017-07-27T19:42:03Z
项目社区:https://github.com/myENA/radosgwadmin

开源协议:Mozilla Public License 2.0

下载


Mozilla Public License
Go Report Card
GoDoc
Build Status

Package radosgwadmin wraps http://docs.ceph.com/docs/master/radosgw/adminops

Additionally, exposes some undocumented metadata operations (methods starting with ‘M’).

Requires Go 1.7 or newer. Tested with Jewel through Luminous releases of Ceph.

Example app:

  1. package main
  2. import (
  3. "context"
  4. "fmt"
  5. "time"
  6. rgw "github.com/myENA/radosgwadmin"
  7. rcl "github.com/myENA/restclient"
  8. )
  9. func main() {
  10. cfg := &rgw.Config{
  11. ClientConfig: rcl.ClientConfig{
  12. ClientTimeout: rcl.Duration(time.Second * 10),
  13. },
  14. ServerURL: "https://my.rgw.org/",
  15. AdminPath: "admin",
  16. AccessKeyID: "ABC123BLAHBLAHBLAH",
  17. SecretAccessKey: "IMASUPERSECRETACCESSKEY",
  18. }
  19. aa, err := rgw.NewAdminAPI(cfg)
  20. if err != nil {
  21. // do something, bail out.
  22. }
  23. users, err := aa.MListUsers(context.Background())
  24. if err != nil {
  25. // handle error
  26. return
  27. }
  28. fmt.Println(users)
  29. }

Input validation is provided by https://godoc.org/gopkg.in/go-playground/validator.v9