Documentation
¶
Index ¶
- func KeepMetricsUpdated(ctx context.Context, db *gorm.DB)
- func UpdateMetrics(ctx context.Context, db *gorm.DB) error
- type AppVersion
- type Changeset
- type ChangesetStore
- func (s *ChangesetStore) Apply(selectors []string, user *auth_models.User) ([]Changeset, error)
- func (s *ChangesetStore) Plan(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
- func (s *ChangesetStore) PlanAndApply(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
- func (s *ChangesetStore) QueryApplied(chartReleaseSelector string, offset int, limit int) ([]Changeset, error)
- type Chart
- type ChartRelease
- type ChartReleaseVersion
- type ChartVersion
- type CiIdentifiable
- type CiIdentifier
- type CiRun
- type Cluster
- type DatabaseInstance
- type Environment
- type MiddlewareUserStore
- type Model
- type ModelStore
- func (s ModelStore[M]) Create(model M, user *auth_models.User) (M, bool, error)
- func (s ModelStore[M]) Delete(selector string, user *auth_models.User) (M, error)
- func (s ModelStore[M]) Edit(selector string, editsToMake M, user *auth_models.User) (M, error)
- func (s ModelStore[M]) Get(selector string) (M, error)
- func (s ModelStore[M]) GetOtherValidSelectors(selector string) ([]string, error)
- func (s ModelStore[M]) ListAllMatchingByCreated(filter M, limit int) ([]M, error)
- func (s ModelStore[M]) ListAllMatchingByUpdated(filter M, limit int) ([]M, error)
- type PagerdutyIntegration
- type StoreSet
- type TreeModel
- type TreeModelStore
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeepMetricsUpdated ¶ added in v0.0.110
Types ¶
type AppVersion ¶
type AppVersion struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:app-version"`
Chart *Chart
ChartID uint `gorm:"not null: default:null"`
AppVersion string `gorm:"not null: default:null"`
GitCommit string
GitBranch string
Description string
ParentAppVersion *AppVersion
ParentAppVersionID *uint
}
func (AppVersion) GetCiIdentifier ¶ added in v0.1.43
func (a AppVersion) GetCiIdentifier() *CiIdentifier
func (AppVersion) TableName ¶
func (a AppVersion) TableName() string
type Changeset ¶ added in v0.0.50
type Changeset struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:changeset"`
ChartRelease *ChartRelease
ChartReleaseID uint
From ChartReleaseVersion `gorm:"embedded;embeddedPrefix:from_"`
To ChartReleaseVersion `gorm:"embedded;embeddedPrefix:to_"`
AppliedAt *time.Time
SupersededAt *time.Time
NewAppVersions []*AppVersion `gorm:"many2many:v2_changeset_new_app_versions;constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
NewChartVersions []*ChartVersion `gorm:"many2many:v2_changeset_new_chart_versions;constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
}
func (Changeset) GetCiIdentifier ¶ added in v0.1.43
func (c Changeset) GetCiIdentifier() *CiIdentifier
type ChangesetStore ¶ added in v0.1.32
type ChangesetStore struct {
*ModelStore[Changeset]
}
func (*ChangesetStore) Apply ¶ added in v0.1.32
func (s *ChangesetStore) Apply(selectors []string, user *auth_models.User) ([]Changeset, error)
func (*ChangesetStore) Plan ¶ added in v0.1.32
func (s *ChangesetStore) Plan(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
func (*ChangesetStore) PlanAndApply ¶ added in v0.1.32
func (s *ChangesetStore) PlanAndApply(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
func (*ChangesetStore) QueryApplied ¶ added in v0.1.32
type Chart ¶
type Chart struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:chart"`
Name string `gorm:"not null; default:null; unique"`
// Mutable
ChartRepo *string `gorm:"not null; default:null"`
AppImageGitRepo *string
AppImageGitMainBranch *string
ChartExposesEndpoint *bool
DefaultSubdomain *string
DefaultProtocol *string
DefaultPort *uint
LegacyConfigsEnabled *bool
Description *string
PlaybookURL *string
}
func (Chart) GetCiIdentifier ¶ added in v0.1.43
func (c Chart) GetCiIdentifier() *CiIdentifier
type ChartRelease ¶
type ChartRelease struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:chart-release"`
Chart *Chart
ChartID uint
Cluster *Cluster
ClusterID *uint
DestinationType string
Environment *Environment
EnvironmentID *uint
Name string `gorm:"not null; default:null"`
Namespace string
ChartReleaseVersion
Subdomain *string
Protocol *string
Port *uint
PagerdutyIntegration *PagerdutyIntegration
PagerdutyIntegrationID *uint
IncludeInBulkChangesets *bool
}
func (ChartRelease) GetCiIdentifier ¶ added in v0.1.43
func (c ChartRelease) GetCiIdentifier() *CiIdentifier
func (ChartRelease) TableName ¶
func (c ChartRelease) TableName() string
type ChartReleaseVersion ¶ added in v0.0.50
type ChartReleaseVersion struct {
ResolvedAt *time.Time
AppVersionResolver *string
AppVersionExact *string
AppVersionBranch *string
AppVersionCommit *string
AppVersionFollowChartRelease *ChartRelease
AppVersionFollowChartReleaseID *uint
AppVersion *AppVersion
AppVersionID *uint
ChartVersionResolver *string
ChartVersionExact *string
ChartVersionFollowChartRelease *ChartRelease
ChartVersionFollowChartReleaseID *uint
ChartVersion *ChartVersion
ChartVersionID *uint
HelmfileRef *string
FirecloudDevelopRef *string
}
ChartReleaseVersion isn't stored in the database on its own, it is included as a part of a ChartRelease or Changeset. It has especially strict validation that requires it being fully loaded from the database. The resolve method will help "load" it fully from the database so it can survive validation.
type ChartVersion ¶
type ChartVersion struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:chart-version"`
Chart *Chart
ChartID uint `gorm:"not null: default:null"`
ChartVersion string `gorm:"not null: default:null"`
Description string
ParentChartVersion *ChartVersion
ParentChartVersionID *uint
}
func (ChartVersion) GetCiIdentifier ¶ added in v0.1.43
func (c ChartVersion) GetCiIdentifier() *CiIdentifier
func (ChartVersion) TableName ¶
func (c ChartVersion) TableName() string
type CiIdentifiable ¶ added in v0.1.43
type CiIdentifiable interface {
// GetCiIdentifier should return either a type's loaded CiIdentifier or a generated one based on resource type and
// resource ID. It's important for the caller to understand that this function can return things not in the
// database yet.
//
// In reality, this function is meant to go hand-in-hand with createCiRunIdentifiersJustInTime. This function will
// return CiIdentifier instances that may or may not exist, and that function will create them all before the
// CiRun actually enters the database. If there's a breakdown in communication, it's actually fine for superfluous
// creates to be attempted -- rejectDuplicateCiIdentifier will make it so that the creates will behave just like
// gets.
GetCiIdentifier() *CiIdentifier
}
CiIdentifiable is an interface to help align functionality across other types that can have a CiIdentifier.
type CiIdentifier ¶ added in v0.1.43
type CiIdentifier struct {
gorm.Model
ResourceType string `gorm:"index:idx_v2_ci_identifiers_polymorphic_index,priority:1"`
ResourceID uint `gorm:"index:idx_v2_ci_identifiers_polymorphic_index,priority:2"`
// Mutable
CiRuns []*CiRun `gorm:"many2many:v2_ci_runs_for_identifiers; constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
}
func (CiIdentifier) TableName ¶ added in v0.1.43
func (c CiIdentifier) TableName() string
type CiRun ¶ added in v0.1.43
type CiRun struct {
gorm.Model
Platform string
GithubActionsOwner string
GithubActionsRepo string
GithubActionsRunID uint
GithubActionsAttemptNumber uint
GithubActionsWorkflowPath string
ArgoWorkflowsNamespace string
ArgoWorkflowsName string
ArgoWorkflowsTemplate string
// Mutable
RelatedResources []*CiIdentifier `gorm:"many2many:v2_ci_runs_for_identifiers; constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
TerminalAt *time.Time
Status *string
}
type Cluster ¶
type Cluster struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:cluster"`
Name string `gorm:"not null; default:null; unique"`
Provider string `gorm:"not null; default:null"`
GoogleProject string
AzureSubscription string
Location string `gorm:"not null; default:null"`
// Mutable
Base *string `gorm:"not null; default:null"`
Address *string `gorm:"not null; default:null"`
RequiresSuitability *bool `gorm:"not null; default:null"`
HelmfileRef *string `gorm:"not null; default:null"`
}
func (Cluster) GetCiIdentifier ¶ added in v0.1.43
func (c Cluster) GetCiIdentifier() *CiIdentifier
type DatabaseInstance ¶ added in v0.1.14
type DatabaseInstance struct {
gorm.Model
ChartRelease *ChartRelease
ChartReleaseID uint
Platform *string
GoogleProject *string
InstanceName *string
DefaultDatabase *string
}
func (DatabaseInstance) TableName ¶ added in v0.1.14
func (d DatabaseInstance) TableName() string
type Environment ¶
type Environment struct {
gorm.Model
CiIdentifier *CiIdentifier `gorm:"polymorphic:Resource; polymorphicValue:environment"`
Base string
Lifecycle string `gorm:"not null; default:null"`
Name string `gorm:"not null; default:null"`
NamePrefix string
TemplateEnvironment *Environment
TemplateEnvironmentID *uint
ValuesName string
AutoPopulateChartReleases *bool
UniqueResourcePrefix string `gorm:"not null; default:null"`
DefaultNamespace string
// Mutable
DefaultCluster *Cluster
DefaultClusterID *uint
DefaultFirecloudDevelopRef *string
Owner *User
OwnerID *uint
LegacyOwner *string
RequiresSuitability *bool
BaseDomain *string
NamePrefixesDomain *bool
HelmfileRef *string `gorm:"not null; default:null"`
PreventDeletion *bool
AutoDelete *environment.AutoDelete `gorm:"column:delete_after; -:migration"`
Description *string
PagerdutyIntegration *PagerdutyIntegration
PagerdutyIntegrationID *uint
Offline *bool
OfflineScheduleBeginEnabled *bool
OfflineScheduleBeginTime *string
OfflineScheduleEndEnabled *bool
OfflineScheduleEndTime *string
OfflineScheduleEndWeekends *bool
}
func (Environment) GetCiIdentifier ¶ added in v0.1.43
func (e Environment) GetCiIdentifier() *CiIdentifier
func (Environment) TableName ¶
func (e Environment) TableName() string
type MiddlewareUserStore ¶ added in v0.1.17
type MiddlewareUserStore struct {
// contains filtered or unexported fields
}
func NewMiddlewareUserStore ¶ added in v0.1.17
func NewMiddlewareUserStore(db *gorm.DB) *MiddlewareUserStore
func (*MiddlewareUserStore) GetGithubUserIfExists ¶ added in v0.1.18
func (s *MiddlewareUserStore) GetGithubUserIfExists(githubID string) (*User, error)
func (*MiddlewareUserStore) GetOrCreateUser ¶ added in v0.1.17
func (s *MiddlewareUserStore) GetOrCreateUser(email, googleID string) (User, error)
type ModelStore ¶ added in v0.0.50
type ModelStore[M Model] struct { // contains filtered or unexported fields }
func (ModelStore[M]) Create ¶ added in v0.0.50
func (s ModelStore[M]) Create(model M, user *auth_models.User) (M, bool, error)
func (ModelStore[M]) Delete ¶ added in v0.0.50
func (s ModelStore[M]) Delete(selector string, user *auth_models.User) (M, error)
func (ModelStore[M]) Edit ¶ added in v0.0.50
func (s ModelStore[M]) Edit(selector string, editsToMake M, user *auth_models.User) (M, error)
func (ModelStore[M]) Get ¶ added in v0.0.50
func (s ModelStore[M]) Get(selector string) (M, error)
func (ModelStore[M]) GetOtherValidSelectors ¶ added in v0.0.50
func (s ModelStore[M]) GetOtherValidSelectors(selector string) ([]string, error)
GetOtherValidSelectors is basically just a human debug method. Different model types have different selectors to try to make it easier to refer to them than by having to directly query them and use their numeric ID primary key. Under the hood, models are already required to be able to generate selectors from an entry for uniqueness-validation purposes, so this is a simple method that uses that existing code to translate one selector for an existing entry into all possible selectors that would match.
func (ModelStore[M]) ListAllMatchingByCreated ¶ added in v0.0.74
func (s ModelStore[M]) ListAllMatchingByCreated(filter M, limit int) ([]M, error)
func (ModelStore[M]) ListAllMatchingByUpdated ¶ added in v0.0.74
func (s ModelStore[M]) ListAllMatchingByUpdated(filter M, limit int) ([]M, error)
type PagerdutyIntegration ¶ added in v0.1.1
type PagerdutyIntegration struct {
gorm.Model
PagerdutyID string
Name *string
Key *string
Type *string
}
func (PagerdutyIntegration) TableName ¶ added in v0.1.1
func (p PagerdutyIntegration) TableName() string
type StoreSet ¶
type StoreSet struct {
ClusterStore *ModelStore[Cluster]
EnvironmentStore *ModelStore[Environment]
ChartStore *ModelStore[Chart]
ChartVersionStore *TreeModelStore[ChartVersion]
AppVersionStore *TreeModelStore[AppVersion]
ChartReleaseStore *ModelStore[ChartRelease]
PagerdutyIntegration *ModelStore[PagerdutyIntegration]
DatabaseInstanceStore *ModelStore[DatabaseInstance]
UserStore *ModelStore[User]
ChangesetStore *ChangesetStore
CiIdentifierStore *ModelStore[CiIdentifier]
CiRunStore *ModelStore[CiRun]
// contains filtered or unexported fields
}
func NewStoreSet ¶
type TreeModel ¶ added in v0.1.32
type TreeModel interface {
Model
// contains filtered or unexported methods
}
type TreeModelStore ¶ added in v0.1.32
type TreeModelStore[M TreeModel] struct { *ModelStore[M] // contains filtered or unexported fields }
func (TreeModelStore[M]) GetChildrenPathToParent ¶ added in v0.1.32
func (s TreeModelStore[M]) GetChildrenPathToParent(originChild string, destinationParent string) (path []*M, connected bool, err error)
type User ¶ added in v0.1.16
type User struct {
gorm.Model
auth_models.StoredControlledUserFields
auth_models.StoredMutableUserFields
}
Source Files
¶
- app_version.go
- changeset.go
- changeset_store.go
- chart.go
- chart_release.go
- chart_release_version.go
- chart_version.go
- ci_identifier.go
- ci_run.go
- cluster.go
- database_instance.go
- environment.go
- internal_model_store.go
- internal_tree_model_store.go
- metrics_updater.go
- middleware_user_store.go
- model_store.go
- pagerduty_integration.go
- store_set.go
- tree_model_store.go
- user.go