objectstore

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	META_HEADER = "X-Amz-Meta-"
)

Variables

This section is empty.

Functions

func S3Shell

func S3Shell()

Types

type IBucketProvider

type IBucketProvider interface {
	cloudprovider.ICloudRegion

	NewBucket(bucket s3cli.BucketInfo) cloudprovider.ICloudBucket

	GetEndpoint() string

	S3Client() *s3cli.Client

	About() jsonutils.JSONObject
	GetVersion() string
	GetAccountId() string
	GetSubAccounts() ([]cloudprovider.SSubAccount, error)

	GetObjectAcl(bucket, key string) (cloudprovider.TBucketACLType, error)
	SetObjectAcl(bucket, key string, cannedAcl cloudprovider.TBucketACLType) error
	GetIBucketAcl(name string) (cloudprovider.TBucketACLType, error)
	SetIBucketAcl(name string, cannedAcl cloudprovider.TBucketACLType) error
}

type ObjectHeaderOptions

type ObjectHeaderOptions struct {
	CacheControl       string `help:"Cache-Control"`
	ContentType        string `help:"Content-Type"`
	ContentEncoding    string `help:"Content-Encoding"`
	ContentLanguage    string `help:"Content-Language"`
	ContentDisposition string `help:"Content-Disposition"`
	ContentMD5         string `help:"Content-MD5"`

	Meta []string `help:"header, common seperatored key and value, e.g. max-age:100"`
}

func (ObjectHeaderOptions) Options2Header

func (args ObjectHeaderOptions) Options2Header() http.Header

type ObjectStoreClientConfig

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

func NewObjectStoreClientConfig

func NewObjectStoreClientConfig(endpoint, accessKey, accessSecret string) *ObjectStoreClientConfig

func (*ObjectStoreClientConfig) CloudproviderConfig

func (*ObjectStoreClientConfig) Debug

func (*ObjectStoreClientConfig) GetAccessKey

func (cfg *ObjectStoreClientConfig) GetAccessKey() string

func (*ObjectStoreClientConfig) GetAccessSecret

func (cfg *ObjectStoreClientConfig) GetAccessSecret() string

func (*ObjectStoreClientConfig) GetCloudproviderConfig

func (cfg *ObjectStoreClientConfig) GetCloudproviderConfig() cloudprovider.ProviderConfig

func (*ObjectStoreClientConfig) GetDebug

func (cfg *ObjectStoreClientConfig) GetDebug() bool

func (*ObjectStoreClientConfig) GetEndpoint

func (cfg *ObjectStoreClientConfig) GetEndpoint() string

type SBucket

type SBucket struct {
	multicloud.SBaseBucket
	multicloud.STagBase

	Name         string
	Location     string
	CreatedAt    time.Time
	StorageClass string
	// contains filtered or unexported fields
}

func (*SBucket) AbortMultipartUpload

func (bucket *SBucket) AbortMultipartUpload(ctx context.Context, key string, uploadId string) error

func (*SBucket) CompleteMultipartUpload

func (bucket *SBucket) CompleteMultipartUpload(ctx context.Context, key string, uploadId string, partEtags []string) error

func (*SBucket) CopyObject

func (bucket *SBucket) CopyObject(ctx context.Context, destKey string, srcBucket, srcKey string, cannedAcl cloudprovider.TBucketACLType, storageClassStr string, dstMeta http.Header) error

func (*SBucket) CopyPart

func (bucket *SBucket) CopyPart(ctx context.Context, key string, uploadId string, partNumber int, srcBucket string, srcKey string, srcOffset int64, srcLength int64) (string, error)

func (*SBucket) DeleteObject

func (bucket *SBucket) DeleteObject(ctx context.Context, key string) error

func (*SBucket) GetAccessUrls

func (bucket *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl

func (*SBucket) GetAcl

func (bucket *SBucket) GetAcl() cloudprovider.TBucketACLType

func (*SBucket) GetCreatedAt

func (bucket *SBucket) GetCreatedAt() time.Time

func (*SBucket) GetGlobalId

func (bucket *SBucket) GetGlobalId() string

func (*SBucket) GetIBucketProvider

func (bucket *SBucket) GetIBucketProvider() IBucketProvider

func (*SBucket) GetIObjects

func (bucket *SBucket) GetIObjects(prefix string, isRecursive bool) ([]cloudprovider.ICloudObject, error)

func (*SBucket) GetIRegion

func (bucket *SBucket) GetIRegion() cloudprovider.ICloudRegion

func (*SBucket) GetId

func (bucket *SBucket) GetId() string

func (*SBucket) GetLocation

func (bucket *SBucket) GetLocation() string

func (*SBucket) GetName

func (bucket *SBucket) GetName() string

func (*SBucket) GetObject

func (bucket *SBucket) GetObject(ctx context.Context, key string, rangeOpt *cloudprovider.SGetObjectRange) (io.ReadCloser, error)

func (*SBucket) GetProjectId

func (bucket *SBucket) GetProjectId() string

func (*SBucket) GetStats

func (bucket *SBucket) GetStats() cloudprovider.SBucketStats

func (*SBucket) GetStatus

func (bucket *SBucket) GetStatus() string

func (*SBucket) GetStorageClass

func (bucket *SBucket) GetStorageClass() string

func (*SBucket) GetTempUrl

func (bucket *SBucket) GetTempUrl(method string, key string, expire time.Duration) (string, error)

func (*SBucket) IsEmulated

func (bucket *SBucket) IsEmulated() bool

func (*SBucket) ListObjects

func (bucket *SBucket) ListObjects(prefix string, marker string, delimiter string, maxCount int) (cloudprovider.SListObjectResult, error)

func (*SBucket) NewMultipartUpload

func (bucket *SBucket) NewMultipartUpload(ctx context.Context, key string, cannedAcl cloudprovider.TBucketACLType, storageClassStr string, meta http.Header) (string, error)

func (*SBucket) PutObject

func (bucket *SBucket) PutObject(ctx context.Context, key string, input io.Reader, sizeBytes int64, cannedAcl cloudprovider.TBucketACLType, storageClassStr string, meta http.Header) error

func (*SBucket) Refresh

func (bucket *SBucket) Refresh() error

func (*SBucket) SetAcl

func (bucket *SBucket) SetAcl(aclStr cloudprovider.TBucketACLType) error

func (*SBucket) UploadPart

func (bucket *SBucket) UploadPart(ctx context.Context, key string, uploadId string, partIndex int, input io.Reader, partSize int64, offset, totalSize int64) (string, error)

type SObject

type SObject struct {
	cloudprovider.SBaseCloudObject
	// contains filtered or unexported fields
}

func (*SObject) GetAcl

func (o *SObject) GetAcl() cloudprovider.TBucketACLType

func (*SObject) GetIBucket

func (o *SObject) GetIBucket() cloudprovider.ICloudBucket

func (*SObject) GetMeta

func (o *SObject) GetMeta() http.Header

func (*SObject) SetAcl

func (o *SObject) SetAcl(aclStr cloudprovider.TBucketACLType) error

func (*SObject) SetMeta

func (o *SObject) SetMeta(ctx context.Context, meta http.Header) error

type SObjectStoreClient

type SObjectStoreClient struct {
	object.SObject

	*ObjectStoreClientConfig

	cloudprovider.SFakeOnPremiseRegion
	multicloud.SRegion
	// contains filtered or unexported fields
}

func NewObjectStoreClient

func NewObjectStoreClient(cfg *ObjectStoreClientConfig) (*SObjectStoreClient, error)

func NewObjectStoreClientAndFetch

func NewObjectStoreClientAndFetch(cfg *ObjectStoreClientConfig, doFetch bool) (*SObjectStoreClient, error)

func (*SObjectStoreClient) About

func (*SObjectStoreClient) ApplySnapshotPolicyToDisks

func (cli *SObjectStoreClient) ApplySnapshotPolicyToDisks(snapshotPolicyId string, diskId string) error

func (*SObjectStoreClient) CancelSnapshotPolicyToDisks

func (cli *SObjectStoreClient) CancelSnapshotPolicyToDisks(snapshotPolicyId string, diskId string) error

func (*SObjectStoreClient) CreateEIP

func (*SObjectStoreClient) CreateIBucket

func (cli *SObjectStoreClient) CreateIBucket(name string, storageClass string, acl string) error

func (*SObjectStoreClient) CreateILoadBalancer

func (*SObjectStoreClient) CreateISku

func (*SObjectStoreClient) CreateIVpc

func (*SObjectStoreClient) CreateSnapshotPolicy

func (cli *SObjectStoreClient) CreateSnapshotPolicy(*cloudprovider.SnapshotPolicyInput) (string, error)

func (*SObjectStoreClient) DeleteIBucket

func (cli *SObjectStoreClient) DeleteIBucket(name string) error

func (*SObjectStoreClient) FetchBuckets

func (cli *SObjectStoreClient) FetchBuckets() error

func (*SObjectStoreClient) GetAccountId

func (cli *SObjectStoreClient) GetAccountId() string

func (*SObjectStoreClient) GetCapabilities

func (self *SObjectStoreClient) GetCapabilities() []string

func (*SObjectStoreClient) GetClientRC

func (cli *SObjectStoreClient) GetClientRC() map[string]string

func (*SObjectStoreClient) GetCloudEnv

func (cli *SObjectStoreClient) GetCloudEnv() string

func (*SObjectStoreClient) GetEndpoint

func (cli *SObjectStoreClient) GetEndpoint() string

func (*SObjectStoreClient) GetI18n

func (*SObjectStoreClient) GetIBucketAcl

func (cli *SObjectStoreClient) GetIBucketAcl(name string) (cloudprovider.TBucketACLType, error)

func (*SObjectStoreClient) GetIBucketById

func (cli *SObjectStoreClient) GetIBucketById(name string) (cloudprovider.ICloudBucket, error)

func (*SObjectStoreClient) GetIBucketByName

func (cli *SObjectStoreClient) GetIBucketByName(name string) (cloudprovider.ICloudBucket, error)

func (*SObjectStoreClient) GetIBucketCors

func (cli *SObjectStoreClient) GetIBucketCors(name string) (string, error)

func (*SObjectStoreClient) GetIBucketInfo

func (cli *SObjectStoreClient) GetIBucketInfo(name string) (string, error)

func (*SObjectStoreClient) GetIBucketLiftcycle

func (cli *SObjectStoreClient) GetIBucketLiftcycle(name string) (string, error)

func (*SObjectStoreClient) GetIBucketLocation

func (cli *SObjectStoreClient) GetIBucketLocation(name string) (string, error)

func (*SObjectStoreClient) GetIBucketLogging

func (cli *SObjectStoreClient) GetIBucketLogging(name string) (*s3cli.BucketLoggingStatus, error)

func (*SObjectStoreClient) GetIBucketPolicy

func (cli *SObjectStoreClient) GetIBucketPolicy(name string) (string, error)

func (*SObjectStoreClient) GetIBucketProvider

func (cli *SObjectStoreClient) GetIBucketProvider() IBucketProvider

func (*SObjectStoreClient) GetIBucketReferer

func (cli *SObjectStoreClient) GetIBucketReferer(name string) (string, error)

func (*SObjectStoreClient) GetIBucketWebsite

func (cli *SObjectStoreClient) GetIBucketWebsite(name string) (string, error)

func (*SObjectStoreClient) GetIBuckets

func (cli *SObjectStoreClient) GetIBuckets() ([]cloudprovider.ICloudBucket, error)

func (*SObjectStoreClient) GetIDiskById

func (cli *SObjectStoreClient) GetIDiskById(id string) (cloudprovider.ICloudDisk, error)

func (*SObjectStoreClient) GetIEipById

func (cli *SObjectStoreClient) GetIEipById(id string) (cloudprovider.ICloudEIP, error)

func (*SObjectStoreClient) GetIEips

func (cli *SObjectStoreClient) GetIEips() ([]cloudprovider.ICloudEIP, error)

func (*SObjectStoreClient) GetIHostById

func (cli *SObjectStoreClient) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SObjectStoreClient) GetIHosts

func (cli *SObjectStoreClient) GetIHosts() ([]cloudprovider.ICloudHost, error)

func (*SObjectStoreClient) GetILoadBalancerAclById

func (cli *SObjectStoreClient) GetILoadBalancerAclById(aclId string) (cloudprovider.ICloudLoadbalancerAcl, error)

func (*SObjectStoreClient) GetILoadBalancerAcls

func (cli *SObjectStoreClient) GetILoadBalancerAcls() ([]cloudprovider.ICloudLoadbalancerAcl, error)

func (*SObjectStoreClient) GetILoadBalancerById

func (cli *SObjectStoreClient) GetILoadBalancerById(loadbalancerId string) (cloudprovider.ICloudLoadbalancer, error)

func (*SObjectStoreClient) GetILoadBalancerCertificateById

func (cli *SObjectStoreClient) GetILoadBalancerCertificateById(certId string) (cloudprovider.ICloudLoadbalancerCertificate, error)

func (*SObjectStoreClient) GetILoadBalancerCertificates

func (cli *SObjectStoreClient) GetILoadBalancerCertificates() ([]cloudprovider.ICloudLoadbalancerCertificate, error)

func (*SObjectStoreClient) GetILoadBalancers

func (cli *SObjectStoreClient) GetILoadBalancers() ([]cloudprovider.ICloudLoadbalancer, error)

func (*SObjectStoreClient) GetIRegion

func (cli *SObjectStoreClient) GetIRegion() cloudprovider.ICloudRegion

func (*SObjectStoreClient) GetISkus

func (cli *SObjectStoreClient) GetISkus() ([]cloudprovider.ICloudSku, error)

func (*SObjectStoreClient) GetISnapshotById

func (cli *SObjectStoreClient) GetISnapshotById(snapshotId string) (cloudprovider.ICloudSnapshot, error)

func (*SObjectStoreClient) GetISnapshotPolicies

func (cli *SObjectStoreClient) GetISnapshotPolicies() ([]cloudprovider.ICloudSnapshotPolicy, error)

func (*SObjectStoreClient) GetISnapshotPolicyById

func (cli *SObjectStoreClient) GetISnapshotPolicyById(snapshotPolicyId string) (cloudprovider.ICloudSnapshotPolicy, error)

func (*SObjectStoreClient) GetISnapshots

func (cli *SObjectStoreClient) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SObjectStoreClient) GetIStorageById

func (cli *SObjectStoreClient) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SObjectStoreClient) GetIStoragecacheById

func (cli *SObjectStoreClient) GetIStoragecacheById(id string) (cloudprovider.ICloudStoragecache, error)

func (*SObjectStoreClient) GetIStoragecaches

func (cli *SObjectStoreClient) GetIStoragecaches() ([]cloudprovider.ICloudStoragecache, error)

func (*SObjectStoreClient) GetIStorages

func (cli *SObjectStoreClient) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SObjectStoreClient) GetIVMById

func (cli *SObjectStoreClient) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SObjectStoreClient) GetIVpcById

func (cli *SObjectStoreClient) GetIVpcById(id string) (cloudprovider.ICloudVpc, error)

func (*SObjectStoreClient) GetIVpcs

func (cli *SObjectStoreClient) GetIVpcs() ([]cloudprovider.ICloudVpc, error)

func (*SObjectStoreClient) GetIZoneById

func (cli *SObjectStoreClient) GetIZoneById(id string) (cloudprovider.ICloudZone, error)

func (*SObjectStoreClient) GetIZones

func (cli *SObjectStoreClient) GetIZones() ([]cloudprovider.ICloudZone, error)

func (*SObjectStoreClient) GetObjectAcl

func (cli *SObjectStoreClient) GetObjectAcl(bucket, key string) (cloudprovider.TBucketACLType, error)

func (*SObjectStoreClient) GetProvider

func (cli *SObjectStoreClient) GetProvider() string

func (*SObjectStoreClient) GetSubAccounts

func (cli *SObjectStoreClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error)

func (*SObjectStoreClient) GetVersion

func (cli *SObjectStoreClient) GetVersion() string

func (*SObjectStoreClient) IBucketExist

func (cli *SObjectStoreClient) IBucketExist(name string) (bool, error)

func (*SObjectStoreClient) NewBucket

func (*SObjectStoreClient) S3Client

func (cli *SObjectStoreClient) S3Client() *s3cli.Client

func (*SObjectStoreClient) SetIBucketAcl

func (cli *SObjectStoreClient) SetIBucketAcl(name string, cannedAcl cloudprovider.TBucketACLType) error

func (*SObjectStoreClient) SetIBucketLogging

func (cli *SObjectStoreClient) SetIBucketLogging(name string, target string, targetPrefix string, email string) error

func (*SObjectStoreClient) SetIBucketPolicy

func (cli *SObjectStoreClient) SetIBucketPolicy(name string, policy string) error

func (*SObjectStoreClient) SetObjectAcl

func (cli *SObjectStoreClient) SetObjectAcl(bucket, key string, cannedAcl cloudprovider.TBucketACLType) error

func (*SObjectStoreClient) SyncSecurityGroup

func (cli *SObjectStoreClient) SyncSecurityGroup(secgroupId string, vpcId string, name string, desc string, rules []secrules.SecurityRule) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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