models

package
v0.0.0-...-dbd9094 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoverageDemandMatchStatusNone      = "none"
	CoverageDemandMatchStatusPartial   = "partial"
	CoverageDemandSourceProspectDriven = "prospect-driven"
)
View Source
const (
	CoverageMatchStatusExact   = "exact"
	CoverageMatchStatusPartial = "partial"
	CoverageMatchStatusNone    = "none"
)
View Source
const (
	UserPreferenceLightwellNotificationEnabled = "lightwell-notification-enabled"
	UserPreferenceLightwellNotificationMinimum = "lightwell-notification-minimum"
)

Valid user preference labels

View Source
const TableNameCoverageDemandSignals = "coverage_demand_signals"
View Source
const TableNameCoverageReportPackages = "coverage_report_packages"
View Source
const TableNameCoverageReports = "coverage_reports"
View Source
const TableNameCoverageUploads = "coverage_uploads"
View Source
const TableNameDomain = "domains"
View Source
const TableNameEnvironment = "environments"
View Source
const TableNameEnvironmentsRepositories = "repositories_environments"
View Source
const TableNameMavenPackages = "maven_packages"
View Source
const TableNameMemo = "memos"
View Source
const TableNameModuleStream = "module_streams"
View Source
const TableNamePackageGroup = "package_groups"
View Source
const TableNamePackageGroupsRepositories = "repositories_package_groups"
View Source
const TableNameRpm = "rpms"
View Source
const TableNameRpmsRepositories = "repositories_rpms"
View Source
const TableNameSnapshot = "snapshots"
View Source
const TableNameTemplatesRepositoryConfigurations = "templates_repository_configurations"
View Source
const TableNameUserPreferences = "user_preferences"

Variables

ValidUserPreferenceLabels is the set of accepted preference labels

View Source
var ValidUserPreferenceValues = map[string]map[string]bool{
	UserPreferenceLightwellNotificationEnabled: {
		"true":  true,
		"false": true,
	},
	UserPreferenceLightwellNotificationMinimum: {
		"critical": true,
		"high":     true,
		"medium":   true,
		"low":      true,
	},
}

ValidUserPreferenceValues maps labels to their accepted values. Labels with an empty set accept any non-empty value.

Functions

func CandlepinContentGpgKeyUrl

func CandlepinContentGpgKeyUrl(orgID string, repoConfigUUID string) *string

func CleanupURL

func CleanupURL(url string) string

CleanupURL removes leading and trailing whitespace and adds trailing slash

func ContentSummaryToContentCounts

func ContentSummaryToContentCounts(summary *zest.ContentSummaryResponse) (ContentCountsType, ContentCountsType, ContentCountsType)

func IsValidCoverageDemandMatchStatus

func IsValidCoverageDemandMatchStatus(status string) bool

func IsValidCoverageMatchStatus

func IsValidCoverageMatchStatus(status string) bool

func IsValidUserPreferenceLabel

func IsValidUserPreferenceLabel(label string) bool

IsValidUserPreferenceLabel reports whether label is an accepted preference label

func RepoConfigGpgKeyURL

func RepoConfigGpgKeyURL(orgID string, repoConfigUUID string) *string

func ValidateUserPreferenceValue

func ValidateUserPreferenceValue(label, value string) error

ValidateUserPreferenceValue checks that value is valid for the given label

Types

type Base

type Base struct {
	UUID      string `gorm:"primary_key" json:"uuid"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Base) AfterFind

func (base *Base) AfterFind(db *gorm.DB) error

func (*Base) AfterSave

func (base *Base) AfterSave(db *gorm.DB) error

func (*Base) BeforeCreate

func (base *Base) BeforeCreate(db *gorm.DB) (err error)

func (*Base) DeepCopy

func (in *Base) DeepCopy() *Base

func (*Base) DeepCopyInto

func (in *Base) DeepCopyInto(out *Base)

type ContentCountsType

type ContentCountsType map[string]int64

func (*ContentCountsType) Scan

func (cc *ContentCountsType) Scan(src interface{}) error

func (*ContentCountsType) Value

func (cc *ContentCountsType) Value() (driver.Value, error)

type CoverageDemandSignal

type CoverageDemandSignal struct {
	UUID        string    `json:"uuid" gorm:"primary_key;column:uuid"`
	CreatedAt   time.Time `json:"created_at" gorm:"not null"`
	Ecosystem   string    `json:"ecosystem" gorm:"not null"`
	Name        string    `json:"name" gorm:"not null"`
	Version     string    `json:"version" gorm:"not null"`
	Namespace   *string   `json:"namespace,omitempty"`
	MatchStatus string    `json:"match_status" gorm:"not null"`
	Source      string    `json:"source" gorm:"not null"`
}

func (*CoverageDemandSignal) BeforeCreate

func (d *CoverageDemandSignal) BeforeCreate(*gorm.DB) error

func (*CoverageDemandSignal) TableName

func (*CoverageDemandSignal) TableName() string

type CoverageReport

type CoverageReport struct {
	UUID                     string                    `json:"uuid" gorm:"primary_key;column:uuid"`
	CreatedAt                time.Time                 `json:"created_at" gorm:"not null"`
	OrgID                    string                    `json:"org_id" gorm:"not null"`
	AccountID                *string                   `json:"account_id,omitempty"`
	Status                   string                    `json:"status" gorm:"not null"`
	InputFormat              *string                   `json:"input_format,omitempty"`
	Total                    *int                      `json:"total,omitempty"`
	ExactMatches             *int                      `json:"exact_matches,omitempty"`
	PartialMatches           *int                      `json:"partial_matches,omitempty"`
	Unmatched                *int                      `json:"unmatched,omitempty"`
	EcosystemCoverageSummary *EcosystemCoverageSummary `json:"ecosystem_coverage_summary,omitempty" gorm:"type:jsonb"`
	CatalogSnapshotAt        *time.Time                `json:"catalog_snapshot_at,omitempty"`
	AnalysisTaskError        *string                   `json:"analysis_task_error,omitempty"`
	AnalysisTaskUUID         *string                   `json:"analysis_task_uuid,omitempty"`
	CompletedAt              *time.Time                `json:"completed_at,omitempty"`
}

func (*CoverageReport) BeforeCreate

func (cr *CoverageReport) BeforeCreate(*gorm.DB) error

func (*CoverageReport) MapForUpdate

func (cr *CoverageReport) MapForUpdate() map[string]interface{}

func (*CoverageReport) TableName

func (*CoverageReport) TableName() string

type CoverageReportPackage

type CoverageReportPackage struct {
	UUID               string  `json:"uuid" gorm:"primary_key;column:uuid"`
	CoverageReportUUID string  `json:"coverage_report_uuid" gorm:"not null"`
	Ecosystem          string  `json:"ecosystem" gorm:"not null"`
	Name               string  `json:"name" gorm:"not null"`
	Version            string  `json:"version" gorm:"not null"`
	Namespace          *string `json:"namespace,omitempty"`
	MatchStatus        string  `json:"match_status" gorm:"not null"`
}

func (*CoverageReportPackage) BeforeCreate

func (p *CoverageReportPackage) BeforeCreate(*gorm.DB) error

func (*CoverageReportPackage) TableName

func (*CoverageReportPackage) TableName() string

type CoverageUpload

type CoverageUpload struct {
	UUID       string    `json:"uuid" gorm:"primary_key;column:uuid"`
	StorageKey string    `json:"storage_key" gorm:"not null"`
	Sha256     string    `json:"sha256" gorm:"not null"`
	SizeBytes  int64     `json:"size_bytes" gorm:"not null"`
	CreatedAt  time.Time `json:"created_at" gorm:"not null"`
}

func (*CoverageUpload) BeforeCreate

func (u *CoverageUpload) BeforeCreate(*gorm.DB) error

func (*CoverageUpload) TableName

func (*CoverageUpload) TableName() string

type Domain

type Domain struct {
	DomainName string `json:"domain_name" gorm:"not null"`
	OrgId      string `json:"org_id" gorm:"not null"`
}

Domain model keeps track of the mapping between org id and the generated domain name

type EcosystemCoverageSummary

type EcosystemCoverageSummary []EcosystemCoverageSummaryEntry

func (*EcosystemCoverageSummary) Scan

func (s *EcosystemCoverageSummary) Scan(src interface{}) error

func (*EcosystemCoverageSummary) Value

type EcosystemCoverageSummaryEntry

type EcosystemCoverageSummaryEntry struct {
	Ecosystem      string `json:"ecosystem"`
	Total          int    `json:"total"`
	ExactMatches   int    `json:"exact_matches"`
	PartialMatches int    `json:"partial_matches"`
	Unmatched      int    `json:"unmatched"`
}

type Environment

type Environment struct {
	Base
	ID           string       `json:"id" gorm:"not null"`
	Name         string       `json:"name" gorm:"not null"`
	Description  string       `json:"description"`
	Repositories []Repository `gorm:"many2many:repositories_environments"`
}

RepositoryEnvironment model for the gorm object of the database which represents an environment which belongs to one repository.

func (*Environment) BeforeCreate

func (r *Environment) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate hook performs validations and sets UUID of RepositoryEnvironment

func (*Environment) DeepCopy

func (in *Environment) DeepCopy() *Environment

DeepCopy clone a RepositoryEnvironment struct

func (*Environment) DeepCopyInto

func (in *Environment) DeepCopyInto(out *Environment)

type Error

type Error struct {
	Message    string
	Validation bool
}

func (Error) Error

func (e Error) Error() string

type LightwellAdvisory

type LightwellAdvisory struct {
	Base
	RepoName                    string         `json:"repo_name" gorm:"not null"`
	AdvisoryID                  string         `json:"advisory_id" gorm:"not null"`
	Severity                    string         `json:"severity" gorm:"type:varchar(255)"`
	Details                     string         `json:"details"`
	ReferenceURLs               pq.StringArray `json:"reference_urls" gorm:"type:text[]"`
	PackageName                 string         `json:"package_name"`
	FixedVersion                string         `json:"fixed_version"`
	FixedVersions               pq.StringArray `json:"fixed_versions" gorm:"type:text[]"`
	RepositoryConfigurationUUID string         `json:"repository_configuration_uuid" gorm:"not null"`
	Checksum                    string         `json:"checksum"`
}

func (*LightwellAdvisory) BeforeCreate

func (la *LightwellAdvisory) BeforeCreate(tx *gorm.DB) error

func (*LightwellAdvisory) BeforeUpdate

func (la *LightwellAdvisory) BeforeUpdate(tx *gorm.DB) error

func (*LightwellAdvisory) TableName

func (*LightwellAdvisory) TableName() string

type LightwellAdvisoryNotification

type LightwellAdvisoryNotification struct {
	Base
	RepositoryConfigurationUUID string `json:"repository_configuration_uuid" gorm:"not null"`
	AdvisoryID                  string `json:"advisory_id" gorm:"not null"`
	PackageName                 string `json:"package_name"`
	OrgID                       string `json:"org_id" gorm:"not null;default:''"`
}

func (*LightwellAdvisoryNotification) BeforeCreate

func (lan *LightwellAdvisoryNotification) BeforeCreate(tx *gorm.DB) error

func (*LightwellAdvisoryNotification) TableName

type MavenPackage

type MavenPackage struct {
	UUID       string  `json:"uuid" gorm:"primary_key;column:uuid"`
	GroupID    string  `json:"group_id" gorm:"column:group_id;not null"`
	Name       string  `json:"name" gorm:"column:name;not null"`
	Summary    *string `json:"summary,omitempty" gorm:"column:summary"`
	License    *string `json:"license,omitempty" gorm:"column:license"`
	ProjectURL *string `json:"project_url,omitempty" gorm:"column:project_url"`
	Author     *string `json:"author,omitempty" gorm:"column:author"`
}

func (*MavenPackage) BeforeCreate

func (m *MavenPackage) BeforeCreate(db *gorm.DB) (err error)

func (*MavenPackage) TableName

func (*MavenPackage) TableName() string

type Memo

type Memo struct {
	UUID string          `json:"uuid" gorm:"primary_key"`
	Key  string          `json:"key" gorm:"uniqueIndex;not null"`
	Memo json.RawMessage `json:"memo" gorm:"type:jsonb;not null;default:'{}'"`
}

Memo model holds one-off pieces of data that can be read and updated

func (*Memo) BeforeCreate

func (m *Memo) BeforeCreate(db *gorm.DB) (err error)

func (*Memo) TableName

func (m *Memo) TableName() string

type ModuleStream

type ModuleStream struct {
	Base
	Name         string               `json:"name" gorm:"not null"`
	Stream       string               `json:"stream"`
	Version      string               `json:"version" gorm:"type:text"`
	Context      string               `json:"context"`
	Arch         string               `json:"arch"`
	Summary      string               `json:"summary"`
	Description  string               `json:"description"`
	PackageNames pq.StringArray       `json:"package_names" gorm:"type:text"`
	Packages     pq.StringArray       `json:"packages" gorm:"type:text"`
	Profiles     ModuleStreamProfiles `json:"profiles" gorm:"type:jsonb,not null,default:{}"`
	HashValue    string               `json:"hash" gorm:"not null"`
	Repositories []Repository         `gorm:"many2many:repositories_module_streams"`
}

func (*ModuleStream) BeforeCreate

func (r *ModuleStream) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate hook performs validations and sets UUID of RepositoryPackageGroup

func (*ModuleStream) DeepCopy

func (in *ModuleStream) DeepCopy() *ModuleStream

func (*ModuleStream) DeepCopyInto

func (in *ModuleStream) DeepCopyInto(out *ModuleStream)

func (*ModuleStream) ToHashString

func (r *ModuleStream) ToHashString() string

type ModuleStreamProfiles

type ModuleStreamProfiles map[string][]string

func (*ModuleStreamProfiles) Scan

func (p *ModuleStreamProfiles) Scan(src interface{}) error

func (*ModuleStreamProfiles) Value

func (p *ModuleStreamProfiles) Value() (driver.Value, error)

type PackageGroup

type PackageGroup struct {
	Base
	ID           string         `json:"id" gorm:"not null"`
	Name         string         `json:"name" gorm:"not null"`
	Description  string         `json:"description"`
	PackageList  pq.StringArray `json:"packagelist" gorm:"type:text"`
	HashValue    string         `json:"hashvalue"`
	Repositories []Repository   `gorm:"many2many:repositories_package_groups"`
}

RepositoryPackageGroup model for the gorm object of the database which represent a package group which belong to one repository.

func (*PackageGroup) BeforeCreate

func (r *PackageGroup) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate hook performs validations and sets UUID of RepositoryPackageGroup

func (*PackageGroup) DeepCopy

func (in *PackageGroup) DeepCopy() *PackageGroup

DeepCopy clone a RepositoryPackageGroup struct

func (*PackageGroup) DeepCopyInto

func (in *PackageGroup) DeepCopyInto(out *PackageGroup)

type Repository

type Repository struct {
	Base
	URL                          string `gorm:"unique;default:null"`
	RepomdChecksum               string `gorm:"default:null"`
	Public                       bool
	LastIntrospectionTime        *time.Time                `gorm:"default:null"`
	LastIntrospectionSuccessTime *time.Time                `gorm:"default:null"`
	LastIntrospectionUpdateTime  *time.Time                `gorm:"default:null"`
	LastIntrospectionError       *string                   `gorm:"default:null"`
	LastIntrospectionStatus      string                    `gorm:"default:Pending"`
	PackageCount                 int                       `gorm:"default:0;not null"`
	BuildCount                   int                       `gorm:"default:0;not null"`
	VersionCount                 int                       `gorm:"default:0;not null"`
	FailedIntrospectionsCount    int                       `gorm:"default:0;not null"`
	RepositoryConfigurations     []RepositoryConfiguration `gorm:"foreignKey:RepositoryUUID"`
	Rpms                         []Rpm                     `gorm:"many2many:repositories_rpms"`
	PackageGroups                []PackageGroup            `gorm:"many2many:repositories_package_groups"`
	Origin                       string                    `gorm:"default:external;not null"`
	ContentType                  string                    `gorm:"default:rpm;not null"`
	SecurityLevel                string                    `gorm:"default:null"`
	PublishedDistURL             string                    `gorm:"column:published_distribution_url;default:null"`
	PublishedDistBasePath        string                    `gorm:"column:published_distribution_base_path;default:null"`
}

https://stackoverflow.com/questions/43587610/preventing-null-or-empty-string-values-in-the-db

func (*Repository) AfterFind

func (r *Repository) AfterFind(tx *gorm.DB) error

func (*Repository) AfterSave

func (r *Repository) AfterSave(tx *gorm.DB) error

func (*Repository) BeforeCreate

func (r *Repository) BeforeCreate(tx *gorm.DB) (err error)

func (*Repository) DeepCopy

func (in *Repository) DeepCopy() *Repository

func (*Repository) DeepCopyInto

func (in *Repository) DeepCopyInto(out *Repository)

func (*Repository) MapForUpdate

func (r *Repository) MapForUpdate() map[string]interface{}

type RepositoryConfiguration

type RepositoryConfiguration struct {
	Base
	Name                   string         `json:"name" gorm:"default:null"`
	Versions               pq.StringArray `json:"version" gorm:"type:text[],default:null"`
	Arch                   string         `json:"arch" gorm:"default:''"`
	GpgKey                 string         `json:"gpg_key" gorm:"default:''"`
	Label                  string         `json:"label" gorm:"default:''"`
	MetadataVerification   bool           `json:"metadata_verification" gorm:"default:false"`
	ModuleHotfixes         bool           `json:"module_hotfixes" gorm:"default:false"`
	AccountID              string         `json:"account_id" gorm:"default:null"`
	OrgID                  string         `json:"org_id" gorm:"default:null"`
	RepositoryUUID         string         `json:"repository_uuid" gorm:"not null"`
	Repository             Repository     `json:"repository,omitempty"`
	Snapshot               bool           `json:"snapshot"`
	DeletedAt              gorm.DeletedAt `json:"deleted_at"`
	LastSnapshotUUID       string         `json:"last_snapshot_uuid" gorm:"default:null"`
	LastSnapshot           *Snapshot      `json:"last_snapshot,omitempty" gorm:"foreignKey:last_snapshot_uuid"`
	LastSnapshotTaskUUID   string         `json:"last_snapshot_task_uuid" gorm:"default:null"`
	LastSnapshotTask       *TaskInfo      `json:"last_snapshot_task" gorm:"foreignKey:last_snapshot_task_uuid"`
	FailedSnapshotCount    int64          `json:"failed_snapshot_count" gorm:"default:0"`
	FeatureName            string         `json:"feature_name" gorm:"default:null"` // Comma-separated; entitlement matches any token
	ExtendedRelease        string         `json:"extended_release" gorm:"default:null"`
	ExtendedReleaseVersion string         `json:"extended_release_version" gorm:"default:null"`
	Partner                bool           `json:"partner" gorm:"default:false"`
}

func (*RepositoryConfiguration) AfterFind

func (rc *RepositoryConfiguration) AfterFind(tx *gorm.DB) error

func (*RepositoryConfiguration) AfterSave

func (rc *RepositoryConfiguration) AfterSave(tx *gorm.DB) error

func (*RepositoryConfiguration) BeforeCreate

func (rc *RepositoryConfiguration) BeforeCreate(tx *gorm.DB) error

BeforeCreate perform validations and sets UUID of Repository Configurations

func (*RepositoryConfiguration) BeforeUpdate

func (rc *RepositoryConfiguration) BeforeUpdate(tx *gorm.DB) error

BeforeUpdate perform validations of Repository Configurations

func (*RepositoryConfiguration) DedupeVersions

func (rc *RepositoryConfiguration) DedupeVersions(tx *gorm.DB) error

func (*RepositoryConfiguration) DeepCopy

func (*RepositoryConfiguration) DeepCopyInto

func (rc *RepositoryConfiguration) DeepCopyInto(out *RepositoryConfiguration)

func (*RepositoryConfiguration) IsCommunity

func (rc *RepositoryConfiguration) IsCommunity() bool

func (*RepositoryConfiguration) IsRedHat

func (rc *RepositoryConfiguration) IsRedHat() bool

func (*RepositoryConfiguration) MapForUpdate

func (rc *RepositoryConfiguration) MapForUpdate() map[string]interface{}

When updating a model with gorm, we want to explicitly update any field that is set to empty string. We always fetch the object and then update it before saving so every update is the full model of user changeable fields. So OrgId and account Id are excluded

func (*RepositoryConfiguration) ReplaceEmptyValues

func (rc *RepositoryConfiguration) ReplaceEmptyValues(tx *gorm.DB) error

func (*RepositoryConfiguration) SetLabel

func (rc *RepositoryConfiguration) SetLabel(tx *gorm.DB) error

type RepositoryEnvironment

type RepositoryEnvironment struct {
	RepositoryUUID  string `json:"repository_uuid" gorm:"not null"`
	EnvironmentUUID string `json:"environment_uuid" gorm:"not null"`
}

func (*RepositoryEnvironment) BeforeCreate

func (r *RepositoryEnvironment) BeforeCreate(db *gorm.DB) (err error)

func (*RepositoryEnvironment) TableName

func (r *RepositoryEnvironment) TableName() string

type RepositoryModuleStream

type RepositoryModuleStream struct {
	RepositoryUUID   string `json:"repository_uuid" gorm:"not null"`
	ModuleStreamUUID string `json:"package_group_uuid" gorm:"not null"`
}

func (*RepositoryModuleStream) BeforeCreate

func (r *RepositoryModuleStream) BeforeCreate(db *gorm.DB) (err error)

func (*RepositoryModuleStream) TableName

func (r *RepositoryModuleStream) TableName() string

type RepositoryPackageGroup

type RepositoryPackageGroup struct {
	RepositoryUUID   string `json:"repository_uuid" gorm:"not null"`
	PackageGroupUUID string `json:"package_group_uuid" gorm:"not null"`
}

func (*RepositoryPackageGroup) BeforeCreate

func (r *RepositoryPackageGroup) BeforeCreate(db *gorm.DB) (err error)

func (*RepositoryPackageGroup) TableName

func (r *RepositoryPackageGroup) TableName() string

type RepositoryRpm

type RepositoryRpm struct {
	RepositoryUUID string `json:"repository_uuid" gorm:"not null"`
	RpmUUID        string `json:"rpm_uuid" gorm:"not null"`
}

func (*RepositoryRpm) BeforeCreate

func (r *RepositoryRpm) BeforeCreate(db *gorm.DB) (err error)

func (*RepositoryRpm) TableName

func (r *RepositoryRpm) TableName() string

type Rpm

type Rpm struct {
	Base
	Name    string `json:"name" gorm:"not null"`
	Arch    string `json:"arch" gorm:"not null"`
	Version string `json:"version" gorm:"not null"`
	Release string `json:"release" gorm:"null"`
	// Epoch is a way to define weighted dependencies based
	// on version numbers. It's default value is 0 and this
	// is assumed if an Epoch directive is not listed in the RPM SPEC file.
	// https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/packaging_and_distributing_software/advanced-topics#packaging-epoch_epoch-scriplets-and-triggers
	Epoch        int32        `json:"epoch" gorm:"default:0;not null"`
	Summary      string       `json:"summary" gorm:"not null"`
	Checksum     string       `json:"checksum" gorm:"not null"`
	Repositories []Repository `gorm:"many2many:repositories_rpms"`
}

RepositoryRpm model for the gorm object of the database which represent a RPM package which belong to one repository.

func (*Rpm) BeforeCreate

func (r *Rpm) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate hook performs validations and sets UUID of RepositoryRpm

func (*Rpm) DeepCopy

func (in *Rpm) DeepCopy() *Rpm

DeepCopy clone a RepositoryRpm struct

func (*Rpm) DeepCopyInto

func (in *Rpm) DeepCopyInto(out *Rpm)

type Snapshot

type Snapshot struct {
	Base
	DeletedAt                   gorm.DeletedAt `json:"deleted_at"`
	VersionHref                 string         `json:"version_href" gorm:"not null"`
	PublicationHref             string         `json:"publication_href" gorm:"not null"`
	DistributionPath            string         `json:"distribution_path" gorm:"not null"`
	RepositoryPath              string         `json:"repository_path" gorm:"not null"` // Path to access the repository, includes domain
	DistributionHref            string         `json:"distribution_href" gorm:"not null"`
	RepositoryConfigurationUUID string         `json:"repository_configuration_uuid" gorm:"not null"`
	RepositoryConfiguration     RepositoryConfiguration
	ContentCounts               ContentCountsType `json:"content_counts" gorm:"not null,default:{}"`
	AddedCounts                 ContentCountsType `json:"added_counts" gorm:"not null,default:{}"`
	RemovedCounts               ContentCountsType `json:"removed_counts" gorm:"not null,default:{}"`
	DetectedOSVersion           string            `json:"detected_os_version" gorm:"not null"`
	Published                   bool              `json:"published" gorm:"default:false"`
}

type TaskInfo

type TaskInfo struct {
	Id              uuid.UUID       `gorm:"primary_key;column:id"`
	Typename        string          `gorm:"column:type"` // "introspect" or "snapshot"
	Payload         json.RawMessage `gorm:"type:jsonb"`
	OrgId           string
	AccountId       string
	ObjectUUID      uuid.UUID
	ObjectType      *string
	Dependencies    pq.StringArray `gorm:"->;column:t_dependencies;type:text[]"`
	Dependents      pq.StringArray `gorm:"->;column:t_dependents;type:text[]"`
	Token           uuid.UUID
	Queued          *time.Time `gorm:"column:queued_at"`
	Started         *time.Time `gorm:"column:started_at"`
	Finished        *time.Time `gorm:"column:finished_at"`
	Error           *string
	Status          string
	RequestID       string
	Retries         int
	NextRetryTime   *time.Time
	Priority        int
	CancelAttempted bool
}

Shared by DAO and queue packages GORM only used in DAO to read from table

func (*TaskInfo) AfterFind

func (t *TaskInfo) AfterFind(tx *gorm.DB) error

func (*TaskInfo) AfterSave

func (t *TaskInfo) AfterSave(tx *gorm.DB) error

func (*TaskInfo) TableName

func (*TaskInfo) TableName() string

type TaskInfoRepositoryConfiguration

type TaskInfoRepositoryConfiguration struct {
	*TaskInfo
	RepositoryConfigUUID string `gorm:"column:rc_uuid"`
	RepositoryConfigName string `gorm:"column:rc_name"`
	TemplateUUID         string `gorm:"column:template_uuid"`
	TemplateName         string `gorm:"column:template_name"`
}

type Template

type Template struct {
	Base
	Name                             string         `gorm:"not null;default:null"`
	OrgID                            string         `gorm:"default:null"`
	Description                      string         `gorm:"default:null"`
	Date                             time.Time      `gorm:"default:null"`
	Version                          string         `gorm:"default:null"`
	Arch                             string         `gorm:"default:null"`
	ExtendedRelease                  string         `json:"extended_release" gorm:"default:null"`
	ExtendedReleaseVersion           string         `json:"extended_release_version" gorm:"default:null"`
	DeletedAt                        gorm.DeletedAt `json:"deleted_at"`
	CreatedBy                        string
	LastUpdatedBy                    string
	UseLatest                        bool
	RHSMEnvironmentCreated           bool                              `json:"rhsm_environment_created" gorm:"column:rhsm_environment_created"`
	LastUpdateSnapshotError          *string                           `gorm:"default:null"`
	LastUpdateTaskUUID               string                            `json:"last_update_task_uuid" gorm:"default:null"`
	LastUpdateTask                   *TaskInfo                         `json:"last_update_task" gorm:"foreignKey:last_update_task_uuid"`
	TemplateRepositoryConfigurations []TemplateRepositoryConfiguration `gorm:"foreignKey:TemplateUUID"`
}

func (*Template) AfterFind

func (t *Template) AfterFind(tx *gorm.DB) error

func (*Template) AfterSave

func (t *Template) AfterSave(tx *gorm.DB) error

func (*Template) BeforeCreate

func (t *Template) BeforeCreate(tx *gorm.DB) error

BeforeCreate perform validations and sets UUID of Template

func (*Template) BeforeUpdate

func (t *Template) BeforeUpdate(tx *gorm.DB) error

BeforeUpdate perform validations and sets UUID of Template

func (*Template) MapForUpdate

func (t *Template) MapForUpdate() map[string]interface{}

type TemplateRepositoryConfiguration

type TemplateRepositoryConfiguration struct {
	RepositoryConfigurationUUID string         `json:"repository_configuration_uuid" gorm:"not null"`
	TemplateUUID                string         `json:"template_uuid" gorm:"not null"`
	SnapshotUUID                string         `json:"snapshot_uuid" gorm:"not null"`
	Snapshot                    Snapshot       `json:"snapshot" gorm:"foreignkey:SnapshotUUID"`
	DistributionHref            string         `json:"distribution_href"`
	DeletedAt                   gorm.DeletedAt `json:"deleted_at"`
}

func (*TemplateRepositoryConfiguration) AfterFind

func (t *TemplateRepositoryConfiguration) AfterFind(tx *gorm.DB) error

func (*TemplateRepositoryConfiguration) AfterSave

func (t *TemplateRepositoryConfiguration) AfterSave(tx *gorm.DB) error

func (*TemplateRepositoryConfiguration) BeforeCreate

func (t *TemplateRepositoryConfiguration) BeforeCreate(db *gorm.DB) (err error)

func (*TemplateRepositoryConfiguration) TableName

func (t *TemplateRepositoryConfiguration) TableName() string

type Upload

type Upload struct {
	UploadUUID string
	CreatedAt  time.Time
	OrgID      string
	ChunkSize  int64
	Size       int64
	Sha256     string
	ChunkList  pq.StringArray `gorm:"type:text[]"`
}

func (*Upload) BeforeCreate

func (t *Upload) BeforeCreate(tx *gorm.DB) error

BeforeCreate perform validations and sets UUID of Upload

type UserPreference

type UserPreference struct {
	Base
	OrgID  string `gorm:"not null"`
	UserID string `gorm:"not null"`
	Label  string `gorm:"not null"`
	Value  string `gorm:"not null"`
}

UserPreference stores a single user preference as a label/value pair

func (*UserPreference) BeforeCreate

func (up *UserPreference) BeforeCreate(tx *gorm.DB) error

func (*UserPreference) BeforeUpdate

func (up *UserPreference) BeforeUpdate(tx *gorm.DB) error

func (*UserPreference) TableName

func (up *UserPreference) TableName() string

Jump to

Keyboard shortcuts

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