Documentation ¶
Index ¶
- type DefaultInventory
- func (i *DefaultInventory) ClustersNotReady() ([]*State, error)
- func (i *DefaultInventory) ClustersToReconcile(reconcileInterval time.Duration) ([]*State, error)
- func (i *DefaultInventory) CountRetries(runtimeID string, configVersion int64, maxRetries int, ...) (int, error)
- func (i *DefaultInventory) CreateOrUpdate(contractVersion int64, cluster *keb.Cluster) (*State, error)
- func (i *DefaultInventory) Delete(runtimeID string) error
- func (i *DefaultInventory) Get(runtimeID string, configVersion int64) (*State, error)
- func (i *DefaultInventory) GetAll() ([]*State, error)
- func (i *DefaultInventory) GetLatest(runtimeID string) (*State, error)
- func (i *DefaultInventory) GetStatusIDsBlocksToDelete(statusCleanupBatchSize int) ([][]interface{}, error)
- func (i *DefaultInventory) MarkForDeletion(runtimeID string) (*State, error)
- func (i *DefaultInventory) RemoveDeletedClustersOlderThan(deadline time.Time) (int, error)
- func (i *DefaultInventory) RemoveStatusesWithoutReconciliations(timeout time.Duration, statusCleanupBatchSize int) (int, error)
- func (i *DefaultInventory) StatusChanges(runtimeID string, offset time.Duration) ([]*StatusChange, error)
- func (i *DefaultInventory) UpdateStatus(state *State, status model.Status) (*State, error)
- func (i *DefaultInventory) WithTx(tx *db.TxConnection) (Inventory, error)
- type Inventory
- type MetricsCollectorMock
- type MockInventory
- func (i *MockInventory) ClustersNotReady() ([]*State, error)
- func (i *MockInventory) ClustersToReconcile(_ time.Duration) ([]*State, error)
- func (i *MockInventory) CountRetries(_ string, _ int64, _ int, _ ...model.Status) (int, error)
- func (i *MockInventory) CreateOrUpdate(_ int64, _ *keb.Cluster) (*State, error)
- func (i *MockInventory) Delete(_ string) error
- func (i *MockInventory) Get(_ string, _ int64) (*State, error)
- func (i *MockInventory) GetAll() ([]*State, error)
- func (i *MockInventory) GetLatest(_ string) (*State, error)
- func (i *MockInventory) MarkForDeletion(_ string) (*State, error)
- func (i *MockInventory) RemoveDeletedClustersOlderThan(deadline time.Time) (int, error)
- func (i *MockInventory) RemoveStatusesWithoutReconciliations(timeout time.Duration, statusCleanupBatchSize int) (int, error)
- func (i *MockInventory) StatusChanges(_ string, _ time.Duration) ([]*StatusChange, error)
- func (i *MockInventory) UpdateStatus(_ *State, _ model.Status) (*State, error)
- func (i *MockInventory) WithTx(_ *db.TxConnection) (Inventory, error)
- type MockKubeconfigProvider
- type State
- type StatusChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultInventory ¶
type DefaultInventory struct { *repository.Repository // contains filtered or unexported fields }
func (*DefaultInventory) ClustersNotReady ¶
func (i *DefaultInventory) ClustersNotReady() ([]*State, error)
func (*DefaultInventory) ClustersToReconcile ¶
func (i *DefaultInventory) ClustersToReconcile(reconcileInterval time.Duration) ([]*State, error)
func (*DefaultInventory) CountRetries ¶
func (*DefaultInventory) CreateOrUpdate ¶
func (*DefaultInventory) Delete ¶
func (i *DefaultInventory) Delete(runtimeID string) error
func (*DefaultInventory) Get ¶
func (i *DefaultInventory) Get(runtimeID string, configVersion int64) (*State, error)
func (*DefaultInventory) GetAll ¶
func (i *DefaultInventory) GetAll() ([]*State, error)
func (*DefaultInventory) GetLatest ¶
func (i *DefaultInventory) GetLatest(runtimeID string) (*State, error)
func (*DefaultInventory) GetStatusIDsBlocksToDelete ¶
func (i *DefaultInventory) GetStatusIDsBlocksToDelete(statusCleanupBatchSize int) ([][]interface{}, error)
func (*DefaultInventory) MarkForDeletion ¶
func (i *DefaultInventory) MarkForDeletion(runtimeID string) (*State, error)
func (*DefaultInventory) RemoveDeletedClustersOlderThan ¶
func (i *DefaultInventory) RemoveDeletedClustersOlderThan(deadline time.Time) (int, error)
func (*DefaultInventory) RemoveStatusesWithoutReconciliations ¶
func (*DefaultInventory) StatusChanges ¶
func (i *DefaultInventory) StatusChanges(runtimeID string, offset time.Duration) ([]*StatusChange, error)
func (*DefaultInventory) UpdateStatus ¶
func (*DefaultInventory) WithTx ¶
func (i *DefaultInventory) WithTx(tx *db.TxConnection) (Inventory, error)
type Inventory ¶
type Inventory interface { CreateOrUpdate(contractVersion int64, cluster *keb.Cluster) (*State, error) UpdateStatus(State *State, status model.Status) (*State, error) MarkForDeletion(runtimeID string) (*State, error) Delete(runtimeID string) error Get(runtimeID string, configVersion int64) (*State, error) GetLatest(runtimeID string) (*State, error) GetAll() ([]*State, error) StatusChanges(runtimeID string, offset time.Duration) ([]*StatusChange, error) ClustersToReconcile(reconcileInterval time.Duration) ([]*State, error) ClustersNotReady() ([]*State, error) CountRetries(runtimeID string, configVersion int64, maxRetries int, errorStatus ...model.Status) (int, error) WithTx(tx *db.TxConnection) (Inventory, error) RemoveStatusesWithoutReconciliations(timeout time.Duration, statusCleanupBatchSize int) (int, error) RemoveDeletedClustersOlderThan(deadline time.Time) (int, error) }
func NewInventory ¶
func NewInventory(conn db.Connection, debug bool, collector metricsCollector) (Inventory, error)
type MetricsCollectorMock ¶
type MetricsCollectorMock struct{}
func (MetricsCollectorMock) OnClusterStateUpdate ¶
func (collector MetricsCollectorMock) OnClusterStateUpdate(_ *State) error
type MockInventory ¶
type MockInventory struct { ClustersToReconcileResult []*State ClustersNotReadyResult []*State GetResult *State GetLatestResult *State GetAllResult []*State CreateOrUpdateResult *State MarkForDeletionResult *State DeleteResult error UpdateStatusResult *State ChangesResult []*StatusChange RetriesCount int DeletedStatusesWoReconciliationResult int DeletedStatusesOlderThanResult int DeletedClustersOlderThanResult int }
func (*MockInventory) ClustersNotReady ¶
func (i *MockInventory) ClustersNotReady() ([]*State, error)
func (*MockInventory) ClustersToReconcile ¶
func (i *MockInventory) ClustersToReconcile(_ time.Duration) ([]*State, error)
func (*MockInventory) CountRetries ¶
func (*MockInventory) CreateOrUpdate ¶
func (*MockInventory) Delete ¶
func (i *MockInventory) Delete(_ string) error
func (*MockInventory) GetAll ¶
func (i *MockInventory) GetAll() ([]*State, error)
func (*MockInventory) MarkForDeletion ¶
func (i *MockInventory) MarkForDeletion(_ string) (*State, error)
func (*MockInventory) RemoveDeletedClustersOlderThan ¶
func (i *MockInventory) RemoveDeletedClustersOlderThan(deadline time.Time) (int, error)
func (*MockInventory) RemoveStatusesWithoutReconciliations ¶
func (*MockInventory) StatusChanges ¶
func (i *MockInventory) StatusChanges(_ string, _ time.Duration) ([]*StatusChange, error)
func (*MockInventory) UpdateStatus ¶
func (*MockInventory) WithTx ¶
func (i *MockInventory) WithTx(_ *db.TxConnection) (Inventory, error)
type MockKubeconfigProvider ¶
type MockKubeconfigProvider struct {
KubeconfigResult string
}
func (*MockKubeconfigProvider) Get ¶
func (kp *MockKubeconfigProvider) Get() (string, error)
type State ¶
type State struct { Cluster *model.ClusterEntity Configuration *model.ClusterConfigurationEntity Status *model.ClusterStatusEntity }
type StatusChange ¶
type StatusChange struct { Status *model.ClusterStatusEntity Duration time.Duration }
func (*StatusChange) String ¶
func (s *StatusChange) String() string
Click to show internal directories.
Click to hide internal directories.