multicloud

package
v0.0.0-...-295c363 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTenantId      = "adminTenantId"
	DefaultTimeout       = 60 // in Seconds
	DefaultUploadTimeout = 30 // in Seconds
	ApiVersion           = "v1"
)
View Source
const (
	ConfFile  = "/etc/opensds/driver/multi-cloud.yaml"
	ChunkSize = 1024 * 1024 * 50
)

Variables

This section is empty.

Functions

func NewMultiCloud

func NewMultiCloud() (backup.BackupDriver, error)

Types

type AuthOptions

type AuthOptions struct {
	Strategy        string `yaml:"Strategy"`
	AuthUrl         string `yaml:"AuthUrl,omitempty"`
	DomainName      string `yaml:"DomainName,omitempty"`
	UserName        string `yaml:"UserName,omitempty"`
	Password        string `yaml:"Password,omitempty"`
	PwdEncrypter    string `yaml:"PwdEncrypter,omitempty"`
	EnableEncrypted bool   `yaml:"EnableEncrypted,omitempty"`
	TenantName      string `yaml:"TenantName,omitempty"`
}

type Client

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

func NewClient

func NewClient(endpooint string, opt *AuthOptions, uploadTimeout int64) (*Client, error)

func (*Client) AbortMultipartUpload

func (c *Client) AbortMultipartUpload(bucketName, objectKey string) error

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(
	bucketName string,
	objectKey string,
	uploadId string,
	input *CompleteMultipartUpload) (*CompleteMultipartUploadResult, error)

func (*Client) DownloadPart

func (c *Client) DownloadPart(bucketName, objectKey string, offset, size int64) ([]byte, error)

func (*Client) InitMultiPartUpload

func (c *Client) InitMultiPartUpload(bucketName, objectKey string) (*InitiateMultipartUploadResult, error)

func (*Client) ListObject

func (c *Client) ListObject(bucketName string) (*ListObjectResponse, error)

func (*Client) RemoveObject

func (c *Client) RemoveObject(bucketName, objectKey string) error

func (*Client) UpdateToken

func (c *Client) UpdateToken() error

func (*Client) UploadObject

func (c *Client) UploadObject(bucketName, objectKey string, data []byte) error

func (*Client) UploadPart

func (c *Client) UploadPart(bucketName, objectKey string, partNum int64, uploadId string, data []byte, size int64) (*UploadPartResult, error)

type CompleteMultipartUpload

type CompleteMultipartUpload struct {
	Xmlns string `xml:"xmlns,attr"`
	Part  []Part `xml:"Part"`
}

type CompleteMultipartUploadResult

type CompleteMultipartUploadResult struct {
	Xmlns    string `xml:"xmlns,attr"`
	Location string `xml:"Location"`
	Bucket   string `xml:"Bucket"`
	Key      string `xml:"Key"`
	ETag     string `xml:"ETag"`
}

type InitiateMultipartUploadResult

type InitiateMultipartUploadResult struct {
	Xmlns    string `xml:"xmlns,attr"`
	Bucket   string `xml:"Bucket"`
	Key      string `xml:"Key"`
	UploadId string `xml:"UploadId"`
}

type ListObjectResponse

type ListObjectResponse struct {
	ListObjects []Object `xml:"ListObjects"`
}

type MultiCloud

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

func (*MultiCloud) Backup

func (m *MultiCloud) Backup(backup *backup.BackupSpec, volFile *os.File) error

func (*MultiCloud) CleanUp

func (m *MultiCloud) CleanUp() error

func (*MultiCloud) Delete

func (m *MultiCloud) Delete(backup *backup.BackupSpec) error

func (*MultiCloud) Restore

func (m *MultiCloud) Restore(backup *backup.BackupSpec, backupId string, volFile *os.File) error

func (*MultiCloud) SetUp

func (m *MultiCloud) SetUp() error

type MultiCloudConf

type MultiCloudConf struct {
	Endpoint      string `yaml:"Endpoint,omitempty"`
	UploadTimeout int64  `yaml:"UploadTimeout,omitempty"`
	AuthOptions   `yaml:"AuthOptions,omitempty"`
}

type Object

type Object struct {
	ObjectKey  string `xml:"ObjectKey"`
	BucketName string `xml:"BucketName"`
	Size       uint64 `xml:"Size"`
}

type Part

type Part struct {
	PartNumber int64  `xml:"PartNumber"`
	ETag       string `xml:"ETag"`
}

type ReqSettingCB

type ReqSettingCB func(req *httplib.BeegoHTTPRequest) error

type UploadPartResult

type UploadPartResult struct {
	Xmlns      string `xml:"xmlns,attr"`
	PartNumber int64  `xml:"PartNumber"`
	ETag       string `xml:"ETag"`
}

Jump to

Keyboard shortcuts

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