Documentation ¶
Overview ¶
Copyright 2019 The OpenSDS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The OpenSDS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The OpenSDS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The OpenSDS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The OpenSDS Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func VersionStr2UInt64(vers string) uint64
- type TidbClient
- func (t *TidbClient) AbortTrans(tx interface{}) (err error)
- func (t *TidbClient) CheckAndPutBucket(ctx context.Context, bucket *Bucket) (bool, error)
- func (t *TidbClient) CommitTrans(tx interface{}) (err error)
- func (t *TidbClient) CountObjects(ctx context.Context, bucketName, prefix string) (*utils.ObjsCountInfo, error)
- func (t *TidbClient) CreateBucketSSE(ctx context.Context, bucketName string, sseType string, sseKey []byte, ...) error
- func (t *TidbClient) CreateMultipart(multipart Multipart) (err error)
- func (t *TidbClient) DeleteBucket(ctx context.Context, bucket *Bucket) (err error)
- func (t *TidbClient) DeleteGcobjRecord(ctx context.Context, o *Object, tx interface{}) (err error)
- func (t *TidbClient) DeleteMultipart(multipart *Multipart, tx interface{}) (err error)
- func (t *TidbClient) DeleteObject(ctx context.Context, object *Object, tx interface{}) (err error)
- func (t *TidbClient) DeleteObjectMap(objMap *ObjMap, tx interface{}) (err error)
- func (t *TidbClient) GetBucket(ctx context.Context, bucketName string) (bucket *Bucket, err error)
- func (t *TidbClient) GetBucketSSE(ctx context.Context, bucketName string) (sseOptsPtr *pb.ServerSideEncryption, err error)
- func (t *TidbClient) GetBuckets(ctx context.Context, query interface{}) (buckets []*Bucket, err error)
- func (t *TidbClient) GetMultipart(bucketName, objectName, uploadId string) (multipart Multipart, err error)
- func (t *TidbClient) GetObject(ctx context.Context, bucketName, objectName, version string) (object *Object, err error)
- func (t *TidbClient) GetObjectMap(bucketName, objectName string) (objMap *ObjMap, err error)
- func (t *TidbClient) ListBucketLifecycle(ctx context.Context) (buckets []*Bucket, err error)
- func (t *TidbClient) ListGcObjs(ctx context.Context, offset, limit int) (objs []*Object, err error)
- func (t *TidbClient) ListMultipartUploads(input *pb.ListBucketUploadRequest) (output *pb.ListBucketUploadResult, err error)
- func (t *TidbClient) ListObjects(ctx context.Context, bucketName string, versioned bool, maxKeys int, ...) (retObjects []*Object, appendInfo utils.ListObjsAppendInfo, err error)
- func (t *TidbClient) NewTrans() (tx interface{}, err error)
- func (t *TidbClient) PutBucket(ctx context.Context, bucket *Bucket) error
- func (t *TidbClient) PutGcobjRecord(ctx context.Context, o *Object, tx interface{}) (err error)
- func (t *TidbClient) PutObject(ctx context.Context, object *Object, tx interface{}) (err error)
- func (t *TidbClient) PutObjectMap(objMap *ObjMap, tx interface{}) (err error)
- func (t *TidbClient) PutObjectPart(multipart *Multipart, part *Part, tx interface{}) (err error)
- func (t *TidbClient) SetObjectDeleteMarker(ctx context.Context, object *Object, deleteMarker bool) error
- func (t *TidbClient) UpdateBucketSSE(ctx context.Context, bucketName string, sseType string, sseKey []byte, ...) error
- func (t *TidbClient) UpdateObject4Lifecycle(ctx context.Context, old, new *Object, tx interface{}) (err error)
- func (t *TidbClient) UpdateObjectMeta(object *Object) error
- func (t *TidbClient) UpdateUsage(ctx context.Context, bucketName string, size int64, tx interface{}) (err error)
- func (t *TidbClient) UpdateUsages(ctx context.Context, usages map[string]int64, tx interface{}) error
Constants ¶
const MAX_OPEN_CONNS = 1024
const TimeDur = 5000 // milisecond
Variables ¶
This section is empty.
Functions ¶
func VersionStr2UInt64 ¶
Types ¶
type TidbClient ¶
func NewTidbClient ¶
func NewTidbClient(dbInfo string) *TidbClient
func (*TidbClient) AbortTrans ¶
func (t *TidbClient) AbortTrans(tx interface{}) (err error)
func (*TidbClient) CheckAndPutBucket ¶
func (t *TidbClient) CheckAndPutBucket(ctx context.Context, bucket *Bucket) (bool, error)
func (*TidbClient) CommitTrans ¶
func (t *TidbClient) CommitTrans(tx interface{}) (err error)
func (*TidbClient) CountObjects ¶
func (t *TidbClient) CountObjects(ctx context.Context, bucketName, prefix string) (*utils.ObjsCountInfo, error)
func (*TidbClient) CreateBucketSSE ¶
func (*TidbClient) CreateMultipart ¶
func (t *TidbClient) CreateMultipart(multipart Multipart) (err error)
func (*TidbClient) DeleteBucket ¶
func (t *TidbClient) DeleteBucket(ctx context.Context, bucket *Bucket) (err error)
func (*TidbClient) DeleteGcobjRecord ¶
func (t *TidbClient) DeleteGcobjRecord(ctx context.Context, o *Object, tx interface{}) (err error)
func (*TidbClient) DeleteMultipart ¶
func (t *TidbClient) DeleteMultipart(multipart *Multipart, tx interface{}) (err error)
func (*TidbClient) DeleteObject ¶
func (t *TidbClient) DeleteObject(ctx context.Context, object *Object, tx interface{}) (err error)
func (*TidbClient) DeleteObjectMap ¶
func (t *TidbClient) DeleteObjectMap(objMap *ObjMap, tx interface{}) (err error)
func (*TidbClient) GetBucket ¶
func (t *TidbClient) GetBucket(ctx context.Context, bucketName string) (bucket *Bucket, err error)
func (*TidbClient) GetBucketSSE ¶
func (t *TidbClient) GetBucketSSE(ctx context.Context, bucketName string) (sseOptsPtr *pb.ServerSideEncryption, err error)
func (*TidbClient) GetBuckets ¶
func (t *TidbClient) GetBuckets(ctx context.Context, query interface{}) (buckets []*Bucket, err error)
For the request that list buckets, better to filter according to tenant.
func (*TidbClient) GetMultipart ¶
func (t *TidbClient) GetMultipart(bucketName, objectName, uploadId string) (multipart Multipart, err error)
func (*TidbClient) GetObject ¶
func (t *TidbClient) GetObject(ctx context.Context, bucketName, objectName, version string) (object *Object, err error)
func (*TidbClient) GetObjectMap ¶
func (t *TidbClient) GetObjectMap(bucketName, objectName string) (objMap *ObjMap, err error)
objmap
func (*TidbClient) ListBucketLifecycle ¶
func (t *TidbClient) ListBucketLifecycle(ctx context.Context) (buckets []*Bucket, err error)
func (*TidbClient) ListGcObjs ¶
func (t *TidbClient) ListGcObjs(ctx context.Context, offset, limit int) (objs []*Object, err error)
func (*TidbClient) ListMultipartUploads ¶
func (t *TidbClient) ListMultipartUploads(input *pb.ListBucketUploadRequest) (output *pb.ListBucketUploadResult, err error)
func (*TidbClient) ListObjects ¶
func (*TidbClient) NewTrans ¶
func (t *TidbClient) NewTrans() (tx interface{}, err error)
func (*TidbClient) PutBucket ¶
func (t *TidbClient) PutBucket(ctx context.Context, bucket *Bucket) error
Actually this method is used to update bucket
func (*TidbClient) PutGcobjRecord ¶
func (t *TidbClient) PutGcobjRecord(ctx context.Context, o *Object, tx interface{}) (err error)
func (*TidbClient) PutObject ¶
func (t *TidbClient) PutObject(ctx context.Context, object *Object, tx interface{}) (err error)
func (*TidbClient) PutObjectMap ¶
func (t *TidbClient) PutObjectMap(objMap *ObjMap, tx interface{}) (err error)
func (*TidbClient) PutObjectPart ¶ added in v0.8.0
func (t *TidbClient) PutObjectPart(multipart *Multipart, part *Part, tx interface{}) (err error)
func (*TidbClient) SetObjectDeleteMarker ¶
func (t *TidbClient) SetObjectDeleteMarker(ctx context.Context, object *Object, deleteMarker bool) error
func (*TidbClient) UpdateBucketSSE ¶
func (*TidbClient) UpdateObject4Lifecycle ¶
func (t *TidbClient) UpdateObject4Lifecycle(ctx context.Context, old, new *Object, tx interface{}) (err error)
func (*TidbClient) UpdateObjectMeta ¶
func (t *TidbClient) UpdateObjectMeta(object *Object) error