Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTariff(tariff billing.Tariff, isAdmin bool) error
- func IsAdminRole(ctx context.Context) bool
- type Clients
- type Server
- func (s *Server) AdminResizeVolume(ctx context.Context, nsID, label string, newCapacity int) error
- func (s *Server) CreateStorage(ctx context.Context, storage model.Storage) error
- func (s *Server) CreateVolume(ctx context.Context, nsID string, req model.VolumeCreateRequest) error
- func (s *Server) DeleteAllNamespaceVolumes(ctx context.Context, nsID string) error
- func (s *Server) DeleteAllUserVolumes(ctx context.Context) error
- func (s *Server) DeleteStorage(ctx context.Context, name string) error
- func (s *Server) DeleteVolume(ctx context.Context, nsID, label string) error
- func (s *Server) DirectCreateVolume(ctx context.Context, nsID string, req model.DirectVolumeCreateRequest) error
- func (s *Server) GetAllVolumes(ctx context.Context, page, perPage int, filters ...string) (kubeClientModel.VolumesList, error)
- func (s *Server) GetNamespaceVolumes(ctx context.Context, nsID string) (kubeClientModel.VolumesList, error)
- func (s *Server) GetStorages(ctx context.Context) ([]model.Storage, error)
- func (s *Server) GetUserVolumes(ctx context.Context) (kubeClientModel.VolumesList, error)
- func (s *Server) GetVolume(ctx context.Context, nsID, label string) (kubeClientModel.Volume, error)
- func (s *Server) ImportVolume(ctx context.Context, nsID string, req kubeClientModel.Volume) error
- func (s *Server) ResizeVolume(ctx context.Context, nsID, label string, newTariffID string) error
- func (s *Server) UpdateStorage(ctx context.Context, name string, req model.UpdateStorageRequest) error
- type StorageActions
- type VolumeActions
Constants ¶
View Source
const (
ZeroUUID = "00000000-0000-0000-0000-000000000000"
)
Variables ¶
View Source
var StandardVolumeFilter = database.VolumeFilter{ NotDeleted: true, }
Functions ¶
func CheckTariff ¶
CheckTariff checks if user has permissions to use tariff
func IsAdminRole ¶
IsAdminRole checks that request came from user with admin permissions.
Types ¶
type Clients ¶
type Clients struct { Billing clients.BillingClient KubeAPI clients.KubeAPIClient }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AdminResizeVolume ¶
func (*Server) CreateStorage ¶
func (*Server) CreateVolume ¶
func (*Server) DeleteAllNamespaceVolumes ¶
func (*Server) DeleteAllUserVolumes ¶
func (*Server) DeleteStorage ¶
func (*Server) DeleteVolume ¶
func (*Server) DirectCreateVolume ¶
func (*Server) GetAllVolumes ¶
func (s *Server) GetAllVolumes(ctx context.Context, page, perPage int, filters ...string) (kubeClientModel.VolumesList, error)
func (*Server) GetNamespaceVolumes ¶
func (s *Server) GetNamespaceVolumes(ctx context.Context, nsID string) (kubeClientModel.VolumesList, error)
func (*Server) GetStorages ¶
func (*Server) GetUserVolumes ¶
func (s *Server) GetUserVolumes(ctx context.Context) (kubeClientModel.VolumesList, error)
func (*Server) ImportVolume ¶
func (*Server) ResizeVolume ¶
type StorageActions ¶
type VolumeActions ¶
type VolumeActions interface { DirectCreateVolume(ctx context.Context, nsID string, req model.DirectVolumeCreateRequest) error CreateVolume(ctx context.Context, nsID string, req model.VolumeCreateRequest) error ImportVolume(ctx context.Context, nsID string, req kubeClientModel.Volume) error AdminResizeVolume(ctx context.Context, nsID, label string, newCapacity int) error ResizeVolume(ctx context.Context, nsID, label string, newTariffID string) error GetVolume(ctx context.Context, nsID, label string) (kubeClientModel.Volume, error) GetUserVolumes(ctx context.Context) (kubeClientModel.VolumesList, error) GetNamespaceVolumes(ctx context.Context, nsID string) (kubeClientModel.VolumesList, error) GetAllVolumes(ctx context.Context, page, perPage int, filters ...string) (kubeClientModel.VolumesList, error) DeleteVolume(ctx context.Context, nsID, label string) error DeleteAllNamespaceVolumes(ctx context.Context, nsID string) error DeleteAllUserVolumes(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.