radosgw

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketInfo

type BucketInfo []BucketInfoElement

type BucketInfoElement

type BucketInfoElement struct {
	Bucket        string `json:"bucket"`
	NumShards     int64  `json:"num_shards"`
	Tenant        string `json:"tenant"`
	Zonegroup     string `json:"zonegroup"`
	PlacementRule string `json:"placement_rule"`
	ID            string `json:"id"`
	Marker        string `json:"marker"`
	Owner         string `json:"owner"`
	Ver           string `json:"ver"`
	MasterVer     string `json:"master_ver"`
	Mtime         string `json:"mtime"`
	MaxMarker     string `json:"max_marker"`
	Usage         Usage  `json:"usage"`
	BucketQuota   Quota  `json:"bucket_quota"`
}

type Capability

type Capability struct {
	Type string `json:"type"`
	Perm string `json:"perm"`
}

type CreateTopicResponse

type CreateTopicResponse struct {
	XMLName           xml.Name `xml:"CreateTopicResponse"`
	Text              string   `xml:",chardata"`
	Xmlns             string   `xml:"xmlns,attr"`
	CreateTopicResult struct {
		Text     string `xml:",chardata"`
		TopicArn string `xml:"TopicArn"`
	} `xml:"CreateTopicResult"`
	ResponseMetadata struct {
		Text      string `xml:",chardata"`
		RequestId string `xml:"RequestId"`
	} `xml:"ResponseMetadata"`
}

type GetTopicResponse

type GetTopicResponse struct {
	XMLName        xml.Name `xml:"GetTopicResponse"`
	Text           string   `xml:",chardata"`
	GetTopicResult struct {
		Text  string `xml:",chardata"`
		Topic struct {
			Text     string `xml:",chardata"`
			User     string `xml:"User"`
			Name     string `xml:"Name"`
			EndPoint struct {
				Text            string `xml:",chardata"`
				EndpointAddress string `xml:"EndpointAddress"`
				EndpointArgs    string `xml:"EndpointArgs"`
				EndpointTopic   string `xml:"EndpointTopic"`
				HasStoredSecret string `xml:"HasStoredSecret"`
				Persistent      string `xml:"Persistent"`
			} `xml:"EndPoint"`
			TopicArn   string `xml:"TopicArn"`
			OpaqueData string `xml:"OpaqueData"`
		} `xml:"Topic"`
	} `xml:"GetTopicResult"`
	ResponseMetadata struct {
		Text      string `xml:",chardata"`
		RequestId string `xml:"RequestId"`
	} `xml:"ResponseMetadata"`
}

type KeyClass

type KeyClass struct {
	User      string `json:"user"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
}

type ListTopicsResponse

type ListTopicsResponse struct {
	XMLName          xml.Name `xml:"ListTopicsResponse"`
	Text             string   `xml:",chardata"`
	Xmlns            string   `xml:"xmlns,attr"`
	ListTopicsResult struct {
		Text   string `xml:",chardata"`
		Topics struct {
			Text   string `xml:",chardata"`
			Member []struct {
				Text     string `xml:",chardata"`
				User     string `xml:"User"`
				Name     string `xml:"Name"`
				EndPoint struct {
					Text            string `xml:",chardata"`
					EndpointAddress string `xml:"EndpointAddress"`
					EndpointArgs    string `xml:"EndpointArgs"`
					EndpointTopic   string `xml:"EndpointTopic"`
				} `xml:"EndPoint"`
				TopicArn string `xml:"TopicArn"`
			} `xml:"member"`
		} `xml:"Topics"`
	} `xml:"ListTopicsResult"`
	ResponseMetadata struct {
		Text      string `xml:",chardata"`
		RequestId string `xml:"RequestId"`
	} `xml:"ResponseMetadata"`
}

type MetaDataFilter

type MetaDataFilter map[string]string

type NotificationConfiguration

type NotificationConfiguration struct {
	XMLName            xml.Name `xml:"NotificationConfiguration"`
	Text               string   `xml:",chardata"`
	Xmlns              string   `xml:"xmlns,attr"`
	TopicConfiguration []struct {
		Text   string   `xml:",chardata"`
		ID     string   `xml:"Id"`
		Topic  string   `xml:"Topic"`
		Event  []string `xml:"Event"`
		Filter struct {
			Text  string `xml:",chardata"`
			S3Key struct {
				Text       string `xml:",chardata"`
				FilterRule []struct {
					Text  string `xml:",chardata"`
					Name  string `xml:"Name"`
					Value string `xml:"Value"`
				} `xml:"FilterRule"`
			} `xml:"S3Key"`
			S3Metadata struct {
				Text       string `xml:",chardata"`
				FilterRule []struct {
					Text  string `xml:",chardata"`
					Name  string `xml:"Name"`
					Value string `xml:"Value"`
				} `xml:"FilterRule"`
			} `xml:"S3Metadata"`
			S3Tags struct {
				Text       string `xml:",chardata"`
				FilterRule []struct {
					Text  string `xml:",chardata"`
					Name  string `xml:"Name"`
					Value string `xml:"Value"`
				} `xml:"FilterRule"`
			} `xml:"S3Tags"`
		} `xml:"Filter"`
	} `xml:"TopicConfiguration"`
}

type Quota

type Quota struct {
	Enabled    bool  `json:"enabled"`
	CheckOnRaw bool  `json:"check_on_raw"`
	MaxSize    int64 `json:"max_size"`
	MaxSizeKB  int64 `json:"max_size_kb"`
	MaxObjects int64 `json:"max_objects"`
}

type Quotas

type Quotas struct {
	BucketQuota Quota `json:"bucket_quota"`
	UserQuota   Quota `json:"user_quota"`
}

type RGWClient

type RGWClient struct {
	// contains filtered or unexported fields
}

func NewRGWClient

func NewRGWClient(conf *aws.Config, httpClient *http.Client) *RGWClient

func (*RGWClient) AddCaps

func (rgw *RGWClient) AddCaps(uid, caps string) (*[]Capability, error)

func (*RGWClient) AppendObjV2

func (rgw *RGWClient) AppendObjV2(bucketName, objKey string, position uint64, body io.ReadSeeker) (*http.Response, error)

func (*RGWClient) AppendObjV4

func (rgw *RGWClient) AppendObjV4(bucketName, objKey string, position uint64, body io.ReadSeeker) (*http.Response, error)

func (*RGWClient) CreateKey

func (rgw *RGWClient) CreateKey(userConf *UserConf) (*[]KeyClass, error)

func (*RGWClient) CreateNotification

func (rgw *RGWClient) CreateNotification(topicArn, bucket, notificationId, prefix, suffix string, metaData MetaDataFilter, events []string) (*http.Response, error)

CreateNotification TODO Support tag and regular expression filtering

func (*RGWClient) CreateTopic

func (rgw *RGWClient) CreateTopic(topicName, pushEndpoint string) (string, error)

func (*RGWClient) CreateUser

func (rgw *RGWClient) CreateUser(userConf *UserConf) (*UserInfo, error)

func (*RGWClient) DeleteNotification

func (rgw *RGWClient) DeleteNotification(bucket, notificationId string) (*http.Response, error)

func (*RGWClient) DeleteTopic

func (rgw *RGWClient) DeleteTopic(topicArn string) (*http.Response, error)

func (*RGWClient) GetBucketInfo

func (rgw *RGWClient) GetBucketInfo(uid, bucketName string) (*BucketInfo, error)

GetBucketInfo aka GetBucketQuota/GetBucketStats

func (*RGWClient) GetNotification

func (rgw *RGWClient) GetNotification(bucket, notificationId string) (*NotificationConfiguration, error)

GetNotification TODO define a struct to hold response for easier use by the client

func (*RGWClient) GetTopic

func (rgw *RGWClient) GetTopic(topicArn string) (*GetTopicResponse, error)

func (*RGWClient) GetUserBucketQuota

func (rgw *RGWClient) GetUserBucketQuota(uid string) (*Quota, error)

func (*RGWClient) GetUserInfo

func (rgw *RGWClient) GetUserInfo(uid, stats string) (*UserInfo, error)

GetUserInfo stats should be "True" or "False"

func (*RGWClient) GetUserQuota

func (rgw *RGWClient) GetUserQuota(uid string) (*Quota, error)

func (*RGWClient) ListTopics

func (rgw *RGWClient) ListTopics() (*ListTopicsResponse, error)

func (*RGWClient) ModifyUser

func (rgw *RGWClient) ModifyUser(userConf *UserConf) (*UserInfo, error)

func (*RGWClient) PutBucketQuota

func (rgw *RGWClient) PutBucketQuota(uid, bucketName string, body io.ReadSeeker) (*http.Response, error)

func (*RGWClient) PutUserBucketQuota

func (rgw *RGWClient) PutUserBucketQuota(uid string, body io.ReadSeeker) (*http.Response, error)

func (*RGWClient) PutUserQuota

func (rgw *RGWClient) PutUserQuota(uid string, body io.ReadSeeker) (*http.Response, error)

func (*RGWClient) RemoveCaps

func (rgw *RGWClient) RemoveCaps(uid, caps string) (*[]Capability, error)

func (*RGWClient) RemoveKey

func (rgw *RGWClient) RemoveKey(userConf *UserConf) (*http.Response, error)

func (*RGWClient) RemoveUser

func (rgw *RGWClient) RemoveUser(uid string) (*http.Response, error)

type RGWMain

type RGWMain struct {
	Size           int64 `json:"size"`
	SizeActual     int64 `json:"size_actual"`
	SizeUtilized   int64 `json:"size_utilized"`
	SizeKB         int64 `json:"size_kb"`
	SizeKBActual   int64 `json:"size_kb_actual"`
	SizeKBUtilized int64 `json:"size_kb_utilized"`
	NumObjects     int64 `json:"num_objects"`
}

type Stats

type Stats struct {
	Size           int64 `json:"size"`
	SizeActual     int64 `json:"size_actual"`
	SizeUtilized   int64 `json:"size_utilized"`
	SizeKB         int64 `json:"size_kb"`
	SizeKBActual   int64 `json:"size_kb_actual"`
	SizeKBUtilized int64 `json:"size_kb_utilized"`
	NumObjects     int64 `json:"num_objects"`
}

type Subuser

type Subuser struct {
	ID          string `json:"id"`
	Permissions string `json:"permissions"`
}

type TagFilter

type TagFilter map[string]string

type Usage

type Usage struct {
	RGWMain RGWMain `json:"rgw.main"`
}

type UserConf

type UserConf struct {
	Uid         string `url:"uid,omitempty"`
	DisplayName string `url:"display-name,omitempty"`
	Email       string `url:"email,omitempty"`
	KeyType     string `url:"key-type,omitempty"`
	AccessKey   string `url:"access-key,omitempty"`
	SecretKey   string `url:"secret-key,omitempty"`
	UserCaps    string `url:"user-caps,omitempty"`
	GenerateKey bool   `url:"generate-key,omitempty"`
	Suspended   int64  `url:"suspended,omitempty"`
	MaxBuckets  int64  `url:"max-buckets,omitempty"`
	Tenant      string `url:"tenant,omitempty"`
	System      bool   `url:"system,omitempty"`
	OpMask      string `url:"op-mask,omitempty"`
}

type UserInfo

type UserInfo struct {
	Tenant      string       `json:"tenant"`
	UserID      string       `json:"user_id"`
	DisplayName string       `json:"display_name"`
	Email       string       `json:"email"`
	Suspended   int64        `json:"suspended"`
	MaxBuckets  int64        `json:"max_buckets"`
	Subusers    []Subuser    `json:"subusers"`
	Keys        []KeyClass   `json:"keys"`
	SwiftKeys   []KeyClass   `json:"swift_keys"`
	Caps        []Capability `json:"caps"`
	OpMask      string       `json:"op_mask"`
	System      string       `json:"system"`
	Admin       string       `json:"admin"`
	BucketQuota Quota        `json:"bucket_quota"`
	UserQuota   Quota        `json:"user_quota"`
	TempURLKeys []string     `json:"temp_url_keys"`
	Type        string       `json:"type"`
	MfaIDS      []string     `json:"mfa_ids"`
	Stats       Stats        `json:"stats"`
}

Jump to

Keyboard shortcuts

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