Documentation ¶
Index ¶
- func IsNotFound(err error) bool
- type API
- func (a *API) DeletePVC(name string) error
- func (a *API) DeletePVCHandler() gin.HandlerFunc
- func (a *API) GetPVC(name string) (VolumeInfo, error)
- func (a *API) GetPVCHandler() gin.HandlerFunc
- func (a *API) GetPVCList() ([]VolumeInfo, error)
- func (a *API) GetPodsInfoByPVC(pods []v1.Pod, pvcName string) ([]PodInfo, error)
- func (a *API) ListPVCHandler() gin.HandlerFunc
- func (a *API) OkHandler(version string, mode string, service string) gin.HandlerFunc
- type Config
- type PVCStore
- type PVCStoreConfig
- type PodInfo
- type PodStore
- type PodStoreConfig
- type VolumeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶ added in v0.1.1
IsNotFound returns true if the error is a errors.StatusError matching metaV1.StatusReasonNotFound this function allows us to log more critical errors and pass status information such at 404s and 500s through the REST API.
Types ¶
type API ¶
type API struct { *Config LogErrors prometheus.Counter PVCSelectorMap map[string]string PodStore *PodStore PVCStore *PVCStore }
API is primary object implementing the core API methods and HTTP handlers
func NewApi ¶
NewApi constructs an API object and populates it with configuration along with setting defaults where required.
func (*API) DeletePVCHandler ¶
func (a *API) DeletePVCHandler() gin.HandlerFunc
func (*API) GetPVCHandler ¶
func (a *API) GetPVCHandler() gin.HandlerFunc
func (*API) GetPVCList ¶
func (a *API) GetPVCList() ([]VolumeInfo, error)
func (*API) GetPodsInfoByPVC ¶
func (*API) ListPVCHandler ¶
func (a *API) ListPVCHandler() gin.HandlerFunc
type Config ¶
type Config struct { Service string Version string Log *zap.Logger Cs *kubernetes.Clientset PVCNamespace string PVCSelector string }
Config configures the API
type PVCStore ¶ added in v0.1.1
type PVCStore struct { *PVCStoreConfig Stopper chan struct{} sync.Mutex // contains filtered or unexported fields }
func NewPVCStore ¶ added in v0.1.1
func NewPVCStore(cfg *PVCStoreConfig) (*PVCStore, error)
func (*PVCStore) AddPVC ¶ added in v0.1.1
func (pvcs *PVCStore) AddPVC(pvc v1.PersistentVolumeClaim)
func (*PVCStore) GetPVC ¶ added in v0.1.1
func (pvcs *PVCStore) GetPVC(pvcName string) *v1.PersistentVolumeClaim
func (*PVCStore) GetPVCs ¶ added in v0.1.1
func (pvcs *PVCStore) GetPVCs() []v1.PersistentVolumeClaim
type PVCStoreConfig ¶ added in v0.1.1
type PVCStoreConfig struct { Namespace string Log *zap.Logger Cs *kubernetes.Clientset }
type PodInfo ¶
type PodInfo struct { Name string `json:"name"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Phase v1.PodPhase `json:"phase"` StartTime *metaV1.Time `json:"startTime"` Terminating bool `json:"terminating"` TerminatingSince *metaV1.Time `json:"terminatingSince,omitempty"` }
type PodStore ¶ added in v0.1.1
type PodStore struct { *PodStoreConfig Stopper chan struct{} sync.Mutex // contains filtered or unexported fields }
func NewPodStore ¶ added in v0.1.1
func NewPodStore(cfg *PodStoreConfig) (*PodStore, error)
type PodStoreConfig ¶ added in v0.1.1
type PodStoreConfig struct { Namespace string Log *zap.Logger Cs *kubernetes.Clientset }
type VolumeInfo ¶
type VolumeInfo struct { Name string `json:"name"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Status v1.PersistentVolumeClaimStatus `json:"status"` Spec v1.PersistentVolumeClaimSpec `json:"spec"` Terminating bool `json:"terminating"` TerminatingSince *metaV1.Time `json:"terminatingSince,omitempty"` UsedBy []PodInfo `json:"usedBy"` }
Click to show internal directories.
Click to hide internal directories.