learning_go/pkg/mod/github.com/ceph/go-ceph@v0.35.0/rgw/admin
a.pivkin c5bc4da2c3 sdf
2025-09-08 07:26:27 +03:00
..
bucket_quota_test.go sdf 2025-09-08 07:26:27 +03:00
bucket_quota.go sdf 2025-09-08 07:26:27 +03:00
bucket_test.go sdf 2025-09-08 07:26:27 +03:00
bucket.go sdf 2025-09-08 07:26:27 +03:00
caps_test.go sdf 2025-09-08 07:26:27 +03:00
caps.go sdf 2025-09-08 07:26:27 +03:00
check_bucket_index_test.go sdf 2025-09-08 07:26:27 +03:00
check_bucket_index.go sdf 2025-09-08 07:26:27 +03:00
doc.go sdf 2025-09-08 07:26:27 +03:00
errors_test.go sdf 2025-09-08 07:26:27 +03:00
errors.go sdf 2025-09-08 07:26:27 +03:00
info_test.go sdf 2025-09-08 07:26:27 +03:00
info.go sdf 2025-09-08 07:26:27 +03:00
keys_test.go sdf 2025-09-08 07:26:27 +03:00
keys.go sdf 2025-09-08 07:26:27 +03:00
link_test.go sdf 2025-09-08 07:26:27 +03:00
link.go sdf 2025-09-08 07:26:27 +03:00
list_bucket_with_stats_test.go sdf 2025-09-08 07:26:27 +03:00
list_bucket_with_stats.go sdf 2025-09-08 07:26:27 +03:00
quota_test.go sdf 2025-09-08 07:26:27 +03:00
quota.go sdf 2025-09-08 07:26:27 +03:00
radosgw_test.go sdf 2025-09-08 07:26:27 +03:00
radosgw.go sdf 2025-09-08 07:26:27 +03:00
README.md sdf 2025-09-08 07:26:27 +03:00
subuser_test.go sdf 2025-09-08 07:26:27 +03:00
subuser.go sdf 2025-09-08 07:26:27 +03:00
usage_test.go sdf 2025-09-08 07:26:27 +03:00
usage.go sdf 2025-09-08 07:26:27 +03:00
user_bucket_quota_test.go sdf 2025-09-08 07:26:27 +03:00
user_bucket_quota.go sdf 2025-09-08 07:26:27 +03:00
user_bucket_test.go sdf 2025-09-08 07:26:27 +03:00
user_bucket.go sdf 2025-09-08 07:26:27 +03:00
user_test.go sdf 2025-09-08 07:26:27 +03:00
user.go sdf 2025-09-08 07:26:27 +03:00
utils_test.go sdf 2025-09-08 07:26:27 +03:00
utils.go sdf 2025-09-08 07:26:27 +03:00

Prerequisites

You must create an admin user like so:

radosgw-admin user create --uid admin --display-name "Admin User" --caps "buckets=*;users=*;usage=read;metadata=read;zone=read --access-key=AKIAIOSFODNN7EXAMPLE --secret-key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Then use the access_key and secret_key for authentication.

Snippet usage example:

package main

import (
    "github.com/ceph/go-ceph/rgw/admin"
)

func main() {
    // Generate a connection object
    co, err := admin.New("http://192.168.1.1", "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", nil)
    if err != nil {
        panic(err)
    }

    // Get the "admin" user
    user, err := co.GetUser(context.Background(), admin.User{ID: "admin"})
    if err != nil {
        panic(err)
    }

    // Print the user display name
    fmt.Println(user.DisplayName)
}