dao

package
v0.0.0-...-a9d2b54 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const JoinSelectQuery = `` /* 269-byte string literal not displayed */

Variables

View Source
var DbInClauseLimit = 60000

Functions

func ApiFieldsToModel

func ApiFieldsToModel(apiRepo api.RepositoryRequest, repoConfig *models.RepositoryConfiguration, repo *models.Repository)

func DBErrorToApi

func DBErrorToApi(e error) *ce.DaoError

func FilteredConvert

func FilteredConvert(yumPkgs []yum.Package, excludeChecksums []string) []models.Rpm

FilteredConvert Given a list of yum.Package objects, it converts them to model.Rpm packages while filtering out any checksums that are in the excludedChecksums parameter

func FilteredConvertEnvironments

func FilteredConvertEnvironments(yumEnvironments []yum.Environment, excludedEnvs []string) []models.Environment

FilteredConvertEnvironments, given a list of yum.Environment objects, converts them to model.Environment while filtering out any envs that are in the excludedEnvs parameter

func FilteredConvertPackageGroups

func FilteredConvertPackageGroups(yumPkgGroups []yum.PackageGroup, excludedHashes []string) []models.PackageGroup

FilteredConvertPackageGroups Given a list of yum.PackageGroup objects, it converts them to model.PackageGroup while filtering out any groups with hashes in the excludedHashes parameter

func LoadGpgKey

func LoadGpgKey(gpgKey *string) (openpgp.EntityList, error)

func ModelToApiFields

func ModelToApiFields(repoConfig models.RepositoryConfiguration, apiRepo *api.RepositoryResponse)

func SetupGormTableOrFail

func SetupGormTableOrFail(db *gorm.DB)

SetupGormTableOrFail this is necessary to enable soft-delete on the deleted_at column of the template_repository_configurations table. More info here: https://gorm.io/docs/many_to_many.html#Customize-JoinTable

func UuidifyString

func UuidifyString(possibleUuid string) uuid2.UUID

func UuidifyStrings

func UuidifyStrings(possibleUuids []string) []uuid2.UUID

func ValidateSignature

func ValidateSignature(ctx context.Context, repo yum.YumRepository, gpgKey *string) error

Types

type AdminTaskDao

type AdminTaskDao interface {
	Fetch(ctx context.Context, id string) (api.AdminTaskInfoResponse, error)
	List(ctx context.Context, pageData api.PaginationData, filterData api.AdminTaskFilterData) (api.AdminTaskInfoCollectionResponse, int64, error)
}

func GetAdminTaskDao

func GetAdminTaskDao(db *gorm.DB, pulpClient pulp_client.PulpClient) AdminTaskDao

type DaoRegistry

type DaoRegistry struct {
	RepositoryConfig RepositoryConfigDao
	Rpm              RpmDao
	Repository       RepositoryDao
	Metrics          MetricsDao
	Snapshot         SnapshotDao
	TaskInfo         TaskInfoDao
	AdminTask        AdminTaskDao
	Domain           DomainDao
	PackageGroup     PackageGroupDao
	Environment      EnvironmentDao
	Template         TemplateDao
}

func GetDaoRegistry

func GetDaoRegistry(db *gorm.DB) *DaoRegistry

type DomainDao

type DomainDao interface {
	FetchOrCreateDomain(ctx context.Context, orgId string) (string, error)
	Fetch(ctx context.Context, orgId string) (string, error)
}

func GetDomainDao

func GetDomainDao(db *gorm.DB) DomainDao

type EnvironmentDao

type EnvironmentDao interface {
	List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryEnvironmentCollectionResponse, int64, error)
	Search(ctx context.Context, orgID string, request api.ContentUnitSearchRequest) ([]api.SearchEnvironmentResponse, error)
	InsertForRepository(ctx context.Context, repoUuid string, environments []yum.Environment) (int64, error)
	OrphanCleanup(ctx context.Context) error
	SearchSnapshotEnvironments(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchEnvironmentResponse, error)
}

func GetEnvironmentDao

func GetEnvironmentDao(db *gorm.DB) EnvironmentDao

type IntrospectionCount

type IntrospectionCount struct {
	Introspected int64
	Missed       int64
}

type ListRepoFilter

type ListRepoFilter struct {
	URLs       *[]string
	RedhatOnly *bool
}

type MetricsDao

type MetricsDao interface {
	RepositoriesCount(ctx context.Context) int
	RepositoryConfigsCount(ctx context.Context) int
	RepositoriesIntrospectionCount(ctx context.Context, hours int, public bool) IntrospectionCount
	PublicRepositoriesFailedIntrospectionCount(ctx context.Context) int
	OrganizationTotal(ctx context.Context) int64
	PendingTasksAverageLatency(ctx context.Context) float64
	PendingTasksCount(ctx context.Context) int64
	PendingTasksOldestTask(ctx context.Context) float64
}

func GetMetricsDao

func GetMetricsDao(db *gorm.DB) MetricsDao

type MockAdminTaskDao

type MockAdminTaskDao struct {
	mock.Mock
}

MockAdminTaskDao is an autogenerated mock type for the AdminTaskDao type

func NewMockAdminTaskDao

func NewMockAdminTaskDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAdminTaskDao

NewMockAdminTaskDao creates a new instance of MockAdminTaskDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAdminTaskDao) Fetch

Fetch provides a mock function with given fields: ctx, id

func (*MockAdminTaskDao) List

List provides a mock function with given fields: ctx, pageData, filterData

type MockDaoRegistry

type MockDaoRegistry struct {
	RepositoryConfig MockRepositoryConfigDao
	Rpm              MockRpmDao
	Repository       MockRepositoryDao
	Metrics          MockMetricsDao
	Snapshot         MockSnapshotDao
	TaskInfo         MockTaskInfoDao
	AdminTask        MockAdminTaskDao
	Domain           MockDomainDao
	PackageGroup     MockPackageGroupDao
	Environment      MockEnvironmentDao
	Template         MockTemplateDao
}

func GetMockDaoRegistry

func GetMockDaoRegistry(t *testing.T) *MockDaoRegistry

func (*MockDaoRegistry) ToDaoRegistry

func (m *MockDaoRegistry) ToDaoRegistry() *DaoRegistry

type MockDomainDao

type MockDomainDao struct {
	mock.Mock
}

MockDomainDao is an autogenerated mock type for the DomainDao type

func NewMockDomainDao

func NewMockDomainDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockDomainDao

NewMockDomainDao creates a new instance of MockDomainDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockDomainDao) Fetch

func (_m *MockDomainDao) Fetch(ctx context.Context, orgId string) (string, error)

Fetch provides a mock function with given fields: ctx, orgId

func (*MockDomainDao) FetchOrCreateDomain

func (_m *MockDomainDao) FetchOrCreateDomain(ctx context.Context, orgId string) (string, error)

FetchOrCreateDomain provides a mock function with given fields: ctx, orgId

type MockEnvironmentDao

type MockEnvironmentDao struct {
	mock.Mock
}

MockEnvironmentDao is an autogenerated mock type for the EnvironmentDao type

func NewMockEnvironmentDao

func NewMockEnvironmentDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockEnvironmentDao

NewMockEnvironmentDao creates a new instance of MockEnvironmentDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockEnvironmentDao) InsertForRepository

func (_m *MockEnvironmentDao) InsertForRepository(ctx context.Context, repoUuid string, environments []yum.Environment) (int64, error)

InsertForRepository provides a mock function with given fields: ctx, repoUuid, environments

func (*MockEnvironmentDao) List

func (_m *MockEnvironmentDao) List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryEnvironmentCollectionResponse, int64, error)

List provides a mock function with given fields: ctx, orgID, uuidRepo, limit, offset, search, sortBy

func (*MockEnvironmentDao) OrphanCleanup

func (_m *MockEnvironmentDao) OrphanCleanup(ctx context.Context) error

OrphanCleanup provides a mock function with given fields: ctx

func (*MockEnvironmentDao) Search

Search provides a mock function with given fields: ctx, orgID, request

func (*MockEnvironmentDao) SearchSnapshotEnvironments

func (_m *MockEnvironmentDao) SearchSnapshotEnvironments(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchEnvironmentResponse, error)

SearchSnapshotEnvironments provides a mock function with given fields: ctx, orgId, request

type MockMetricsDao

type MockMetricsDao struct {
	mock.Mock
}

MockMetricsDao is an autogenerated mock type for the MetricsDao type

func NewMockMetricsDao

func NewMockMetricsDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockMetricsDao

NewMockMetricsDao creates a new instance of MockMetricsDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockMetricsDao) OrganizationTotal

func (_m *MockMetricsDao) OrganizationTotal(ctx context.Context) int64

OrganizationTotal provides a mock function with given fields: ctx

func (*MockMetricsDao) PendingTasksAverageLatency

func (_m *MockMetricsDao) PendingTasksAverageLatency(ctx context.Context) float64

PendingTasksAverageLatency provides a mock function with given fields: ctx

func (*MockMetricsDao) PendingTasksCount

func (_m *MockMetricsDao) PendingTasksCount(ctx context.Context) int64

PendingTasksCount provides a mock function with given fields: ctx

func (*MockMetricsDao) PendingTasksOldestTask

func (_m *MockMetricsDao) PendingTasksOldestTask(ctx context.Context) float64

PendingTasksOldestTask provides a mock function with given fields: ctx

func (*MockMetricsDao) PublicRepositoriesFailedIntrospectionCount

func (_m *MockMetricsDao) PublicRepositoriesFailedIntrospectionCount(ctx context.Context) int

PublicRepositoriesFailedIntrospectionCount provides a mock function with given fields: ctx

func (*MockMetricsDao) RepositoriesCount

func (_m *MockMetricsDao) RepositoriesCount(ctx context.Context) int

RepositoriesCount provides a mock function with given fields: ctx

func (*MockMetricsDao) RepositoriesIntrospectionCount

func (_m *MockMetricsDao) RepositoriesIntrospectionCount(ctx context.Context, hours int, public bool) IntrospectionCount

RepositoriesIntrospectionCount provides a mock function with given fields: ctx, hours, public

func (*MockMetricsDao) RepositoryConfigsCount

func (_m *MockMetricsDao) RepositoryConfigsCount(ctx context.Context) int

RepositoryConfigsCount provides a mock function with given fields: ctx

type MockPackageGroupDao

type MockPackageGroupDao struct {
	mock.Mock
}

MockPackageGroupDao is an autogenerated mock type for the PackageGroupDao type

func NewMockPackageGroupDao

func NewMockPackageGroupDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPackageGroupDao

NewMockPackageGroupDao creates a new instance of MockPackageGroupDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPackageGroupDao) InsertForRepository

func (_m *MockPackageGroupDao) InsertForRepository(ctx context.Context, repoUuid string, pkgGroups []yum.PackageGroup) (int64, error)

InsertForRepository provides a mock function with given fields: ctx, repoUuid, pkgGroups

func (*MockPackageGroupDao) List

func (_m *MockPackageGroupDao) List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryPackageGroupCollectionResponse, int64, error)

List provides a mock function with given fields: ctx, orgID, uuidRepo, limit, offset, search, sortBy

func (*MockPackageGroupDao) OrphanCleanup

func (_m *MockPackageGroupDao) OrphanCleanup(ctx context.Context) error

OrphanCleanup provides a mock function with given fields: ctx

func (*MockPackageGroupDao) Search

Search provides a mock function with given fields: ctx, orgID, request

func (*MockPackageGroupDao) SearchSnapshotPackageGroups

func (_m *MockPackageGroupDao) SearchSnapshotPackageGroups(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchPackageGroupResponse, error)

SearchSnapshotPackageGroups provides a mock function with given fields: ctx, orgId, request

type MockRepositoryConfigDao

type MockRepositoryConfigDao struct {
	mock.Mock
}

MockRepositoryConfigDao is an autogenerated mock type for the RepositoryConfigDao type

func NewMockRepositoryConfigDao

func NewMockRepositoryConfigDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRepositoryConfigDao

NewMockRepositoryConfigDao creates a new instance of MockRepositoryConfigDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRepositoryConfigDao) BulkCreate

func (_m *MockRepositoryConfigDao) BulkCreate(ctx context.Context, newRepositories []api.RepositoryRequest) ([]api.RepositoryResponse, []error)

BulkCreate provides a mock function with given fields: ctx, newRepositories

func (*MockRepositoryConfigDao) BulkDelete

func (_m *MockRepositoryConfigDao) BulkDelete(ctx context.Context, orgID string, uuids []string) []error

BulkDelete provides a mock function with given fields: ctx, orgID, uuids

func (*MockRepositoryConfigDao) Create

Create provides a mock function with given fields: ctx, newRepo

func (*MockRepositoryConfigDao) Delete

func (_m *MockRepositoryConfigDao) Delete(ctx context.Context, orgID string, uuid string) error

Delete provides a mock function with given fields: ctx, orgID, uuid

func (*MockRepositoryConfigDao) Fetch

Fetch provides a mock function with given fields: ctx, orgID, uuid

func (*MockRepositoryConfigDao) FetchByRepoUuid

func (_m *MockRepositoryConfigDao) FetchByRepoUuid(ctx context.Context, orgID string, repoUuid string) (api.RepositoryResponse, error)

FetchByRepoUuid provides a mock function with given fields: ctx, orgID, repoUuid

func (*MockRepositoryConfigDao) FetchWithoutOrgID

func (_m *MockRepositoryConfigDao) FetchWithoutOrgID(ctx context.Context, uuid string) (api.RepositoryResponse, error)

FetchWithoutOrgID provides a mock function with given fields: ctx, uuid

func (*MockRepositoryConfigDao) InternalOnly_FetchRepoConfigsForRepoUUID

func (_m *MockRepositoryConfigDao) InternalOnly_FetchRepoConfigsForRepoUUID(ctx context.Context, uuid string) []api.RepositoryResponse

InternalOnly_FetchRepoConfigsForRepoUUID provides a mock function with given fields: ctx, uuid

func (*MockRepositoryConfigDao) InternalOnly_ListReposToSnapshot

func (_m *MockRepositoryConfigDao) InternalOnly_ListReposToSnapshot(ctx context.Context, filter *ListRepoFilter) ([]models.RepositoryConfiguration, error)

InternalOnly_ListReposToSnapshot provides a mock function with given fields: ctx, filter

func (*MockRepositoryConfigDao) InternalOnly_RefreshRedHatRepo

func (_m *MockRepositoryConfigDao) InternalOnly_RefreshRedHatRepo(ctx context.Context, request api.RepositoryRequest, label string) (*api.RepositoryResponse, error)

InternalOnly_RefreshRedHatRepo provides a mock function with given fields: ctx, request, label

func (*MockRepositoryConfigDao) List

List provides a mock function with given fields: ctx, orgID, paginationData, filterData

func (*MockRepositoryConfigDao) SavePublicRepos

func (_m *MockRepositoryConfigDao) SavePublicRepos(ctx context.Context, urls []string) error

SavePublicRepos provides a mock function with given fields: ctx, urls

func (*MockRepositoryConfigDao) SoftDelete

func (_m *MockRepositoryConfigDao) SoftDelete(ctx context.Context, orgID string, uuid string) error

SoftDelete provides a mock function with given fields: ctx, orgID, uuid

func (*MockRepositoryConfigDao) Update

func (_m *MockRepositoryConfigDao) Update(ctx context.Context, orgID string, uuid string, repoParams api.RepositoryRequest) (bool, error)

Update provides a mock function with given fields: ctx, orgID, uuid, repoParams

func (*MockRepositoryConfigDao) UpdateLastSnapshotTask

func (_m *MockRepositoryConfigDao) UpdateLastSnapshotTask(ctx context.Context, taskUUID string, orgID string, repoUUID string) error

UpdateLastSnapshotTask provides a mock function with given fields: ctx, taskUUID, orgID, repoUUID

func (*MockRepositoryConfigDao) ValidateParameters

func (_m *MockRepositoryConfigDao) ValidateParameters(ctx context.Context, orgId string, params api.RepositoryValidationRequest, excludedUUIDS []string) (api.RepositoryValidationResponse, error)

ValidateParameters provides a mock function with given fields: ctx, orgId, params, excludedUUIDS

func (*MockRepositoryConfigDao) WithContextMock

func (m *MockRepositoryConfigDao) WithContextMock() *MockRepositoryConfigDao

type MockRepositoryDao

type MockRepositoryDao struct {
	mock.Mock
}

MockRepositoryDao is an autogenerated mock type for the RepositoryDao type

func NewMockRepositoryDao

func NewMockRepositoryDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRepositoryDao

NewMockRepositoryDao creates a new instance of MockRepositoryDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRepositoryDao) FetchForUrl

func (_m *MockRepositoryDao) FetchForUrl(ctx context.Context, url string) (Repository, error)

FetchForUrl provides a mock function with given fields: ctx, url

func (*MockRepositoryDao) FetchRepositoryRPMCount

func (_m *MockRepositoryDao) FetchRepositoryRPMCount(ctx context.Context, repoUUID string) (int, error)

FetchRepositoryRPMCount provides a mock function with given fields: ctx, repoUUID

func (*MockRepositoryDao) ListForIntrospection

func (_m *MockRepositoryDao) ListForIntrospection(ctx context.Context, urls *[]string, force bool) ([]Repository, error)

ListForIntrospection provides a mock function with given fields: ctx, urls, force

func (*MockRepositoryDao) ListPublic

ListPublic provides a mock function with given fields: ctx, paginationData, _a2

func (*MockRepositoryDao) OrphanCleanup

func (_m *MockRepositoryDao) OrphanCleanup(ctx context.Context) error

OrphanCleanup provides a mock function with given fields: ctx

func (*MockRepositoryDao) Update

func (_m *MockRepositoryDao) Update(ctx context.Context, repo RepositoryUpdate) error

Update provides a mock function with given fields: ctx, repo

type MockRpmDao

type MockRpmDao struct {
	mock.Mock
}

MockRpmDao is an autogenerated mock type for the RpmDao type

func NewMockRpmDao

func NewMockRpmDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRpmDao

NewMockRpmDao creates a new instance of MockRpmDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRpmDao) DetectRpms

func (_m *MockRpmDao) DetectRpms(ctx context.Context, orgID string, request api.DetectRpmsRequest) (*api.DetectRpmsResponse, error)

DetectRpms provides a mock function with given fields: ctx, orgID, request

func (*MockRpmDao) InsertForRepository

func (_m *MockRpmDao) InsertForRepository(ctx context.Context, repoUuid string, pkgs []yum.Package) (int64, error)

InsertForRepository provides a mock function with given fields: ctx, repoUuid, pkgs

func (*MockRpmDao) List

func (_m *MockRpmDao) List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryRpmCollectionResponse, int64, error)

List provides a mock function with given fields: ctx, orgID, uuidRepo, limit, offset, search, sortBy

func (*MockRpmDao) ListSnapshotErrata

func (_m *MockRpmDao) ListSnapshotErrata(ctx context.Context, orgId string, snapshotUUIDs []string, filters tangy.ErrataListFilters, pageOpts api.PaginationData) ([]api.SnapshotErrata, int, error)

ListSnapshotErrata provides a mock function with given fields: ctx, orgId, snapshotUUIDs, filters, pageOpts

func (*MockRpmDao) ListSnapshotRpms

func (_m *MockRpmDao) ListSnapshotRpms(ctx context.Context, orgId string, snapshotUUIDs []string, search string, pageOpts api.PaginationData) ([]api.SnapshotRpm, int, error)

ListSnapshotRpms provides a mock function with given fields: ctx, orgId, snapshotUUIDs, search, pageOpts

func (*MockRpmDao) ListTemplateRpms

func (_m *MockRpmDao) ListTemplateRpms(ctx context.Context, orgId string, templateUUID string, search string, pageOpts api.PaginationData) ([]api.SnapshotRpm, int, error)

ListTemplateRpms provides a mock function with given fields: ctx, orgId, templateUUID, search, pageOpts

func (*MockRpmDao) OrphanCleanup

func (_m *MockRpmDao) OrphanCleanup(ctx context.Context) error

OrphanCleanup provides a mock function with given fields: ctx

func (*MockRpmDao) Search

Search provides a mock function with given fields: ctx, orgID, request

func (*MockRpmDao) SearchSnapshotRpms

func (_m *MockRpmDao) SearchSnapshotRpms(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchRpmResponse, error)

SearchSnapshotRpms provides a mock function with given fields: ctx, orgId, request

type MockSnapshotDao

type MockSnapshotDao struct {
	mock.Mock
}

MockSnapshotDao is an autogenerated mock type for the SnapshotDao type

func NewMockSnapshotDao

func NewMockSnapshotDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSnapshotDao

NewMockSnapshotDao creates a new instance of MockSnapshotDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockSnapshotDao) Create

func (_m *MockSnapshotDao) Create(ctx context.Context, snap *models.Snapshot) error

Create provides a mock function with given fields: ctx, snap

func (*MockSnapshotDao) Delete

func (_m *MockSnapshotDao) Delete(ctx context.Context, snapUUID string) error

Delete provides a mock function with given fields: ctx, snapUUID

func (*MockSnapshotDao) Fetch

Fetch provides a mock function with given fields: ctx, uuid

func (*MockSnapshotDao) FetchForRepoConfigUUID

func (_m *MockSnapshotDao) FetchForRepoConfigUUID(ctx context.Context, repoConfigUUID string) ([]models.Snapshot, error)

FetchForRepoConfigUUID provides a mock function with given fields: ctx, repoConfigUUID

func (*MockSnapshotDao) FetchLatestSnapshot

func (_m *MockSnapshotDao) FetchLatestSnapshot(ctx context.Context, repoConfigUUID string) (api.SnapshotResponse, error)

FetchLatestSnapshot provides a mock function with given fields: ctx, repoConfigUUID

func (*MockSnapshotDao) FetchSnapshotByVersionHref

func (_m *MockSnapshotDao) FetchSnapshotByVersionHref(ctx context.Context, repoConfigUUID string, versionHref string) (*api.SnapshotResponse, error)

FetchSnapshotByVersionHref provides a mock function with given fields: ctx, repoConfigUUID, versionHref

func (*MockSnapshotDao) FetchSnapshotsByDateAndRepository

func (_m *MockSnapshotDao) FetchSnapshotsByDateAndRepository(ctx context.Context, orgID string, request api.ListSnapshotByDateRequest) (api.ListSnapshotByDateResponse, error)

FetchSnapshotsByDateAndRepository provides a mock function with given fields: ctx, orgID, request

func (*MockSnapshotDao) FetchSnapshotsModelByDateAndRepository

func (_m *MockSnapshotDao) FetchSnapshotsModelByDateAndRepository(ctx context.Context, orgID string, request api.ListSnapshotByDateRequest) ([]models.Snapshot, error)

FetchSnapshotsModelByDateAndRepository provides a mock function with given fields: ctx, orgID, request

func (*MockSnapshotDao) GetRepositoryConfigurationFile

func (_m *MockSnapshotDao) GetRepositoryConfigurationFile(ctx context.Context, orgID string, snapshotUUID string, host string) (string, error)

GetRepositoryConfigurationFile provides a mock function with given fields: ctx, orgID, snapshotUUID, host

func (*MockSnapshotDao) List

func (_m *MockSnapshotDao) List(ctx context.Context, orgID string, repoConfigUuid string, paginationData api.PaginationData, filterData api.FilterData) (api.SnapshotCollectionResponse, int64, error)

List provides a mock function with given fields: ctx, orgID, repoConfigUuid, paginationData, filterData

func (*MockSnapshotDao) WithContextMock

func (m *MockSnapshotDao) WithContextMock() *MockSnapshotDao

type MockTaskInfoDao

type MockTaskInfoDao struct {
	mock.Mock
}

MockTaskInfoDao is an autogenerated mock type for the TaskInfoDao type

func NewMockTaskInfoDao

func NewMockTaskInfoDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockTaskInfoDao

NewMockTaskInfoDao creates a new instance of MockTaskInfoDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockTaskInfoDao) Cleanup

func (_m *MockTaskInfoDao) Cleanup(ctx context.Context) error

Cleanup provides a mock function with given fields: ctx

func (*MockTaskInfoDao) Fetch

func (_m *MockTaskInfoDao) Fetch(ctx context.Context, OrgID string, id string) (api.TaskInfoResponse, error)

Fetch provides a mock function with given fields: ctx, OrgID, id

func (*MockTaskInfoDao) IsSnapshotInProgress

func (_m *MockTaskInfoDao) IsSnapshotInProgress(ctx context.Context, orgID string, repoUUID string) (bool, error)

IsSnapshotInProgress provides a mock function with given fields: ctx, orgID, repoUUID

func (*MockTaskInfoDao) List

List provides a mock function with given fields: ctx, OrgID, pageData, filterData

type MockTemplateDao

type MockTemplateDao struct {
	mock.Mock
}

MockTemplateDao is an autogenerated mock type for the TemplateDao type

func NewMockTemplateDao

func NewMockTemplateDao(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockTemplateDao

NewMockTemplateDao creates a new instance of MockTemplateDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockTemplateDao) ClearDeletedAt

func (_m *MockTemplateDao) ClearDeletedAt(ctx context.Context, orgID string, uuid string) error

ClearDeletedAt provides a mock function with given fields: ctx, orgID, uuid

func (*MockTemplateDao) Create

func (_m *MockTemplateDao) Create(ctx context.Context, templateRequest api.TemplateRequest) (api.TemplateResponse, error)

Create provides a mock function with given fields: ctx, templateRequest

func (*MockTemplateDao) Delete

func (_m *MockTemplateDao) Delete(ctx context.Context, orgID string, uuid string) error

Delete provides a mock function with given fields: ctx, orgID, uuid

func (*MockTemplateDao) DeleteTemplateRepoConfigs

func (_m *MockTemplateDao) DeleteTemplateRepoConfigs(tctx context.Context, templateUUID string, keepRepoConfigUUIDs []string) error

DeleteTemplateRepoConfigs provides a mock function with given fields: tctx, templateUUID, keepRepoConfigUUIDs

func (*MockTemplateDao) Fetch

func (_m *MockTemplateDao) Fetch(ctx context.Context, orgID string, uuid string) (api.TemplateResponse, error)

Fetch provides a mock function with given fields: ctx, orgID, uuid

func (*MockTemplateDao) GetDistributionHref

func (_m *MockTemplateDao) GetDistributionHref(ctx context.Context, templateUUID string, repoConfigUUID string) (string, error)

GetDistributionHref provides a mock function with given fields: ctx, templateUUID, repoConfigUUID

func (*MockTemplateDao) GetRepoChanges

func (_m *MockTemplateDao) GetRepoChanges(ctx context.Context, templateUUID string, newRepoConfigUUIDs []string) ([]string, []string, []string, []string, error)

GetRepoChanges provides a mock function with given fields: ctx, templateUUID, newRepoConfigUUIDs

func (*MockTemplateDao) InternalOnlyFetchByName

func (_m *MockTemplateDao) InternalOnlyFetchByName(ctx context.Context, name string) (models.Template, error)

InternalOnlyFetchByName provides a mock function with given fields: ctx, name

func (*MockTemplateDao) List

List provides a mock function with given fields: ctx, orgID, paginationData, filterData

func (*MockTemplateDao) SoftDelete

func (_m *MockTemplateDao) SoftDelete(ctx context.Context, orgID string, uuid string) error

SoftDelete provides a mock function with given fields: ctx, orgID, uuid

func (*MockTemplateDao) Update

func (_m *MockTemplateDao) Update(ctx context.Context, orgID string, uuid string, templParams api.TemplateUpdateRequest) (api.TemplateResponse, error)

Update provides a mock function with given fields: ctx, orgID, uuid, templParams

func (*MockTemplateDao) UpdateDistributionHrefs

func (_m *MockTemplateDao) UpdateDistributionHrefs(ctx context.Context, templateUUID string, repoUUIDs []string, repoDistributionMap map[string]string) error

UpdateDistributionHrefs provides a mock function with given fields: ctx, templateUUID, repoUUIDs, repoDistributionMap

type PackageGroupDao

type PackageGroupDao interface {
	List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryPackageGroupCollectionResponse, int64, error)
	Search(ctx context.Context, orgID string, request api.ContentUnitSearchRequest) ([]api.SearchPackageGroupResponse, error)
	InsertForRepository(ctx context.Context, repoUuid string, pkgGroups []yum.PackageGroup) (int64, error)
	OrphanCleanup(ctx context.Context) error
	SearchSnapshotPackageGroups(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchPackageGroupResponse, error)
}

func GetPackageGroupDao

func GetPackageGroupDao(db *gorm.DB) PackageGroupDao

type Repository

type Repository struct {
	UUID                         string
	URL                          string
	Public                       bool
	RepomdChecksum               string
	LastIntrospectionTime        *time.Time
	LastIntrospectionSuccessTime *time.Time
	LastIntrospectionUpdateTime  *time.Time
	LastIntrospectionError       *string
	LastIntrospectionStatus      string
	PackageCount                 int
	FailedIntrospectionsCount    int
}

Repository internal (non-user facing) representation of a repository

type RepositoryConfigDao

type RepositoryConfigDao interface {
	Create(ctx context.Context, newRepo api.RepositoryRequest) (api.RepositoryResponse, error)
	BulkCreate(ctx context.Context, newRepositories []api.RepositoryRequest) ([]api.RepositoryResponse, []error)
	Update(ctx context.Context, orgID, uuid string, repoParams api.RepositoryRequest) (bool, error)
	Fetch(ctx context.Context, orgID string, uuid string) (api.RepositoryResponse, error)
	InternalOnly_ListReposToSnapshot(ctx context.Context, filter *ListRepoFilter) ([]models.RepositoryConfiguration, error)
	List(ctx context.Context, orgID string, paginationData api.PaginationData, filterData api.FilterData) (api.RepositoryCollectionResponse, int64, error)
	Delete(ctx context.Context, orgID string, uuid string) error
	SoftDelete(ctx context.Context, orgID string, uuid string) error
	BulkDelete(ctx context.Context, orgID string, uuids []string) []error
	SavePublicRepos(ctx context.Context, urls []string) error
	ValidateParameters(ctx context.Context, orgId string, params api.RepositoryValidationRequest, excludedUUIDS []string) (api.RepositoryValidationResponse, error)
	FetchByRepoUuid(ctx context.Context, orgID string, repoUuid string) (api.RepositoryResponse, error)
	InternalOnly_FetchRepoConfigsForRepoUUID(ctx context.Context, uuid string) []api.RepositoryResponse
	UpdateLastSnapshotTask(ctx context.Context, taskUUID string, orgID string, repoUUID string) error
	InternalOnly_RefreshRedHatRepo(ctx context.Context, request api.RepositoryRequest, label string) (*api.RepositoryResponse, error)
	FetchWithoutOrgID(ctx context.Context, uuid string) (api.RepositoryResponse, error)
}

func GetRepositoryConfigDao

func GetRepositoryConfigDao(db *gorm.DB, pulpClient pulp_client.PulpClient) RepositoryConfigDao

type RepositoryDao

type RepositoryDao interface {
	FetchForUrl(ctx context.Context, url string) (Repository, error)
	ListForIntrospection(ctx context.Context, urls *[]string, force bool) ([]Repository, error)
	ListPublic(ctx context.Context, paginationData api.PaginationData, _ api.FilterData) (api.PublicRepositoryCollectionResponse, int64, error)
	Update(ctx context.Context, repo RepositoryUpdate) error
	FetchRepositoryRPMCount(ctx context.Context, repoUUID string) (int, error)
	OrphanCleanup(ctx context.Context) error
}

func GetRepositoryDao

func GetRepositoryDao(db *gorm.DB) RepositoryDao

type RepositoryUpdate

type RepositoryUpdate struct {
	UUID                         string
	URL                          *string
	Public                       *bool
	RepomdChecksum               *string
	LastIntrospectionTime        *time.Time
	LastIntrospectionSuccessTime *time.Time
	LastIntrospectionUpdateTime  *time.Time
	LastIntrospectionError       *string
	LastIntrospectionStatus      *string
	PackageCount                 *int
	FailedIntrospectionsCount    *int
}

RepositoryUpdate internal representation of repository, nil field value means do not change

type RpmDao

type RpmDao interface {
	List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryRpmCollectionResponse, int64, error)
	Search(ctx context.Context, orgID string, request api.ContentUnitSearchRequest) ([]api.SearchRpmResponse, error)
	SearchSnapshotRpms(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchRpmResponse, error)
	ListSnapshotRpms(ctx context.Context, orgId string, snapshotUUIDs []string, search string, pageOpts api.PaginationData) ([]api.SnapshotRpm, int, error)
	DetectRpms(ctx context.Context, orgID string, request api.DetectRpmsRequest) (*api.DetectRpmsResponse, error)
	ListSnapshotErrata(ctx context.Context, orgId string, snapshotUUIDs []string, filters tangy.ErrataListFilters, pageOpts api.PaginationData) ([]api.SnapshotErrata, int, error)
	InsertForRepository(ctx context.Context, repoUuid string, pkgs []yum.Package) (int64, error)
	OrphanCleanup(ctx context.Context) error
	ListTemplateRpms(ctx context.Context, orgId string, templateUUID string, search string, pageOpts api.PaginationData) ([]api.SnapshotRpm, int, error)
}

func GetRpmDao

func GetRpmDao(db *gorm.DB) RpmDao

type SnapshotDao

type SnapshotDao interface {
	Create(ctx context.Context, snap *models.Snapshot) error
	List(ctx context.Context, orgID string, repoConfigUuid string, paginationData api.PaginationData, filterData api.FilterData) (api.SnapshotCollectionResponse, int64, error)
	FetchForRepoConfigUUID(ctx context.Context, repoConfigUUID string) ([]models.Snapshot, error)
	Delete(ctx context.Context, snapUUID string) error
	FetchLatestSnapshot(ctx context.Context, repoConfigUUID string) (api.SnapshotResponse, error)
	FetchSnapshotsByDateAndRepository(ctx context.Context, orgID string, request api.ListSnapshotByDateRequest) (api.ListSnapshotByDateResponse, error)
	FetchSnapshotByVersionHref(ctx context.Context, repoConfigUUID string, versionHref string) (*api.SnapshotResponse, error)
	GetRepositoryConfigurationFile(ctx context.Context, orgID, snapshotUUID, host string) (string, error)
	Fetch(ctx context.Context, uuid string) (api.SnapshotResponse, error)
	FetchSnapshotsModelByDateAndRepository(ctx context.Context, orgID string, request api.ListSnapshotByDateRequest) ([]models.Snapshot, error)
}

func GetSnapshotDao

func GetSnapshotDao(db *gorm.DB) SnapshotDao

type TaskInfoDao

type TaskInfoDao interface {
	Fetch(ctx context.Context, OrgID string, id string) (api.TaskInfoResponse, error)
	List(ctx context.Context, OrgID string, pageData api.PaginationData, filterData api.TaskInfoFilterData) (api.TaskInfoCollectionResponse, int64, error)
	IsSnapshotInProgress(ctx context.Context, orgID, repoUUID string) (bool, error)
	Cleanup(ctx context.Context) error
}

func GetTaskInfoDao

func GetTaskInfoDao(db *gorm.DB) TaskInfoDao

type TemplateDao

type TemplateDao interface {
	Create(ctx context.Context, templateRequest api.TemplateRequest) (api.TemplateResponse, error)
	Fetch(ctx context.Context, orgID string, uuid string) (api.TemplateResponse, error)
	InternalOnlyFetchByName(ctx context.Context, name string) (models.Template, error)
	List(ctx context.Context, orgID string, paginationData api.PaginationData, filterData api.TemplateFilterData) (api.TemplateCollectionResponse, int64, error)
	SoftDelete(ctx context.Context, orgID string, uuid string) error
	Delete(ctx context.Context, orgID string, uuid string) error
	ClearDeletedAt(ctx context.Context, orgID string, uuid string) error
	Update(ctx context.Context, orgID string, uuid string, templParams api.TemplateUpdateRequest) (api.TemplateResponse, error)
	GetRepoChanges(ctx context.Context, templateUUID string, newRepoConfigUUIDs []string) ([]string, []string, []string, []string, error)
	GetDistributionHref(ctx context.Context, templateUUID string, repoConfigUUID string) (string, error)
	UpdateDistributionHrefs(ctx context.Context, templateUUID string, repoUUIDs []string, repoDistributionMap map[string]string) error
	DeleteTemplateRepoConfigs(tctx context.Context, templateUUID string, keepRepoConfigUUIDs []string) error
}

Jump to

Keyboard shortcuts

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