db

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(db *Database)

Init function can perform some initialization work of different databases.

Types

type Client

type Client interface {
	CreateDock(ctx *c.Context, dck *model.DockSpec) (*model.DockSpec, error)

	GetDock(ctx *c.Context, dckID string) (*model.DockSpec, error)

	ListDocks(ctx *c.Context) ([]*model.DockSpec, error)

	ListDocksWithFilter(ctx *c.Context, m map[string][]string) ([]*model.DockSpec, error)
	UpdateDock(ctx *c.Context, dckID, name, desp string) (*model.DockSpec, error)

	DeleteDock(ctx *c.Context, dckID string) error

	GetDockByPoolId(ctx *c.Context, poolId string) (*model.DockSpec, error)

	CreatePool(ctx *c.Context, pol *model.StoragePoolSpec) (*model.StoragePoolSpec, error)

	GetPool(ctx *c.Context, polID string) (*model.StoragePoolSpec, error)

	ListPools(ctx *c.Context) ([]*model.StoragePoolSpec, error)

	ListPoolsWithFilter(ctx *c.Context, m map[string][]string) ([]*model.StoragePoolSpec, error)
	UpdatePool(ctx *c.Context, polID, name, desp string, usedCapacity int64, used bool) (*model.StoragePoolSpec, error)

	DeletePool(ctx *c.Context, polID string) error

	CreateProfile(ctx *c.Context, prf *model.ProfileSpec) (*model.ProfileSpec, error)

	GetProfile(ctx *c.Context, prfID string) (*model.ProfileSpec, error)

	GetDefaultProfile(ctx *c.Context) (*model.ProfileSpec, error)

	ListProfiles(ctx *c.Context) ([]*model.ProfileSpec, error)

	ListProfilesWithFilter(ctx *c.Context, m map[string][]string) ([]*model.ProfileSpec, error)
	UpdateProfile(ctx *c.Context, prfID string, input *model.ProfileSpec) (*model.ProfileSpec, error)

	DeleteProfile(ctx *c.Context, prfID string) error

	AddExtraProperty(ctx *c.Context, prfID string, ext model.ExtraSpec) (*model.ExtraSpec, error)

	ListExtraProperties(ctx *c.Context, prfID string) (*model.ExtraSpec, error)

	RemoveExtraProperty(ctx *c.Context, prfID, extraKey string) error

	CreateVolume(ctx *c.Context, vol *model.VolumeSpec) (*model.VolumeSpec, error)

	GetVolume(ctx *c.Context, volID string) (*model.VolumeSpec, error)

	ListVolumes(ctx *c.Context) ([]*model.VolumeSpec, error)

	ListVolumesWithFilter(ctx *c.Context, m map[string][]string) ([]*model.VolumeSpec, error)
	UpdateVolume(ctx *c.Context, vol *model.VolumeSpec) (*model.VolumeSpec, error)

	DeleteVolume(ctx *c.Context, volID string) error

	ExtendVolume(ctx *c.Context, vol *model.VolumeSpec) (*model.VolumeSpec, error)

	CreateVolumeAttachment(ctx *c.Context, attachment *model.VolumeAttachmentSpec) (*model.VolumeAttachmentSpec, error)

	GetVolumeAttachment(ctx *c.Context, attachmentId string) (*model.VolumeAttachmentSpec, error)

	ListVolumeAttachments(ctx *c.Context, volumeId string) ([]*model.VolumeAttachmentSpec, error)

	ListVolumeAttachmentsWithFilter(ctx *c.Context, m map[string][]string) ([]*model.VolumeAttachmentSpec, error)
	UpdateVolumeAttachment(ctx *c.Context, attachmentId string, attachment *model.VolumeAttachmentSpec) (*model.VolumeAttachmentSpec, error)

	DeleteVolumeAttachment(ctx *c.Context, attachmentId string) error

	CreateVolumeSnapshot(ctx *c.Context, vs *model.VolumeSnapshotSpec) (*model.VolumeSnapshotSpec, error)

	GetVolumeSnapshot(ctx *c.Context, snapshotID string) (*model.VolumeSnapshotSpec, error)

	ListVolumeSnapshots(ctx *c.Context) ([]*model.VolumeSnapshotSpec, error)

	ListVolumeSnapshotsWithFilter(ctx *c.Context, m map[string][]string) ([]*model.VolumeSnapshotSpec, error)
	UpdateVolumeSnapshot(ctx *c.Context, snapshotID string, vs *model.VolumeSnapshotSpec) (*model.VolumeSnapshotSpec, error)

	DeleteVolumeSnapshot(ctx *c.Context, snapshotID string) error
}

Client is an interface for exposing some operations of managing database client.

var C Client

C is a global variable that controls database module.

Directories

Path Synopsis
drivers

Jump to

Keyboard shortcuts

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