Documentation ¶
Index ¶
- func KeepMetricsUpdated(ctx context.Context, db *gorm.DB, interval time.Duration)
- func UpdateMetrics(ctx context.Context, db *gorm.DB) error
- type AppVersion
- type Changeset
- type ChangesetEventStore
- func (s *ChangesetEventStore) Apply(selectors []string, user *auth_models.User) ([]Changeset, error)
- func (s *ChangesetEventStore) Plan(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
- func (s *ChangesetEventStore) PlanAndApply(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
- func (s *ChangesetEventStore) QueryApplied(chartReleaseSelector string, offset int, limit int) ([]Changeset, error)
- type Chart
- type ChartRelease
- type ChartReleaseVersion
- type ChartVersion
- 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 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 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) TableName ¶
func (a AppVersion) TableName() string
type Changeset ¶ added in v0.0.50
type Changeset struct { gorm.Model 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;"` }
type ChangesetEventStore ¶ added in v0.0.50
type ChangesetEventStore struct { *ModelStore[Changeset] // contains filtered or unexported fields }
func (*ChangesetEventStore) Apply ¶ added in v0.0.50
func (s *ChangesetEventStore) Apply(selectors []string, user *auth_models.User) ([]Changeset, error)
func (*ChangesetEventStore) Plan ¶ added in v0.0.50
func (s *ChangesetEventStore) Plan(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
func (*ChangesetEventStore) PlanAndApply ¶ added in v0.0.50
func (s *ChangesetEventStore) PlanAndApply(changesets []Changeset, user *auth_models.User) ([]Changeset, error)
func (*ChangesetEventStore) QueryApplied ¶ added in v0.0.112
type Chart ¶
type Chart struct { gorm.Model 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 }
type ChartRelease ¶
type ChartRelease struct { gorm.Model 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 }
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 Chart *Chart ChartID uint `gorm:"not null: default:null"` ChartVersion string `gorm:"not null: default:null"` Description string ParentChartVersion *ChartVersion ParentChartVersionID *uint }
func (ChartVersion) TableName ¶
func (c ChartVersion) TableName() string
type Cluster ¶
type Cluster struct { gorm.Model 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"` }
type DatabaseInstance ¶ added in v0.1.14
type DatabaseInstance struct { gorm.Model ChartRelease *ChartRelease ChartReleaseID uint Platform *string GoogleProject *string GoogleLocation *string AzureSubscription *string AzureManagedResourceGroup *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 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 *string `gorm:"not null; default:null"` 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) 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 *ModelStore[ChartVersion] AppVersionStore *ModelStore[AppVersion] ChartReleaseStore *ModelStore[ChartRelease] PagerdutyIntegration *ModelStore[PagerdutyIntegration] DatabaseInstanceStore *ModelStore[DatabaseInstance] UserStore *ModelStore[User] ChangesetEventStore *ChangesetEventStore // contains filtered or unexported fields }
func NewStoreSet ¶
type User ¶ added in v0.1.16
type User struct { gorm.Model auth_models.StoredControlledUserFields auth_models.StoredMutableUserFields }