Documentation ¶
Index ¶
- type IVolumeDataService
- type VolumeDataService
- func (u *VolumeDataService) AddVolume(volume *model.Volume) (int64, error)
- func (u *VolumeDataService) CreateVolumeToK8s(info *volume.VolumeInfo) (err error)
- func (u *VolumeDataService) DeleteVolume(volumeID int64) error
- func (u *VolumeDataService) DeleteVolumeFromK8s(volume *model.Volume) (err error)
- func (u *VolumeDataService) FindAllVolume() ([]model.Volume, error)
- func (u *VolumeDataService) FindVolumeByID(volumeID int64) (*model.Volume, error)
- func (u *VolumeDataService) UpdateVolume(volume *model.Volume) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IVolumeDataService ¶
type IVolumeDataService interface { AddVolume(*model.Volume) (int64, error) DeleteVolume(int64) error UpdateVolume(*model.Volume) error FindVolumeByID(int64) (*model.Volume, error) FindAllVolume() ([]model.Volume, error) CreateVolumeToK8s(*volume.VolumeInfo) error DeleteVolumeFromK8s(*model.Volume) error }
这里是接口类型
func NewVolumeDataService ¶
func NewVolumeDataService(volumeRepository repository.IVolumeRepository, clientSet *kubernetes.Clientset) IVolumeDataService
创建 注意:返回值 IVolumeDataService 接口类型
type VolumeDataService ¶
type VolumeDataService struct { //注意:这里是 IVolumeRepository 类型 VolumeRepository repository.IVolumeRepository K8sClientSet *kubernetes.Clientset // contains filtered or unexported fields }
func (*VolumeDataService) AddVolume ¶
func (u *VolumeDataService) AddVolume(volume *model.Volume) (int64, error)
插入
func (*VolumeDataService) CreateVolumeToK8s ¶
func (u *VolumeDataService) CreateVolumeToK8s(info *volume.VolumeInfo) (err error)
func (*VolumeDataService) DeleteVolume ¶
func (u *VolumeDataService) DeleteVolume(volumeID int64) error
删除
func (*VolumeDataService) DeleteVolumeFromK8s ¶
func (u *VolumeDataService) DeleteVolumeFromK8s(volume *model.Volume) (err error)
从k8s中删除pvc
func (*VolumeDataService) FindAllVolume ¶
func (u *VolumeDataService) FindAllVolume() ([]model.Volume, error)
查找
func (*VolumeDataService) FindVolumeByID ¶
func (u *VolumeDataService) FindVolumeByID(volumeID int64) (*model.Volume, error)
查找
func (*VolumeDataService) UpdateVolume ¶
func (u *VolumeDataService) UpdateVolume(volume *model.Volume) error
更新
Click to show internal directories.
Click to hide internal directories.