tidbclient

package
Version: v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

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

View Source
const MAX_OPEN_CONNS = 1024
View Source
const TimeDur = 5000 // milisecond

Variables

This section is empty.

Functions

func VersionStr2UInt64

func VersionStr2UInt64(vers string) uint64

Types

type TidbClient

type TidbClient struct {
	Client *sql.DB
}

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 (t *TidbClient) CreateBucketSSE(ctx context.Context, bucketName string, sseType string, sseKey []byte, sseIV []byte) error

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) (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 (t *TidbClient) ListObjects(ctx context.Context, bucketName string, versioned bool, maxKeys int,
	filter map[string]string) (retObjects []*Object, appendInfo utils.ListObjsAppendInfo, err error)

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 (t *TidbClient) UpdateBucketSSE(ctx context.Context, bucketName string, sseType string, sseKey []byte,
	sseIV []byte) error

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

func (*TidbClient) UpdateUsage

func (t *TidbClient) UpdateUsage(ctx context.Context, bucketName string, size int64, tx interface{}) (err error)

func (*TidbClient) UpdateUsages

func (t *TidbClient) UpdateUsages(ctx context.Context, usages map[string]int64, tx interface{}) error

Jump to

Keyboard shortcuts

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