driver

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDBDriver

func RegisterDBDriver(dbType string, dbDriver DBDriver)

Types

type DB

type DB interface {
	// get the info of the cluster
	GetCluster(fsid, pool string) (cluster types.Cluster, err error)

	// get the multiparts which belong to the uploadId.
	ListParts(uploadId uint64) ([]*types.PartInfo, error)

	// put part info.
	PutPart(partInfo *types.PartInfo) error

	// complete the parts
	CompleteParts(uploadId uint64, parts []*types.PartInfo) error

	// delete the parts
	DeleteParts(uploadId uint64) error

	// delete multipart uploaded part objects and put them into gc
	PutPartsInGc(parts []*types.PartInfo) error

	// delete objects
	PutGcObjects(objects ...*types.GcObject) error

	// get gc objects by marker and limit
	GetGcObjects(marker int64, limit int) ([]*types.GcObject, error)

	// delete gc objects meta.
	DeleteGcObjects(objects ...*types.GcObject) error

	// close this driver if it is not needed.
	// Caution that this driver should be closed if the main process finishes.
	Close()
}

DB Interface Error returned by those functions should be ErrDBError, ErrNoSuchKey or ErrInternalError

func Open

func Open(dbCfg config.DatabaseConfig) (DB, error)

type DBDriver

type DBDriver interface {
	// initialize this driver
	OpenDB(dbCfg config.DatabaseConfig) (DB, error)
}

DB Driver Interface Error returned by those functions should be ErrDBError, ErrNoSuchKey or ErrInternalError

Jump to

Keyboard shortcuts

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