sharedhostpath

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiB = 1 << 20
	GiB = 1 << 30
)

Variables

This section is empty.

Functions

func NewControllerServer

func NewControllerServer(nodeID string, vh *VolumeHelper) *controllerServer

func NewIdentityServer

func NewIdentityServer(name string, isController bool, version string) *identityServer

func NewNodeServer

func NewNodeServer(nodeId string, maxVolumesPerNode int64, vh *VolumeHelper) *nodeServer

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() *nonBlockingGRPCServer

func NewSharedHostPathDriver

func NewSharedHostPathDriver(driverName, nodeID, endpoint, dataRoot, dsn string, maxVolumesPerNode int64, version string) (*sharedHostPath, error)

Types

type ControllerPublishVolumeInfo

type ControllerPublishVolumeInfo struct {
	StorageID int64 `gorm:"autoIncrement"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	VolID     string         `gorm:"index; not null"`
	NodeID    string         `gorm:"index; not null"`
	ReadOnly  bool
}

type NodeInfo

type NodeInfo struct {
	ID       string    `gorm:"primaryKey"`
	LastSeen time.Time `sql:"DEFAULT:current_timestamp"`
}

type NodePublishVolumeInfo

type NodePublishVolumeInfo struct {
	StorageID int64 `gorm:"autoIncrement"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	VolID     string         `gorm:"index; not null"`
	NodeID    string         `gorm:"index; not null"`
	MountPath string
	RawMount  bool
	ReadOnly  bool
}

type Volume

type Volume struct {
	StorageID int64 `gorm:"autoIncrement"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	VolID     string         `gorm:"uniqueIndex; not null"`
	VolName   string         `gorm:"index; not null"`
	PVName    string         `gorm:"not null"`
	PVCName   string         `gorm:"not null"`
	NSName    string         `gorm:"index; not null"`
	Capacity  int64
	IsBlock   bool
	VolPath   string `gorm:"uniqueIndex; not null"`
}

func (*Volume) PopulateVolumeIfRequired

func (vol *Volume) PopulateVolumeIfRequired() (bool, error)

type VolumeHelper

type VolumeHelper struct {
	// contains filtered or unexported fields
}

func NewVolumeHelper

func NewVolumeHelper(dataRoot, dsn string) (*VolumeHelper, error)

func (*VolumeHelper) CleanUpDanglingVolumes

func (vh *VolumeHelper) CleanUpDanglingVolumes() error

func (*VolumeHelper) Close

func (vh *VolumeHelper) Close() error

func (*VolumeHelper) CreateControllerPublishVolumeInfo

func (vh *VolumeHelper) CreateControllerPublishVolumeInfo(volId, nodeId string, readonly bool) error

func (*VolumeHelper) CreateNodePublishVolumeInfo

func (vh *VolumeHelper) CreateNodePublishVolumeInfo(volId, nodeId, mountPath string, rawMount, readonly bool) error

func (*VolumeHelper) CreateVolume

func (vh *VolumeHelper) CreateVolume(volid, volname, pvname, pvcname, nsname string, capacity int64, isblock bool) (*Volume, error)

func (*VolumeHelper) DeleteControllerPublishVolumeInfo

func (vh *VolumeHelper) DeleteControllerPublishVolumeInfo(volId, nodeId string) error

func (*VolumeHelper) DeleteNodePublishVolumeInfo

func (vh *VolumeHelper) DeleteNodePublishVolumeInfo(volId, nodeId, mountPath string) error

func (*VolumeHelper) DeleteVolume

func (vh *VolumeHelper) DeleteVolume(volid string) error

func (*VolumeHelper) GetControllerPublishVolumeInfo

func (vh *VolumeHelper) GetControllerPublishVolumeInfo(volId, nodeId string) (*ControllerPublishVolumeInfo, error)

func (*VolumeHelper) GetNodeInfo

func (vh *VolumeHelper) GetNodeInfo(nodeId string, age int64) (*NodeInfo, error)

func (*VolumeHelper) GetNodePublishVolumeInfo

func (vh *VolumeHelper) GetNodePublishVolumeInfo(volId, nodeId, mountPath string) (*NodePublishVolumeInfo, error)

func (*VolumeHelper) GetVolume

func (vh *VolumeHelper) GetVolume(volid string) (*Volume, error)

func (*VolumeHelper) GetVolumeCount added in v1.0.2

func (vh *VolumeHelper) GetVolumeCount() (int, error)

func (*VolumeHelper) GetVolumeIdByName

func (vh *VolumeHelper) GetVolumeIdByName(volname string) (string, error)

func (*VolumeHelper) GetVolumeWithDetail

func (vh *VolumeHelper) GetVolumeWithDetail(volid string) (map[string]interface{}, error)

func (*VolumeHelper) GetVolumesWithDetail

func (vh *VolumeHelper) GetVolumesWithDetail(offset, limit int) ([]map[string]interface{}, error)
func (vh *VolumeHelper) ReBuildSymLinks() error

func (*VolumeHelper) UpdateNodeInfoLastSeen

func (vh *VolumeHelper) UpdateNodeInfoLastSeen(nodeId string, lastSeen time.Time) error

func (*VolumeHelper) UpdateVolumeCapacity

func (vh *VolumeHelper) UpdateVolumeCapacity(vol *Volume, capacity int64) error

Jump to

Keyboard shortcuts

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