dao

package
v0.0.0-...-1d32ba8 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

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(repo yum.YumRepository, gpgKey *string) error

Types

type AdminTaskDao

type AdminTaskDao interface {
	Fetch(id string) (api.AdminTaskInfoResponse, error)
	List(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(orgId string) (string, error)
	Fetch(orgId string) (string, error)
}

func GetDomainDao

func GetDomainDao(db *gorm.DB) DomainDao

type EnvironmentDao

type EnvironmentDao interface {
	List(orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryEnvironmentCollectionResponse, int64, error)
	Search(orgID string, request api.ContentUnitSearchRequest) ([]api.SearchEnvironmentResponse, error)
	InsertForRepository(repoUuid string, environments []yum.Environment) (int64, error)
	OrphanCleanup() 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() int
	RepositoryConfigsCount() int
	RepositoriesIntrospectionCount(hours int, public bool) IntrospectionCount
	PublicRepositoriesFailedIntrospectionCount() int
	OrganizationTotal() int64
}

func GetMetricsDao

func GetMetricsDao(db *gorm.DB) MetricsDao

type MockAdminTaskDao

type MockAdminTaskDao struct {
	mock.Mock
}

AdminTaskDao is an autogenerated mock type for the AdminTaskDao type

func NewMockAdminTaskDao

func NewMockAdminTaskDao(t mockConstructorTestingTNewAdminTaskDao) *MockAdminTaskDao

NewAdminTaskDao creates a new instance of AdminTaskDao. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockAdminTaskDao) Fetch

Fetch provides a mock function with given fields: id

func (*MockAdminTaskDao) List

List provides a mock function with given fields: 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(orgId string) (string, error)

Fetch provides a mock function with given fields: orgId

func (*MockDomainDao) FetchOrCreateDomain

func (_m *MockDomainDao) FetchOrCreateDomain(orgId string) (string, error)

FetchOrCreateDomain provides a mock function with given fields: 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(repoUuid string, environments []yum.Environment) (int64, error)

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

func (*MockEnvironmentDao) List

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

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

func (*MockEnvironmentDao) OrphanCleanup

func (_m *MockEnvironmentDao) OrphanCleanup() error

OrphanCleanup provides a mock function with given fields:

func (*MockEnvironmentDao) Search

Search provides a mock function with given fields: 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() int64

OrganizationTotal provides a mock function with given fields:

func (*MockMetricsDao) PublicRepositoriesFailedIntrospectionCount

func (_m *MockMetricsDao) PublicRepositoriesFailedIntrospectionCount() int

PublicRepositoriesFailedIntrospectionCount provides a mock function with given fields:

func (*MockMetricsDao) RepositoriesCount

func (_m *MockMetricsDao) RepositoriesCount() int

RepositoriesCount provides a mock function with given fields:

func (*MockMetricsDao) RepositoriesIntrospectionCount

func (_m *MockMetricsDao) RepositoriesIntrospectionCount(hours int, public bool) IntrospectionCount

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

func (*MockMetricsDao) RepositoryConfigsCount

func (_m *MockMetricsDao) RepositoryConfigsCount() int

RepositoryConfigsCount provides a mock function with given fields:

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(repoUuid string, pkgGroups []yum.PackageGroup) (int64, error)

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

func (*MockPackageGroupDao) List

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

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

func (*MockPackageGroupDao) OrphanCleanup

func (_m *MockPackageGroupDao) OrphanCleanup() error

OrphanCleanup provides a mock function with given fields:

func (*MockPackageGroupDao) Search

Search provides a mock function with given fields: 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(newRepositories []api.RepositoryRequest) ([]api.RepositoryResponse, []error)

BulkCreate provides a mock function with given fields: newRepositories

func (*MockRepositoryConfigDao) BulkDelete

func (_m *MockRepositoryConfigDao) BulkDelete(orgID string, uuids []string) []error

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

func (*MockRepositoryConfigDao) Create

Create provides a mock function with given fields: newRepo

func (*MockRepositoryConfigDao) Delete

func (_m *MockRepositoryConfigDao) Delete(orgID string, uuid string) error

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

func (*MockRepositoryConfigDao) Fetch

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

func (*MockRepositoryConfigDao) FetchByRepoUuid

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

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

func (*MockRepositoryConfigDao) FetchWithoutOrgID

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

FetchWithoutOrgID provides a mock function with given fields: uuid

func (*MockRepositoryConfigDao) InternalOnly_FetchRepoConfigsForRepoUUID

func (_m *MockRepositoryConfigDao) InternalOnly_FetchRepoConfigsForRepoUUID(uuid string) []api.RepositoryResponse

InternalOnly_FetchRepoConfigsForRepoUUID provides a mock function with given fields: uuid

func (*MockRepositoryConfigDao) InternalOnly_ListReposToSnapshot

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

InternalOnly_ListReposToSnapshot provides a mock function with given fields: filter

func (*MockRepositoryConfigDao) InternalOnly_RefreshRedHatRepo

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

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

func (*MockRepositoryConfigDao) List

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

func (*MockRepositoryConfigDao) SavePublicRepos

func (_m *MockRepositoryConfigDao) SavePublicRepos(urls []string) error

SavePublicRepos provides a mock function with given fields: urls

func (*MockRepositoryConfigDao) SoftDelete

func (_m *MockRepositoryConfigDao) SoftDelete(orgID string, uuid string) error

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

func (*MockRepositoryConfigDao) Update

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

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

func (*MockRepositoryConfigDao) UpdateLastSnapshotTask

func (_m *MockRepositoryConfigDao) UpdateLastSnapshotTask(taskUUID string, orgID string, repoUUID string) error

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

func (*MockRepositoryConfigDao) ValidateParameters

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

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

func (*MockRepositoryConfigDao) WithContext

WithContext provides a mock function with given fields: ctx

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(url string) (Repository, error)

FetchForUrl provides a mock function with given fields: url

func (*MockRepositoryDao) FetchRepositoryRPMCount

func (_m *MockRepositoryDao) FetchRepositoryRPMCount(repoUUID string) (int, error)

FetchRepositoryRPMCount provides a mock function with given fields: repoUUID

func (*MockRepositoryDao) ListForIntrospection

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

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

func (*MockRepositoryDao) ListPublic

ListPublic provides a mock function with given fields: paginationData, _a1

func (*MockRepositoryDao) OrphanCleanup

func (_m *MockRepositoryDao) OrphanCleanup() error

OrphanCleanup provides a mock function with given fields:

func (*MockRepositoryDao) Update

func (_m *MockRepositoryDao) Update(repo RepositoryUpdate) error

Update provides a mock function with given fields: 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(orgID string, request api.DetectRpmsRequest) (*api.DetectRpmsResponse, error)

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

func (*MockRpmDao) InsertForRepository

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

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

func (*MockRpmDao) List

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

List provides a mock function with given fields: 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) OrphanCleanup

func (_m *MockRpmDao) OrphanCleanup() error

OrphanCleanup provides a mock function with given fields:

func (*MockRpmDao) Search

func (_m *MockRpmDao) Search(orgID string, request api.ContentUnitSearchRequest) ([]api.SearchRpmResponse, error)

Search provides a mock function with given fields: 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(snap *models.Snapshot) error

Create provides a mock function with given fields: snap

func (*MockSnapshotDao) Delete

func (_m *MockSnapshotDao) Delete(snapUUID string) error

Delete provides a mock function with given fields: snapUUID

func (*MockSnapshotDao) Fetch

func (_m *MockSnapshotDao) Fetch(uuid string) (api.SnapshotResponse, error)

Fetch provides a mock function with given fields: uuid

func (*MockSnapshotDao) FetchForRepoConfigUUID

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

FetchForRepoConfigUUID provides a mock function with given fields: repoConfigUUID

func (*MockSnapshotDao) FetchLatestSnapshot

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

FetchLatestSnapshot provides a mock function with given fields: repoConfigUUID

func (*MockSnapshotDao) FetchSnapshotByVersionHref

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

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

func (*MockSnapshotDao) FetchSnapshotsByDateAndRepository

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

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

func (*MockSnapshotDao) FetchSnapshotsModelByDateAndRepository

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

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

func (*MockSnapshotDao) GetRepositoryConfigurationFile

func (_m *MockSnapshotDao) GetRepositoryConfigurationFile(orgID string, snapshotUUID string, host string) (string, error)

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

func (*MockSnapshotDao) List

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

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

func (*MockSnapshotDao) WithContext

func (_m *MockSnapshotDao) WithContext(ctx context.Context) SnapshotDao

WithContext provides a mock function with given fields: ctx

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() error

Cleanup provides a mock function with given fields:

func (*MockTaskInfoDao) Fetch

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

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

func (*MockTaskInfoDao) IsSnapshotInProgress

func (_m *MockTaskInfoDao) IsSnapshotInProgress(orgID string, repoUUID string) (bool, error)

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

func (*MockTaskInfoDao) List

List provides a mock function with given fields: 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(orgID string, uuid string) error

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

func (*MockTemplateDao) Create

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

Create provides a mock function with given fields: templateRequest

func (*MockTemplateDao) Delete

func (_m *MockTemplateDao) Delete(orgID string, uuid string) error

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

func (*MockTemplateDao) DeleteTemplateRepoConfigs

func (_m *MockTemplateDao) DeleteTemplateRepoConfigs(templateUUID string, keepRepoConfigUUIDs []string) error

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

func (*MockTemplateDao) Fetch

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

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

func (*MockTemplateDao) GetDistributionHref

func (_m *MockTemplateDao) GetDistributionHref(templateUUID string, repoConfigUUID string) (string, error)

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

func (*MockTemplateDao) GetRepoChanges

func (_m *MockTemplateDao) GetRepoChanges(templateUUID string, newRepoConfigUUIDs []string) ([]string, []string, []string, []string, error)

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

func (*MockTemplateDao) List

func (_m *MockTemplateDao) List(orgID string, paginationData api.PaginationData, filterData api.TemplateFilterData) (api.TemplateCollectionResponse, int64, error)

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

func (*MockTemplateDao) SoftDelete

func (_m *MockTemplateDao) SoftDelete(orgID string, uuid string) error

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

func (*MockTemplateDao) Update

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

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

func (*MockTemplateDao) UpdateDistributionHrefs

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

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

type PackageGroupDao

type PackageGroupDao interface {
	List(orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryPackageGroupCollectionResponse, int64, error)
	Search(orgID string, request api.ContentUnitSearchRequest) ([]api.SearchPackageGroupResponse, error)
	InsertForRepository(repoUuid string, pkgGroups []yum.PackageGroup) (int64, error)
	OrphanCleanup() 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(newRepo api.RepositoryRequest) (api.RepositoryResponse, error)
	BulkCreate(newRepositories []api.RepositoryRequest) ([]api.RepositoryResponse, []error)
	Update(orgID, uuid string, repoParams api.RepositoryRequest) (bool, error)
	Fetch(orgID string, uuid string) (api.RepositoryResponse, error)
	InternalOnly_ListReposToSnapshot(filter *ListRepoFilter) ([]models.RepositoryConfiguration, error)
	List(orgID string, paginationData api.PaginationData, filterData api.FilterData) (api.RepositoryCollectionResponse, int64, error)
	Delete(orgID string, uuid string) error
	SoftDelete(orgID string, uuid string) error
	BulkDelete(orgID string, uuids []string) []error
	SavePublicRepos(urls []string) error
	ValidateParameters(orgId string, params api.RepositoryValidationRequest, excludedUUIDS []string) (api.RepositoryValidationResponse, error)
	FetchByRepoUuid(orgID string, repoUuid string) (api.RepositoryResponse, error)
	InternalOnly_FetchRepoConfigsForRepoUUID(uuid string) []api.RepositoryResponse
	UpdateLastSnapshotTask(taskUUID string, orgID string, repoUUID string) error
	InternalOnly_RefreshRedHatRepo(request api.RepositoryRequest, label string) (*api.RepositoryResponse, error)
	WithContext(ctx context.Context) RepositoryConfigDao
	FetchWithoutOrgID(uuid string) (api.RepositoryResponse, error)
}

func GetRepositoryConfigDao

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

type RepositoryDao

type RepositoryDao interface {
	FetchForUrl(url string) (Repository, error)
	ListForIntrospection(urls *[]string, force bool) ([]Repository, error)
	ListPublic(paginationData api.PaginationData, _ api.FilterData) (api.PublicRepositoryCollectionResponse, int64, error)
	Update(repo RepositoryUpdate) error
	FetchRepositoryRPMCount(repoUUID string) (int, error)
	OrphanCleanup() 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(orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryRpmCollectionResponse, int64, error)
	Search(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(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(repoUuid string, pkgs []yum.Package) (int64, error)
	OrphanCleanup() error
}

func GetRpmDao

func GetRpmDao(db *gorm.DB) RpmDao

type SnapshotDao

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

func GetSnapshotDao

func GetSnapshotDao(db *gorm.DB) SnapshotDao

type TaskInfoDao

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

func GetTaskInfoDao

func GetTaskInfoDao(db *gorm.DB) TaskInfoDao

type TemplateDao

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

Jump to

Keyboard shortcuts

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