rgw_client

package
v0.0.0-...-d9abd48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2017 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERR_BUCKET_ALREADY_EXISTS = errors.New("BucketAlreadyExists")
View Source
var ERR_NOT_FOUND = errors.New("not found")

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Name         string `xml:"Name"`
	CreationDate string `xml:"CreationDate"`
}

type BucketQuota

type BucketQuota struct {
	Enabled     bool `json:"enabled, omitempty"`
	Max_size_kb int  `json:"max_size_kb, omitempty"`
	Max_objects int  `json:"max_objects, omitempty"`
}

type BucketStatistic

type BucketStatistic struct {
	Bucket       string      `json:"bucket, omitempty"`
	Pool         string      `json:"pool, omitempty"`
	Index_pool   string      `json:"index_pool, omitempty"`
	Id           string      `json:"id, omitempty"`
	Marker       string      `json:"marker, omitempty"`
	Owner        string      `json:"owner, omitempty"`
	Ver          string      `json:"ver, omitempty"`
	Master_ver   string      `json:"master_ver, omitempty"`
	Mtime        string      `json:"mtime, omitempty"`
	Max_marker   string      `json:"max_marker, omitempty"`
	Usage        BucketUsage `json:"usage, omitempty"`
	Bucket_quota BucketQuota `json:"bucket_quota, omitempty"`
}

type BucketStatisticUsage

type BucketStatisticUsage struct {
	Entries []struct {
		Owner   string `json:"owner, omitempty"`
		Buckets []struct {
			Bucket     string `json:"bucket, omitempty"`
			Time       string `json:"time,omitempty"`
			Epoch      int    `json:"epoch, omitempty"`
			Categories []struct {
				Category       string `json:"category, omitempty"`
				Bytes_sent     int    `json:"bytes_sent, omitempty"`
				Bytes_received int    `json:"bytes_received, omitempty"`
				Ops            int    `json:"ops, omitempty"`
				Successful_ops int    `json:"successful_ops,omitempty"`
			} `json:"categories, omitempty"`
		} `json:"buckets, omitempty"`
	} `json:"entries, omitempty"`
}

type BucketUsage

type BucketUsage struct {
	Rgw_main struct {
		Size_kb        int `json:"size_kb, omitempty"`
		Size_kb_actual int `json:"size_kb_actual, omitempty"`
		Num_objects    int `json:"num_objects, omitempty"`
	} `json:"rgw.main, omitempty"`

	Rgw_multimeta struct {
		Size_kb        int `json:"size_kb, omitempty"`
		Size_kb_actual int `json:"size_kb_actual, omitempty"`
		Num_objects    int `json:"num_objects, omitempty"`
	} `json:"rgw.multimeta, omitempty"`
}

type BucketUsage1

type BucketUsage1 struct {
	Bucket string `json:"bucket"`
	Usage  struct {
		RgwMain struct {
			SizeKb       int64 `json:"size_kb"`
			SizeKbActual int64 `json:"size_kb_actual"`
			NumObject    int64 `json:"num_objects"`
		} `json:"rgw.main"`
	} `json:"usage"`
}

type Buckets

type Buckets struct {
	Bucket []Bucket
}

type Caps

type Caps struct {
	Type string
	Perm string
}

type Key

type Key struct {
	User       string
	Access_key string
	Secret_key string
}

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	Owner   Owner   `xml:"Owner"`
	Buckets Buckets `xml:"Buckets"`
	// contains filtered or unexported fields
}

type Owner

type Owner struct {
	ID          string `xml:"ID"`
	DisplayName string `xml:"DisplayName"`
}

type Quota

type Quota struct {
	Enabled     bool `xml:"enabled"`
	Max_size_kb int  `xml:"max_size_kb"`
	Max_objects int  `xml:"max_objects"`
}

type RgwClient

type RgwClient struct {
	Auth     sign.Auth
	Endpoint string
}

func (*RgwClient) Abort

func (rgw_client *RgwClient) Abort(rgwUid, bucketName, objkey, uploadid string)

func (*RgwClient) ActivityUser

func (rgwClient *RgwClient) ActivityUser(uid, suspended string) (*UserInfo, error)

func (*RgwClient) AddUserCaps

func (rgwClient *RgwClient) AddUserCaps(uid, caps string) ([]Caps, error)

func (*RgwClient) CompleteUpload

func (rgw_client *RgwClient) CompleteUpload(rgwUid, bucketName, objkey, uploadid string, parts []s3.Part)

func (*RgwClient) CreateBucket

func (rgwClient *RgwClient) CreateBucket(bucket, acl string) error

func (*RgwClient) CreateKey

func (rgwClient *RgwClient) CreateKey(uid string) ([]Key, error)

func (*RgwClient) CreateUser

func (rgwClient *RgwClient) CreateUser(uid, display_name, caps string, max_bucket int) (*UserInfo, error)

func (*RgwClient) GetBucket

func (rgwClient *RgwClient) GetBucket() ([]Bucket, error)

func (*RgwClient) GetBucketQuota

func (rgwClient *RgwClient) GetBucketQuota(uid string) (bucketQuota Quota, err error)

func (*RgwClient) GetBucketStatistic

func (rgwClient *RgwClient) GetBucketStatistic(bucket string) (*BucketStatistic, error)

获取bucket使用统计

func (*RgwClient) GetBucketStatisticUsage

func (rgwClient *RgwClient) GetBucketStatisticUsage(uid, start, end string) (*BucketStatisticUsage, error)

func (*RgwClient) GetHead

func (rgw_client *RgwClient) GetHead(rgwUid, bucketName, objKey string) map[string][]string

func (*RgwClient) GetObject

func (rgwClient *RgwClient) GetObject(bucket, object string) ([]byte, error)

func (*RgwClient) GetUserInfo

func (rgwClient *RgwClient) GetUserInfo(uid string) (*UserInfo, error)

func (*RgwClient) GetUserQuota

func (rgwClient *RgwClient) GetUserQuota(uid string) (userQuota Quota, err error)

func (*RgwClient) GetUserUsage

func (rgwClient *RgwClient) GetUserUsage(uid string) (userUage UserUsage, err error)

func (*RgwClient) InitMultiUpload

func (rgw_client *RgwClient) InitMultiUpload(rgwUid, bucketName, objkey string, metadata map[string][]string) string

func (*RgwClient) ListParts

func (rgw_client *RgwClient) ListParts(rgwUid, bucketName, objkey, uploadid string) []s3.Part

func (*RgwClient) ModifyUser

func (rgwClient *RgwClient) ModifyUser(uid, display_name, caps string, max_bucket int) (*UserInfo, error)

func (*RgwClient) PutObject

func (rgwClient *RgwClient) PutObject(bucket, object string, content *string, useMd5 bool) error

func (*RgwClient) RemoveBucket

func (rgwClient *RgwClient) RemoveBucket(bucket string) error

func (*RgwClient) RemoveKey

func (rgwClient *RgwClient) RemoveKey(uid, access_key string) error

func (*RgwClient) RemoveObject

func (rgwClient *RgwClient) RemoveObject(bucket, object string) error

func (*RgwClient) RemoveUser

func (rgwClient *RgwClient) RemoveUser(uid string, purge_data bool) error

func (*RgwClient) RemoveUserCaps

func (rgwClient *RgwClient) RemoveUserCaps(uid, caps string) ([]Caps, error)

func (*RgwClient) RevokeObjectPublicRead

func (rgwClient *RgwClient) RevokeObjectPublicRead(owner, bucket, object string) error

func (*RgwClient) SetBucketAcl

func (rgwClient *RgwClient) SetBucketAcl(bucket, acl string) error

func (*RgwClient) SetBucketQuota

func (rgwClient *RgwClient) SetBucketQuota(uid string, bucketQuota Quota) error

func (*RgwClient) SetObjectPublicRead

func (rgwClient *RgwClient) SetObjectPublicRead(owner, bucket, object string) error

func (*RgwClient) SetUserQuota

func (rgwClient *RgwClient) SetUserQuota(uid string, userQuota Quota) error

func (*RgwClient) UploadParts

func (rgw_client *RgwClient) UploadParts(rgwUid, bucketName, objkey, uploadid, path string)

type UserInfo

type UserInfo struct {
	User_id      string
	Display_name string
	Email        string
	Suspended    int
	Max_buckets  int
	Keys         []Key
	Caps         []Caps
}

type UserUsage

type UserUsage struct {
	SizeKb       int64 `xml:"size_kb"`
	SizeKbActual int64 `xml:"size_kb_actual"`
	NumObject    int64 `xml:"num_objects"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL