utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateK8sClient

func CreateK8sClient() (*kubernetes.Clientset, error)

func ReplaceAndReturnCopy

func ReplaceAndReturnCopy(req interface{}) (interface{}, error)

Types

type ClusterNodeData added in v0.2.6

type ClusterNodeData struct {
	Region string
	Zone   string
	OS     string
}

type DriverStatsUtils

type DriverStatsUtils struct {
}

func (*DriverStatsUtils) BucketToDelete

func (su *DriverStatsUtils) BucketToDelete(volumeID string) (string, error)

func (*DriverStatsUtils) CheckMount

func (su *DriverStatsUtils) CheckMount(targetPath string) error

func (*DriverStatsUtils) FSInfo

func (su *DriverStatsUtils) FSInfo(path string) (int64, int64, int64, int64, int64, int64, error)

func (*DriverStatsUtils) GetBucketNameFromPV

func (su *DriverStatsUtils) GetBucketNameFromPV(volumeID string) (string, error)

func (*DriverStatsUtils) GetBucketUsage

func (su *DriverStatsUtils) GetBucketUsage(volumeID string) (int64, error)

func (*DriverStatsUtils) GetClusterNodeData added in v0.2.6

func (su *DriverStatsUtils) GetClusterNodeData(nodeName string) (*ClusterNodeData, error)

func (*DriverStatsUtils) GetEndpoints added in v0.2.6

func (su *DriverStatsUtils) GetEndpoints() (string, string, error)

GetEndpoints return IAMEndpoint, COSResourceConfigEndpoint, error

func (*DriverStatsUtils) GetPV added in v0.2.6

func (su *DriverStatsUtils) GetPV(volumeID string) (*v1.PersistentVolume, error)

func (*DriverStatsUtils) GetPVAttributes added in v0.2.6

func (su *DriverStatsUtils) GetPVAttributes(volumeID string) (map[string]string, error)

func (*DriverStatsUtils) GetPVC added in v0.2.6

func (su *DriverStatsUtils) GetPVC(pvcName, pvcNamespace string) (*v1.PersistentVolumeClaim, error)

func (*DriverStatsUtils) GetSecret added in v0.2.6

func (su *DriverStatsUtils) GetSecret(secretName, secretNamespace string) (*v1.Secret, error)

func (*DriverStatsUtils) GetTotalCapacityFromPV

func (su *DriverStatsUtils) GetTotalCapacityFromPV(volumeID string) (resource.Quantity, error)

type FakeStatsUtilsFuncStruct

type FakeStatsUtilsFuncStruct struct {
	FSInfoFn                 func(path string) (int64, int64, int64, int64, int64, int64, error)
	CheckMountFn             func(targetPath string) error
	BucketToDeleteFn         func(volumeID string) (string, error)
	GetTotalCapacityFromPVFn func(volumeID string) (resource.Quantity, error)
	GetBucketUsageFn         func(volumeID string) (int64, error)
	GetBucketNameFromPVFn    func(volumeID string) (string, error)
	GetClusterNodeDataFn     func(nodeName string) (*ClusterNodeData, error)
	GetEndpointsFn           func() (string, string, error)
	GetPVAttributesFn        func(volumeID string) (map[string]string, error)
	GetPVCFn                 func(pvcName, pvcNamespace string) (*v1.PersistentVolumeClaim, error)
	GetSecretFn              func(secretName, secretNamespace string) (*v1.Secret, error)
	GetPVFn                  func(volumeID string) (*v1.PersistentVolume, error)
}

type FakeStatsUtilsFuncStructImpl

type FakeStatsUtilsFuncStructImpl struct {
	DriverStatsUtils

	FuncStruct FakeStatsUtilsFuncStruct
}

func (*FakeStatsUtilsFuncStructImpl) BucketToDelete

func (m *FakeStatsUtilsFuncStructImpl) BucketToDelete(volumeID string) (string, error)

func (*FakeStatsUtilsFuncStructImpl) CheckMount

func (m *FakeStatsUtilsFuncStructImpl) CheckMount(targetPath string) error

func (*FakeStatsUtilsFuncStructImpl) FSInfo

func (*FakeStatsUtilsFuncStructImpl) GetBucketNameFromPV

func (m *FakeStatsUtilsFuncStructImpl) GetBucketNameFromPV(volumeID string) (string, error)

func (*FakeStatsUtilsFuncStructImpl) GetBucketUsage

func (m *FakeStatsUtilsFuncStructImpl) GetBucketUsage(volumeID string) (int64, error)

func (*FakeStatsUtilsFuncStructImpl) GetClusterNodeData added in v0.2.6

func (m *FakeStatsUtilsFuncStructImpl) GetClusterNodeData(nodeName string) (*ClusterNodeData, error)

func (*FakeStatsUtilsFuncStructImpl) GetEndpoints added in v0.2.6

func (m *FakeStatsUtilsFuncStructImpl) GetEndpoints() (string, string, error)

func (*FakeStatsUtilsFuncStructImpl) GetPV added in v0.2.6

func (*FakeStatsUtilsFuncStructImpl) GetPVAttributes added in v0.2.6

func (m *FakeStatsUtilsFuncStructImpl) GetPVAttributes(volumeID string) (map[string]string, error)

func (*FakeStatsUtilsFuncStructImpl) GetPVC added in v0.2.6

func (m *FakeStatsUtilsFuncStructImpl) GetPVC(pvcName, pvcNamespace string) (*v1.PersistentVolumeClaim, error)

func (*FakeStatsUtilsFuncStructImpl) GetSecret added in v0.2.6

func (m *FakeStatsUtilsFuncStructImpl) GetSecret(secretName, secretNamespace string) (*v1.Secret, error)

func (*FakeStatsUtilsFuncStructImpl) GetTotalCapacityFromPV

func (m *FakeStatsUtilsFuncStructImpl) GetTotalCapacityFromPV(volumeID string) (resource.Quantity, error)

type Set added in v0.12.43

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

Set is a collection of unique string items

func NewSet added in v0.12.43

func NewSet() *Set

NewSet creates an empty Set

func NewSetWithValues added in v0.12.43

func NewSetWithValues(values ...string) *Set

NewSetWithValues creates a Set with initial values

func (*Set) Add added in v0.12.43

func (s *Set) Add(key string)

Add adds an item to the Set

func (*Set) Contains added in v0.12.43

func (s *Set) Contains(key string) bool

Contains checks if an item exists in the Set

func (*Set) Remove added in v0.12.43

func (s *Set) Remove(key string) error

Remove removes an item from the Set

func (*Set) Size added in v0.12.43

func (s *Set) Size() int

Size returns the number of items in the Set

type StatsUtils

type StatsUtils interface {
	BucketToDelete(volumeID string) (string, error)
	FSInfo(path string) (int64, int64, int64, int64, int64, int64, error)
	CheckMount(targetPath string) error
	GetTotalCapacityFromPV(volumeID string) (resource.Quantity, error)
	GetBucketUsage(volumeID string) (int64, error)
	GetBucketNameFromPV(volumeID string) (string, error)
	GetClusterNodeData(nodeName string) (*ClusterNodeData, error)
	GetEndpoints() (string, string, error)
	GetPVAttributes(volumeID string) (map[string]string, error)
	GetPVC(pvcName, pvcNamespace string) (*v1.PersistentVolumeClaim, error)
	GetSecret(secretName, secretNamespace string) (*v1.Secret, error)
	GetPV(volumeID string) (*v1.PersistentVolume, error)
}

Jump to

Keyboard shortcuts

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