service

package
v0.0.0-...-7109ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

更新

Jump to

Keyboard shortcuts

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