repository

package
v0.0.0-...-0888c82 Latest Latest
Warning

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

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

Documentation

Overview

Package repository is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationFilters

type ApplicationFilters struct {
	SubmissionStartTime *time.Time
	SubmissionEndTime   *time.Time
	FinishedStartTime   *time.Time
	FinishedEndTime     *time.Time
	User                *string
	Groups              []string
	Offset              *int
	Limit               *int
}

type EventRepository

type EventRepository interface {
	// Counts returns a map of event types to their counts.
	Counts(ctx context.Context) (model.EventTypeCounts, error)
	// Record increments the count of the given event type.
	Record(ctx context.Context, event *si.EventRecord) error
}

type HistoryFilters

type HistoryFilters struct {
	TimestampStart *time.Time
	TimestampEnd   *time.Time
	Offset         *int
	Limit          *int
}

type InMemoryEventRepository

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

InMemoryEventRepository is an in-memory implementation of the EventRepository interface. TODO: This implementation is not resilient to crashes and will lose all data when the process is restarted.

func NewInMemoryEventRepository

func NewInMemoryEventRepository() *InMemoryEventRepository

func (*InMemoryEventRepository) Counts

func (*InMemoryEventRepository) Record

func (r *InMemoryEventRepository) Record(ctx context.Context, event *si.EventRecord) error

type MockRepository

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

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) DeleteApplicationsNotInIDs

func (m *MockRepository) DeleteApplicationsNotInIDs(arg0 context.Context, arg1 []string, arg2 int64) error

DeleteApplicationsNotInIDs mocks base method.

func (*MockRepository) DeleteNodesNotInIDs

func (m *MockRepository) DeleteNodesNotInIDs(arg0 context.Context, arg1 []string, arg2 int64) error

DeleteNodesNotInIDs mocks base method.

func (*MockRepository) DeletePartitionsNotInIDs

func (m *MockRepository) DeletePartitionsNotInIDs(arg0 context.Context, arg1 []string, arg2 int64) error

DeletePartitionsNotInIDs mocks base method.

func (*MockRepository) DeleteQueuesNotInIDs

func (m *MockRepository) DeleteQueuesNotInIDs(arg0 context.Context, arg1 []string, arg2 int64) error

DeleteQueuesNotInIDs mocks base method.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) GetAllApplications

func (m *MockRepository) GetAllApplications(arg0 context.Context, arg1 ApplicationFilters) ([]*model.Application, error)

GetAllApplications mocks base method.

func (*MockRepository) GetAllPartitions

func (m *MockRepository) GetAllPartitions(arg0 context.Context, arg1 PartitionFilters) ([]*model.Partition, error)

GetAllPartitions mocks base method.

func (*MockRepository) GetAllQueues

func (m *MockRepository) GetAllQueues(arg0 context.Context) ([]*model.Queue, error)

GetAllQueues mocks base method.

func (*MockRepository) GetApplicationByID

func (m *MockRepository) GetApplicationByID(arg0 context.Context, arg1 string) (*model.Application, error)

GetApplicationByID mocks base method.

func (*MockRepository) GetApplicationsHistory

func (m *MockRepository) GetApplicationsHistory(arg0 context.Context, arg1 HistoryFilters) ([]*model.AppHistory, error)

GetApplicationsHistory mocks base method.

func (*MockRepository) GetAppsPerPartitionPerQueue

func (m *MockRepository) GetAppsPerPartitionPerQueue(arg0 context.Context, arg1, arg2 string, arg3 ApplicationFilters) ([]*model.Application, error)

GetAppsPerPartitionPerQueue mocks base method.

func (*MockRepository) GetContainersHistory

func (m *MockRepository) GetContainersHistory(arg0 context.Context, arg1 HistoryFilters) ([]*model.ContainerHistory, error)

GetContainersHistory mocks base method.

func (*MockRepository) GetNodeByID

func (m *MockRepository) GetNodeByID(arg0 context.Context, arg1 string) (*model.Node, error)

GetNodeByID mocks base method.

func (*MockRepository) GetNodesPerPartition

func (m *MockRepository) GetNodesPerPartition(arg0 context.Context, arg1 string, arg2 NodeFilters) ([]*model.Node, error)

GetNodesPerPartition mocks base method.

func (*MockRepository) GetPartitionByID

func (m *MockRepository) GetPartitionByID(arg0 context.Context, arg1 string) (*model.Partition, error)

GetPartitionByID mocks base method.

func (*MockRepository) GetQueue

func (m *MockRepository) GetQueue(arg0 context.Context, arg1 string) (*model.Queue, error)

GetQueue mocks base method.

func (*MockRepository) GetQueuesInPartition

func (m *MockRepository) GetQueuesInPartition(arg0 context.Context, arg1 string) ([]*model.Queue, error)

GetQueuesInPartition mocks base method.

func (*MockRepository) InsertAppHistory

func (m *MockRepository) InsertAppHistory(arg0 context.Context, arg1 *model.AppHistory) error

InsertAppHistory mocks base method.

func (*MockRepository) InsertApplication

func (m *MockRepository) InsertApplication(arg0 context.Context, arg1 *model.Application) error

InsertApplication mocks base method.

func (*MockRepository) InsertContainerHistory

func (m *MockRepository) InsertContainerHistory(arg0 context.Context, arg1 *model.ContainerHistory) error

InsertContainerHistory mocks base method.

func (*MockRepository) InsertNode

func (m *MockRepository) InsertNode(arg0 context.Context, arg1 *model.Node) error

InsertNode mocks base method.

func (*MockRepository) InsertPartition

func (m *MockRepository) InsertPartition(arg0 context.Context, arg1 *model.Partition) error

InsertPartition mocks base method.

func (*MockRepository) InsertQueue

func (m *MockRepository) InsertQueue(arg0 context.Context, arg1 *model.Queue) error

InsertQueue mocks base method.

func (*MockRepository) UpdateApplication

func (m *MockRepository) UpdateApplication(arg0 context.Context, arg1 *model.Application) error

UpdateApplication mocks base method.

func (*MockRepository) UpdateNode

func (m *MockRepository) UpdateNode(arg0 context.Context, arg1 *model.Node) error

UpdateNode mocks base method.

func (*MockRepository) UpdatePartition

func (m *MockRepository) UpdatePartition(arg0 context.Context, arg1 *model.Partition) error

UpdatePartition mocks base method.

func (*MockRepository) UpdateQueue

func (m *MockRepository) UpdateQueue(arg0 context.Context, arg1 *model.Queue) error

UpdateQueue mocks base method.

type MockRepositoryMockRecorder

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) DeleteApplicationsNotInIDs

func (mr *MockRepositoryMockRecorder) DeleteApplicationsNotInIDs(arg0, arg1, arg2 any) *gomock.Call

DeleteApplicationsNotInIDs indicates an expected call of DeleteApplicationsNotInIDs.

func (*MockRepositoryMockRecorder) DeleteNodesNotInIDs

func (mr *MockRepositoryMockRecorder) DeleteNodesNotInIDs(arg0, arg1, arg2 any) *gomock.Call

DeleteNodesNotInIDs indicates an expected call of DeleteNodesNotInIDs.

func (*MockRepositoryMockRecorder) DeletePartitionsNotInIDs

func (mr *MockRepositoryMockRecorder) DeletePartitionsNotInIDs(arg0, arg1, arg2 any) *gomock.Call

DeletePartitionsNotInIDs indicates an expected call of DeletePartitionsNotInIDs.

func (*MockRepositoryMockRecorder) DeleteQueuesNotInIDs

func (mr *MockRepositoryMockRecorder) DeleteQueuesNotInIDs(arg0, arg1, arg2 any) *gomock.Call

DeleteQueuesNotInIDs indicates an expected call of DeleteQueuesNotInIDs.

func (*MockRepositoryMockRecorder) GetAllApplications

func (mr *MockRepositoryMockRecorder) GetAllApplications(arg0, arg1 any) *gomock.Call

GetAllApplications indicates an expected call of GetAllApplications.

func (*MockRepositoryMockRecorder) GetAllPartitions

func (mr *MockRepositoryMockRecorder) GetAllPartitions(arg0, arg1 any) *gomock.Call

GetAllPartitions indicates an expected call of GetAllPartitions.

func (*MockRepositoryMockRecorder) GetAllQueues

func (mr *MockRepositoryMockRecorder) GetAllQueues(arg0 any) *gomock.Call

GetAllQueues indicates an expected call of GetAllQueues.

func (*MockRepositoryMockRecorder) GetApplicationByID

func (mr *MockRepositoryMockRecorder) GetApplicationByID(arg0, arg1 any) *gomock.Call

GetApplicationByID indicates an expected call of GetApplicationByID.

func (*MockRepositoryMockRecorder) GetApplicationsHistory

func (mr *MockRepositoryMockRecorder) GetApplicationsHistory(arg0, arg1 any) *gomock.Call

GetApplicationsHistory indicates an expected call of GetApplicationsHistory.

func (*MockRepositoryMockRecorder) GetAppsPerPartitionPerQueue

func (mr *MockRepositoryMockRecorder) GetAppsPerPartitionPerQueue(arg0, arg1, arg2, arg3 any) *gomock.Call

GetAppsPerPartitionPerQueue indicates an expected call of GetAppsPerPartitionPerQueue.

func (*MockRepositoryMockRecorder) GetContainersHistory

func (mr *MockRepositoryMockRecorder) GetContainersHistory(arg0, arg1 any) *gomock.Call

GetContainersHistory indicates an expected call of GetContainersHistory.

func (*MockRepositoryMockRecorder) GetNodeByID

func (mr *MockRepositoryMockRecorder) GetNodeByID(arg0, arg1 any) *gomock.Call

GetNodeByID indicates an expected call of GetNodeByID.

func (*MockRepositoryMockRecorder) GetNodesPerPartition

func (mr *MockRepositoryMockRecorder) GetNodesPerPartition(arg0, arg1, arg2 any) *gomock.Call

GetNodesPerPartition indicates an expected call of GetNodesPerPartition.

func (*MockRepositoryMockRecorder) GetPartitionByID

func (mr *MockRepositoryMockRecorder) GetPartitionByID(arg0, arg1 any) *gomock.Call

GetPartitionByID indicates an expected call of GetPartitionByID.

func (*MockRepositoryMockRecorder) GetQueue

func (mr *MockRepositoryMockRecorder) GetQueue(arg0, arg1 any) *gomock.Call

GetQueue indicates an expected call of GetQueue.

func (*MockRepositoryMockRecorder) GetQueuesInPartition

func (mr *MockRepositoryMockRecorder) GetQueuesInPartition(arg0, arg1 any) *gomock.Call

GetQueuesInPartition indicates an expected call of GetQueuesInPartition.

func (*MockRepositoryMockRecorder) InsertAppHistory

func (mr *MockRepositoryMockRecorder) InsertAppHistory(arg0, arg1 any) *gomock.Call

InsertAppHistory indicates an expected call of InsertAppHistory.

func (*MockRepositoryMockRecorder) InsertApplication

func (mr *MockRepositoryMockRecorder) InsertApplication(arg0, arg1 any) *gomock.Call

InsertApplication indicates an expected call of InsertApplication.

func (*MockRepositoryMockRecorder) InsertContainerHistory

func (mr *MockRepositoryMockRecorder) InsertContainerHistory(arg0, arg1 any) *gomock.Call

InsertContainerHistory indicates an expected call of InsertContainerHistory.

func (*MockRepositoryMockRecorder) InsertNode

func (mr *MockRepositoryMockRecorder) InsertNode(arg0, arg1 any) *gomock.Call

InsertNode indicates an expected call of InsertNode.

func (*MockRepositoryMockRecorder) InsertPartition

func (mr *MockRepositoryMockRecorder) InsertPartition(arg0, arg1 any) *gomock.Call

InsertPartition indicates an expected call of InsertPartition.

func (*MockRepositoryMockRecorder) InsertQueue

func (mr *MockRepositoryMockRecorder) InsertQueue(arg0, arg1 any) *gomock.Call

InsertQueue indicates an expected call of InsertQueue.

func (*MockRepositoryMockRecorder) UpdateApplication

func (mr *MockRepositoryMockRecorder) UpdateApplication(arg0, arg1 any) *gomock.Call

UpdateApplication indicates an expected call of UpdateApplication.

func (*MockRepositoryMockRecorder) UpdateNode

func (mr *MockRepositoryMockRecorder) UpdateNode(arg0, arg1 any) *gomock.Call

UpdateNode indicates an expected call of UpdateNode.

func (*MockRepositoryMockRecorder) UpdatePartition

func (mr *MockRepositoryMockRecorder) UpdatePartition(arg0, arg1 any) *gomock.Call

UpdatePartition indicates an expected call of UpdatePartition.

func (*MockRepositoryMockRecorder) UpdateQueue

func (mr *MockRepositoryMockRecorder) UpdateQueue(arg0, arg1 any) *gomock.Call

UpdateQueue indicates an expected call of UpdateQueue.

type NodeFilters

type NodeFilters struct {
	NodeId      *string
	HostName    *string
	RackName    *string
	Schedulable *bool
	IsReserved  *bool
	Offset      *int
	Limit       *int
}

type PartitionFilters

type PartitionFilters struct {
	LastStateTransitionTimeStart *time.Time
	LastStateTransitionTimeEnd   *time.Time
	Name                         *string
	ClusterID                    *string
	State                        *string
	Offset                       *int
	Limit                        *int
}

type PostgresRepository

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

func NewPostgresRepository

func NewPostgresRepository(pool *pgxpool.Pool) (*PostgresRepository, error)

func (*PostgresRepository) DeleteApplicationsNotInIDs

func (s *PostgresRepository) DeleteApplicationsNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error

func (*PostgresRepository) DeleteNodesNotInIDs

func (s *PostgresRepository) DeleteNodesNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error

func (*PostgresRepository) DeletePartitionsNotInIDs

func (s *PostgresRepository) DeletePartitionsNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error

func (*PostgresRepository) DeleteQueuesNotInIDs

func (s *PostgresRepository) DeleteQueuesNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error

func (*PostgresRepository) GetAllApplications

func (s *PostgresRepository) GetAllApplications(ctx context.Context, filters ApplicationFilters) ([]*model.Application, error)

func (*PostgresRepository) GetAllPartitions

func (s *PostgresRepository) GetAllPartitions(ctx context.Context, filters PartitionFilters) ([]*model.Partition, error)

func (*PostgresRepository) GetAllQueues

func (s *PostgresRepository) GetAllQueues(ctx context.Context) ([]*model.Queue, error)

func (*PostgresRepository) GetApplicationByID

func (s *PostgresRepository) GetApplicationByID(ctx context.Context, id string) (*model.Application, error)

func (*PostgresRepository) GetApplicationsHistory

func (r *PostgresRepository) GetApplicationsHistory(ctx context.Context, filters HistoryFilters) ([]*model.AppHistory, error)

func (*PostgresRepository) GetAppsPerPartitionPerQueue

func (s *PostgresRepository) GetAppsPerPartitionPerQueue(ctx context.Context, partitionID, queueID string, filters ApplicationFilters) ([]*model.Application, error)

func (*PostgresRepository) GetContainersHistory

func (r *PostgresRepository) GetContainersHistory(ctx context.Context, filters HistoryFilters) ([]*model.ContainerHistory, error)

func (*PostgresRepository) GetNodeByID

func (s *PostgresRepository) GetNodeByID(ctx context.Context, id string) (*model.Node, error)

func (*PostgresRepository) GetNodesPerPartition

func (s *PostgresRepository) GetNodesPerPartition(ctx context.Context, partitionID string, filters NodeFilters) ([]*model.Node, error)

func (*PostgresRepository) GetPartitionByID

func (s *PostgresRepository) GetPartitionByID(ctx context.Context, id string) (*model.Partition, error)

func (*PostgresRepository) GetQueue

func (s *PostgresRepository) GetQueue(ctx context.Context, queueID string) (*model.Queue, error)

func (*PostgresRepository) GetQueuesInPartition

func (s *PostgresRepository) GetQueuesInPartition(ctx context.Context, partitionID string) ([]*model.Queue, error)

func (*PostgresRepository) InsertAppHistory

func (r *PostgresRepository) InsertAppHistory(ctx context.Context, appHistory *model.AppHistory) error

func (*PostgresRepository) InsertApplication

func (s *PostgresRepository) InsertApplication(ctx context.Context, app *model.Application) error

func (*PostgresRepository) InsertContainerHistory

func (r *PostgresRepository) InsertContainerHistory(ctx context.Context, containerHistory *model.ContainerHistory) error

func (*PostgresRepository) InsertNode

func (s *PostgresRepository) InsertNode(ctx context.Context, node *model.Node) error

func (*PostgresRepository) InsertPartition

func (r *PostgresRepository) InsertPartition(ctx context.Context, partition *model.Partition) error

func (*PostgresRepository) InsertQueue

func (s *PostgresRepository) InsertQueue(ctx context.Context, q *model.Queue) error

func (*PostgresRepository) UpdateApplication

func (s *PostgresRepository) UpdateApplication(ctx context.Context, app *model.Application) error

func (*PostgresRepository) UpdateNode

func (s *PostgresRepository) UpdateNode(ctx context.Context, node *model.Node) error

func (*PostgresRepository) UpdatePartition

func (r *PostgresRepository) UpdatePartition(ctx context.Context, partition *model.Partition) error

func (*PostgresRepository) UpdateQueue

func (s *PostgresRepository) UpdateQueue(ctx context.Context, queue *model.Queue) error

type Repository

type Repository interface {
	InsertApplication(ctx context.Context, app *model.Application) error
	UpdateApplication(ctx context.Context, app *model.Application) error
	GetApplicationByID(ctx context.Context, id string) (*model.Application, error)
	DeleteApplicationsNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error
	GetAllApplications(ctx context.Context, filters ApplicationFilters) ([]*model.Application, error)
	GetAppsPerPartitionPerQueue(ctx context.Context, partitionID, queueID string, filters ApplicationFilters) ([]*model.Application, error)
	InsertAppHistory(ctx context.Context, appHistory *model.AppHistory) error
	InsertContainerHistory(ctx context.Context, containerHistory *model.ContainerHistory) error
	GetApplicationsHistory(ctx context.Context, filters HistoryFilters) ([]*model.AppHistory, error)
	GetContainersHistory(ctx context.Context, filters HistoryFilters) ([]*model.ContainerHistory, error)
	InsertNode(ctx context.Context, node *model.Node) error
	UpdateNode(ctx context.Context, node *model.Node) error
	GetNodeByID(ctx context.Context, id string) (*model.Node, error)
	DeleteNodesNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error
	GetNodesPerPartition(ctx context.Context, partitionID string, filters NodeFilters) ([]*model.Node, error)
	InsertPartition(ctx context.Context, partition *model.Partition) error
	UpdatePartition(ctx context.Context, partition *model.Partition) error
	GetAllPartitions(ctx context.Context, filters PartitionFilters) ([]*model.Partition, error)
	GetPartitionByID(ctx context.Context, id string) (*model.Partition, error)
	DeletePartitionsNotInIDs(ctx context.Context, ids []string, deletedatNano int64) error
	InsertQueue(ctx context.Context, q *model.Queue) error
	GetQueue(ctx context.Context, queueID string) (*model.Queue, error)
	UpdateQueue(ctx context.Context, queue *model.Queue) error
	GetAllQueues(ctx context.Context) ([]*model.Queue, error)
	GetQueuesInPartition(ctx context.Context, partitionID string) ([]*model.Queue, error)
	DeleteQueuesNotInIDs(ctx context.Context, ids []string, deletedAtNano int64) error
}

Jump to

Keyboard shortcuts

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