Documentation ¶
Overview ¶
Package cloud is a generated GoMock package.
Index ¶
- Constants
- Variables
- type AttachDiskRequest
- type Cloud
- type Cluster
- type ClusterForDisk
- type CreateDiskRequest
- type CreateDiskResponse
- type DeleteDiskRequest
- type DeleteDiskResponse
- type DetachDiskRequest
- type Disk
- type DiskAttachment
- type DiskOptions
- type DiskToCreate
- type DiskToUpdate
- type ErrorResponse
- type GetDiskRequest
- type GetDiskResponse
- type ListDisksResponse
- type MockCloud
- func (m *MockCloud) AttachDisk(ctx context.Context, volumeID, nodeID string) (string, error)
- func (m *MockCloud) CreateDisk(ctx context.Context, clusterName string, diskOptions *DiskOptions) (*Volume, error)
- func (m *MockCloud) DeleteDisk(ctx context.Context, volumeID string) (bool, error)
- func (m *MockCloud) DetachDisk(ctx context.Context, volumeID, nodeID string) error
- func (m *MockCloud) EXPECT() *MockCloudMockRecorder
- func (m *MockCloud) GetClusterName(ctx context.Context, nrn string) (string, error)
- func (m *MockCloud) GetDiskByID(ctx context.Context, volumeID string) (*Volume, error)
- func (m *MockCloud) GetDiskByName(ctx context.Context, name string, capacityBytes int64) (*Volume, error)
- func (m *MockCloud) IsExistNode(ctx context.Context, clusterName, nodeID string) bool
- func (m *MockCloud) ResizeDisk(ctx context.Context, volumeID string, size int64) (int64, error)
- type MockCloudMockRecorder
- func (mr *MockCloudMockRecorder) AttachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) CreateDisk(ctx, clusterName, diskOptions interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) DeleteDisk(ctx, volumeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) DetachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetClusterName(ctx, nrn interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetDiskByID(ctx, volumeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetDiskByName(ctx, name, capacityBytes interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) IsExistNode(ctx, clusterName, nodeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) ResizeDisk(ctx, volumeID, size interface{}) *gomock.Call
- type Node
- type NodePool
- type Tag
- type UpdateDiskRequest
- type UpdateDiskResponse
- type Volume
Constants ¶
const ( // Available disk types // VolumeTypeStandardFlash represents a standard flash volume (randomly select type A or B) VolumeTypeStandardFlash = "standard-flash" // VolumeTypeStandardFlashA represents a standard flash volume (only use type A) VolumeTypeStandardFlashA = "standard-flash-a" // VolumeTypeStandardFlashB represents a standard flash volume (only use type B) VolumeTypeStandardFlashB = "standard-flash-b" // VolumeTypeHighSpeedFlash represents a high spped flash volume (randomly select type A or B) VolumeTypeHighSpeedFlash = "high-speed-flash" // VolumeTypeHighSpeedFlashA represents a high spped flash volume (only use type A) VolumeTypeHighSpeedFlashA = "high-speed-flash-a" // VolumeTypeHighSpeedFlashB represents a high spped flash volume (only use type B) VolumeTypeHighSpeedFlashB = "high-speed-flash-b" )
const ( // DefaultVolumeSize represents the default volume size. DefaultVolumeSize int64 = 100 * util.GiB // DefaultVolumeType specifies which storage to use for newly created volumes. DefaultVolumeType = VolumeTypeStandardFlashA // TagKeyCSIVolumeName is the tag key for CSI volume name. TagKeyCSIVolumeName = "disk.csi.hatoba.nifcloud.com/csi-volume-name" )
Variables ¶
var ( // ErrMultiDisks is an error that is returned when multiple // disks are found with the same volume name. ErrMultiDisks = errors.New("Multiple disks with same name") // ErrDiskExistsDiffSize is an error that is returned if a disk with a given // name, but different size, is found. ErrDiskExistsDiffSize = errors.New("There is already a disk with same name and different size") // ErrNotFound is returned when a resource is not found. ErrNotFound = errors.New("Resource was not found") // ErrAlreadyExists is returned when a resource is already existent. ErrAlreadyExists = errors.New("Resource already exists") // ErrVolumeInUse is returned when a disk is already attached to an node. ErrDiskInUse = errors.New("Request disk is already attached to an node") )
Functions ¶
This section is empty.
Types ¶
type AttachDiskRequest ¶
type Cloud ¶
type Cloud interface { CreateDisk(ctx context.Context, clusterName string, diskOptions *DiskOptions) (disk *Volume, err error) DeleteDisk(ctx context.Context, volumeID string) (success bool, err error) AttachDisk(ctx context.Context, volumeID, nodeID string) (devicePath string, err error) DetachDisk(ctx context.Context, volumeID, nodeID string) (err error) ResizeDisk(ctx context.Context, volumeID string, size int64) (int64, error) GetDiskByName(ctx context.Context, name string, capacityBytes int64) (disk *Volume, err error) GetDiskByID(ctx context.Context, volumeID string) (disk *Volume, err error) IsExistNode(ctx context.Context, clusterName, nodeID string) (success bool) GetClusterName(ctx context.Context, nrn string) (string, error) }
Cloud is interface for cloud api manipulator
type ClusterForDisk ¶
type ClusterForDisk struct {
Name string `json:"name"`
}
type CreateDiskRequest ¶
type CreateDiskRequest struct {
Disk *DiskToCreate `json:"disk"`
}
type CreateDiskResponse ¶
type CreateDiskResponse struct {
Disk *Disk `json:"disk"`
}
type DeleteDiskRequest ¶
type DeleteDiskRequest struct {
DiskName string
}
type DeleteDiskResponse ¶
type DeleteDiskResponse struct{}
type DetachDiskRequest ¶
type Disk ¶
type Disk struct { Name string `json:"name"` Cluster *ClusterForDisk `json:"cluster,omitempty"` Size uint `json:"size"` Type string `json:"type"` AvailabilityZone string `json:"availabilityZone"` Attachments []*DiskAttachment `json:"attachments,omitempty"` Description string `json:"description"` Status string `json:"status"` NRN string `json:"nrn"` }
type DiskAttachment ¶
type DiskOptions ¶
type DiskOptions struct { CapacityBytes int64 VolumeType string Zone string Tags map[string]string }
DiskOptions represents parameters to create an NIFCLOUD Hatoba disk
type DiskToCreate ¶
type DiskToUpdate ¶
type ErrorResponse ¶
type GetDiskRequest ¶
type GetDiskRequest struct {
DiskName string
}
type GetDiskResponse ¶
type GetDiskResponse struct {
Disk *Disk `json:"disk"`
}
type ListDisksResponse ¶
type ListDisksResponse struct {
Disks []*Disk `json:"disks"`
}
type MockCloud ¶
type MockCloud struct {
// contains filtered or unexported fields
}
MockCloud is a mock of Cloud interface.
func NewMockCloud ¶
func NewMockCloud(ctrl *gomock.Controller) *MockCloud
NewMockCloud creates a new mock instance.
func (*MockCloud) AttachDisk ¶
AttachDisk mocks base method.
func (*MockCloud) CreateDisk ¶
func (m *MockCloud) CreateDisk(ctx context.Context, clusterName string, diskOptions *DiskOptions) (*Volume, error)
CreateDisk mocks base method.
func (*MockCloud) DeleteDisk ¶
DeleteDisk mocks base method.
func (*MockCloud) DetachDisk ¶
DetachDisk mocks base method.
func (*MockCloud) EXPECT ¶
func (m *MockCloud) EXPECT() *MockCloudMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCloud) GetClusterName ¶
GetClusterName mocks base method.
func (*MockCloud) GetDiskByID ¶
GetDiskByID mocks base method.
func (*MockCloud) GetDiskByName ¶
func (m *MockCloud) GetDiskByName(ctx context.Context, name string, capacityBytes int64) (*Volume, error)
GetDiskByName mocks base method.
func (*MockCloud) IsExistNode ¶
IsExistNode mocks base method.
type MockCloudMockRecorder ¶
type MockCloudMockRecorder struct {
// contains filtered or unexported fields
}
MockCloudMockRecorder is the mock recorder for MockCloud.
func (*MockCloudMockRecorder) AttachDisk ¶
func (mr *MockCloudMockRecorder) AttachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
AttachDisk indicates an expected call of AttachDisk.
func (*MockCloudMockRecorder) CreateDisk ¶
func (mr *MockCloudMockRecorder) CreateDisk(ctx, clusterName, diskOptions interface{}) *gomock.Call
CreateDisk indicates an expected call of CreateDisk.
func (*MockCloudMockRecorder) DeleteDisk ¶
func (mr *MockCloudMockRecorder) DeleteDisk(ctx, volumeID interface{}) *gomock.Call
DeleteDisk indicates an expected call of DeleteDisk.
func (*MockCloudMockRecorder) DetachDisk ¶
func (mr *MockCloudMockRecorder) DetachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
DetachDisk indicates an expected call of DetachDisk.
func (*MockCloudMockRecorder) GetClusterName ¶
func (mr *MockCloudMockRecorder) GetClusterName(ctx, nrn interface{}) *gomock.Call
GetClusterName indicates an expected call of GetClusterName.
func (*MockCloudMockRecorder) GetDiskByID ¶
func (mr *MockCloudMockRecorder) GetDiskByID(ctx, volumeID interface{}) *gomock.Call
GetDiskByID indicates an expected call of GetDiskByID.
func (*MockCloudMockRecorder) GetDiskByName ¶
func (mr *MockCloudMockRecorder) GetDiskByName(ctx, name, capacityBytes interface{}) *gomock.Call
GetDiskByName indicates an expected call of GetDiskByName.
func (*MockCloudMockRecorder) IsExistNode ¶
func (mr *MockCloudMockRecorder) IsExistNode(ctx, clusterName, nodeID interface{}) *gomock.Call
IsExistNode indicates an expected call of IsExistNode.
func (*MockCloudMockRecorder) ResizeDisk ¶
func (mr *MockCloudMockRecorder) ResizeDisk(ctx, volumeID, size interface{}) *gomock.Call
ResizeDisk indicates an expected call of ResizeDisk.
type UpdateDiskRequest ¶
type UpdateDiskRequest struct { Name string `json:"-"` Disk *DiskToUpdate `json:"disk"` }
type UpdateDiskResponse ¶
type UpdateDiskResponse struct {
Disk *Disk `json:"disk"`
}