tidbclient

package
v0.6.2-Daito-RC1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 19 Imported by: 1

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.

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

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) CreateBucketVersioning

func (t *TidbClient) CreateBucketVersioning(ctx context.Context, bucketName string, versionStatus string) error

func (*TidbClient) DeleteBucket

func (t *TidbClient) DeleteBucket(ctx context.Context, bucket *Bucket) error

func (*TidbClient) DeleteGcobjRecord

func (t *TidbClient) DeleteGcobjRecord(ctx context.Context, o *Object, 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) GetBucketVersioning

func (t *TidbClient) GetBucketVersioning(ctx context.Context, bucketName string) (versionOptsPtr *pb.BucketVersioning, 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) 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) 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) SetObjectDeleteMarker

func (t *TidbClient) SetObjectDeleteMarker(ctx context.Context, object *Object, deleteMarker bool) error

func (*TidbClient) UpdateBucketVersioning

func (t *TidbClient) UpdateBucketVersioning(ctx context.Context, bucketName string, versionStatus string) error

func (*TidbClient) UpdateObject

func (t *TidbClient) UpdateObject(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