Documentation ¶
Overview ¶
Package persistence provides an implementation of datalayer.go DataLayer interface. This particular implementation is for Postgres and uses the models in pkg/models/models.go. The migrations are in migrations/[0-9]_create_acyl_models_up.sql.
Index ¶
- func JSONTime(t time.Time) string
- func PGClient(config *config.PGConfig) (*sqlx.DB, error)
- type APIKeyDataLayer
- type Cleaner
- type DataLayer
- type EnvironmentStatus
- type EventLoggerDataLayer
- type FakeDataLayer
- func (fdl *FakeDataLayer) AddEvent(ctx context.Context, name string, msg string) error
- func (fdl *FakeDataLayer) AppendToEventLog(id uuid.UUID, msg string) error
- func (fdl *FakeDataLayer) Close() error
- func (fdl *FakeDataLayer) CreateAPIKey(ctx context.Context, permissionLevel models.PermissionLevel, ...) (uuid.UUID, error)
- func (fdl *FakeDataLayer) CreateEventLog(elog *models.EventLog) error
- func (fdl *FakeDataLayer) CreateHelmReleasesForEnv(ctx context.Context, releases []models.HelmRelease) error
- func (fdl *FakeDataLayer) CreateK8sEnv(ctx context.Context, env *models.KubernetesEnvironment) error
- func (fdl *FakeDataLayer) CreateQAEnvironment(ctx context.Context, qa *QAEnvironment) error
- func (fdl *FakeDataLayer) CreateUISession(targetRoute string, state []byte, clientIP net.IP, userAgent string, ...) (int, error)
- func (fdl *FakeDataLayer) DeleteAPIKeyByID(ctx context.Context, id uuid.UUID) error
- func (fdl *FakeDataLayer) DeleteEventLog(id uuid.UUID) error
- func (fdl *FakeDataLayer) DeleteEventLogsByEnvName(name string) (uint, error)
- func (fdl *FakeDataLayer) DeleteEventLogsByRepoAndPR(repo string, pr uint) (uint, error)
- func (fdl *FakeDataLayer) DeleteExpiredUISessions() (uint, error)
- func (fdl *FakeDataLayer) DeleteHelmReleasesForEnv(ctx context.Context, name string) (uint, error)
- func (fdl *FakeDataLayer) DeleteK8sEnv(ctx context.Context, name string) error
- func (fdl *FakeDataLayer) DeleteQAEnvironment(ctx context.Context, name string) error
- func (fdl *FakeDataLayer) DeleteUISession(id int) error
- func (fdl *FakeDataLayer) GetAPIKeyByID(ctx context.Context, id uuid.UUID) (*models.APIKey, error)
- func (fdl *FakeDataLayer) GetAPIKeyByToken(ctx context.Context, token uuid.UUID) (*models.APIKey, error)
- func (fdl *FakeDataLayer) GetAPIKeysByGithubUser(ctx context.Context, githubUser string) ([]*models.APIKey, error)
- func (fdl *FakeDataLayer) GetEventLogByDeliveryID(deliveryID uuid.UUID) (*models.EventLog, error)
- func (fdl *FakeDataLayer) GetEventLogByID(id uuid.UUID) (*models.EventLog, error)
- func (fdl *FakeDataLayer) GetEventLogsByEnvName(name string) ([]models.EventLog, error)
- func (fdl *FakeDataLayer) GetEventLogsByRepoAndPR(repo string, pr uint) ([]models.EventLog, error)
- func (fdl *FakeDataLayer) GetEventStatus(id uuid.UUID) (*models.EventStatusSummary, error)
- func (fdl *FakeDataLayer) GetExtantQAEnvironments(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetHelmReleasesForEnv(ctx context.Context, name string) ([]models.HelmRelease, error)
- func (fdl *FakeDataLayer) GetK8sEnv(ctx context.Context, name string) (*models.KubernetesEnvironment, error)
- func (fdl *FakeDataLayer) GetK8sEnvsByNamespace(ctx context.Context, ns string) ([]models.KubernetesEnvironment, error)
- func (fdl *FakeDataLayer) GetMostRecent(ctx context.Context, n uint) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetMostRecentForUser(ctx context.Context, user string, n uint) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironment(ctx context.Context, name string) (*QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentBySourceSHA(ctx context.Context, sourceSHA string) (*QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentConsistently(ctx context.Context, name string) (*QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentsByRepo(ctx context.Context, repo string) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentsByRepoAndPR(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentsBySourceBranch(ctx context.Context, sourceBranch string) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentsByStatus(ctx context.Context, status string) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetQAEnvironmentsByUser(ctx context.Context, user string) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetRunningQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) GetUISession(id int) (*models.UISession, error)
- func (fdl *FakeDataLayer) Load(dir string) error
- func (fdl *FakeDataLayer) NewFakeCreateEvent(started time.Time, repo, user, envname string) uuid.UUID
- func (fdl *FakeDataLayer) NewFakeEvent(started time.Time, repo, user, envname string, etype models.EventStatusType, ...) uuid.UUID
- func (fdl *FakeDataLayer) RenameQAEnvironment(ctx context.Context, id int64, newName string) error
- func (fdl *FakeDataLayer) Save(dir string) ([]string, error)
- func (fdl *FakeDataLayer) Search(ctx context.Context, opts models.EnvSearchParameters) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) SearchEnvsForUser(ctx context.Context, user string, opts models.EnvSearchParameters) ([]QAEnvironment, error)
- func (fdl *FakeDataLayer) SetAminoEnvironmentID(ctx context.Context, name string, did int) error
- func (fdl *FakeDataLayer) SetAminoKubernetesNamespace(ctx context.Context, name, namespace string) error
- func (fdl *FakeDataLayer) SetAminoServiceToPort(ctx context.Context, name string, serviceToPort map[string]int64) error
- func (fdl *FakeDataLayer) SetDelay(d time.Duration)
- func (fdl *FakeDataLayer) SetEventLogEnvName(id uuid.UUID, name string) error
- func (fdl *FakeDataLayer) SetEventStatus(id uuid.UUID, status models.EventStatusSummary) error
- func (fdl *FakeDataLayer) SetEventStatusChartCompleted(id uuid.UUID, name string, status models.NodeChartStatus) error
- func (fdl *FakeDataLayer) SetEventStatusChartStarted(id uuid.UUID, name string, status models.NodeChartStatus) error
- func (fdl *FakeDataLayer) SetEventStatusCompleted(id uuid.UUID, status models.EventStatus) error
- func (fdl *FakeDataLayer) SetEventStatusConfig(id uuid.UUID, processingTime time.Duration, refmap map[string]string) error
- func (fdl *FakeDataLayer) SetEventStatusConfigK8sNS(id uuid.UUID, ns string) error
- func (fdl *FakeDataLayer) SetEventStatusFailed(id uuid.UUID, ce metahelmlib.ChartError) error
- func (fdl *FakeDataLayer) SetEventStatusImageBuildID(id uuid.UUID, name string, furanBuildID guuid.UUID) error
- func (fdl *FakeDataLayer) SetEventStatusImageCompleted(id uuid.UUID, name string, err bool) error
- func (fdl *FakeDataLayer) SetEventStatusImageStarted(id uuid.UUID, name string) error
- func (fdl *FakeDataLayer) SetEventStatusRenderedStatus(id uuid.UUID, rstatus models.RenderedEventStatus) error
- func (fdl *FakeDataLayer) SetEventStatusTree(id uuid.UUID, tree map[string]models.EventStatusTreeNode) error
- func (fdl *FakeDataLayer) SetQAEnvironmentCommitSHAMap(ctx context.Context, name string, csm RefMap) error
- func (fdl *FakeDataLayer) SetQAEnvironmentCreated(ctx context.Context, name string, ts time.Time) error
- func (fdl *FakeDataLayer) SetQAEnvironmentRefMap(ctx context.Context, name string, rm RefMap) error
- func (fdl *FakeDataLayer) SetQAEnvironmentRepoData(ctx context.Context, name string, rrd *RepoRevisionData) error
- func (fdl *FakeDataLayer) SetQAEnvironmentStatus(ctx context.Context, name string, status EnvironmentStatus) error
- func (fdl *FakeDataLayer) UpdateAPIKeyLastUsed(ctx context.Context, token uuid.UUID) error
- func (fdl *FakeDataLayer) UpdateHelmReleaseRevision(ctx context.Context, envname, release, revision string) error
- func (fdl *FakeDataLayer) UpdateK8sEnvConfigSignature(ctx context.Context, name string, confSig [32]byte) error
- func (fdl *FakeDataLayer) UpdateUISession(id int, githubUser string, encryptedtoken []byte, authenticated bool) error
- type HelmDataLayer
- type K8sEnvDataLayer
- type LogFunc
- type MetricsCollector
- type PGLayer
- func (p *PGLayer) AddEvent(ctx context.Context, name string, msg string) error
- func (pg *PGLayer) AppendToEventLog(id uuid.UUID, msg string) error
- func (p *PGLayer) Close() error
- func (pg *PGLayer) CreateAPIKey(ctx context.Context, permissionLevel models.PermissionLevel, ...) (uuid.UUID, error)
- func (pg *PGLayer) CreateEventLog(elog *models.EventLog) error
- func (pg *PGLayer) CreateHelmReleasesForEnv(ctx context.Context, releases []models.HelmRelease) error
- func (pg *PGLayer) CreateK8sEnv(ctx context.Context, env *models.KubernetesEnvironment) error
- func (p *PGLayer) CreateQAEnvironment(ctx context.Context, qae *QAEnvironment) error
- func (pg *PGLayer) CreateUISession(targetRoute string, state []byte, clientIP net.IP, userAgent string, ...) (int, error)
- func (p *PGLayer) DB() *sqlx.DB
- func (pg *PGLayer) DeleteAPIKeyByID(ctx context.Context, id uuid.UUID) error
- func (pg *PGLayer) DeleteEventLog(id uuid.UUID) error
- func (pg *PGLayer) DeleteEventLogsByEnvName(name string) (uint, error)
- func (pg *PGLayer) DeleteEventLogsByRepoAndPR(repo string, pr uint) (uint, error)
- func (pg *PGLayer) DeleteExpiredUISessions() (uint, error)
- func (pg *PGLayer) DeleteHelmReleasesForEnv(ctx context.Context, name string) (uint, error)
- func (pg *PGLayer) DeleteK8sEnv(ctx context.Context, name string) error
- func (p *PGLayer) DeleteQAEnvironment(ctx context.Context, name string) (err error)
- func (pg *PGLayer) DeleteUISession(id int) error
- func (pg *PGLayer) GetAPIKeyByID(ctx context.Context, id uuid.UUID) (*models.APIKey, error)
- func (pg *PGLayer) GetAPIKeyByToken(ctx context.Context, token uuid.UUID) (*models.APIKey, error)
- func (pg *PGLayer) GetAPIKeysByGithubUser(ctx context.Context, githubUser string) ([]*models.APIKey, error)
- func (pg *PGLayer) GetEventLogByDeliveryID(deliveryID uuid.UUID) (*models.EventLog, error)
- func (pg *PGLayer) GetEventLogByID(id uuid.UUID) (*models.EventLog, error)
- func (pg *PGLayer) GetEventLogsByEnvName(name string) ([]models.EventLog, error)
- func (pg *PGLayer) GetEventLogsByRepoAndPR(repo string, pr uint) ([]models.EventLog, error)
- func (pg *PGLayer) GetEventStatus(id uuid.UUID) (*models.EventStatusSummary, error)
- func (p *PGLayer) GetExtantQAEnvironments(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
- func (pg *PGLayer) GetHelmReleasesForEnv(ctx context.Context, name string) ([]models.HelmRelease, error)
- func (pg *PGLayer) GetK8sEnv(ctx context.Context, name string) (*models.KubernetesEnvironment, error)
- func (pg *PGLayer) GetK8sEnvsByNamespace(ctx context.Context, ns string) ([]models.KubernetesEnvironment, error)
- func (p *PGLayer) GetMostRecent(ctx context.Context, n uint) ([]QAEnvironment, error)
- func (p *PGLayer) GetMostRecentForUser(ctx context.Context, user string, n uint) ([]QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironment(ctx context.Context, name string) (*QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentBySourceSHA(ctx context.Context, sourceSHA string) (*QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentConsistently(ctx context.Context, name string) (*QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentsByRepo(ctx context.Context, repo string) ([]QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentsByRepoAndPR(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentsBySourceBranch(ctx context.Context, sourceBranch string) ([]QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentsByStatus(ctx context.Context, status string) ([]QAEnvironment, error)
- func (p *PGLayer) GetQAEnvironmentsByUser(ctx context.Context, user string) ([]QAEnvironment, error)
- func (p *PGLayer) GetRunningQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
- func (pg *PGLayer) GetUISession(id int) (*models.UISession, error)
- func (p *PGLayer) RenameQAEnvironment(ctx context.Context, id int64, newName string) error
- func (p *PGLayer) Search(ctx context.Context, opts models.EnvSearchParameters) ([]QAEnvironment, error)
- func (p *PGLayer) SearchEnvsForUser(ctx context.Context, user string, opts models.EnvSearchParameters) ([]QAEnvironment, error)
- func (p *PGLayer) SetAminoEnvironmentID(ctx context.Context, name string, did int) error
- func (p *PGLayer) SetAminoKubernetesNamespace(ctx context.Context, name string, namespace string) error
- func (p *PGLayer) SetAminoServiceToPort(ctx context.Context, name string, serviceToPort map[string]int64) error
- func (pg *PGLayer) SetEventLogEnvName(id uuid.UUID, name string) error
- func (pg *PGLayer) SetEventStatus(id uuid.UUID, status models.EventStatusSummary) error
- func (pg *PGLayer) SetEventStatusChartCompleted(id uuid.UUID, name string, status models.NodeChartStatus) error
- func (pg *PGLayer) SetEventStatusChartStarted(id uuid.UUID, name string, status models.NodeChartStatus) error
- func (pg *PGLayer) SetEventStatusCompleted(id uuid.UUID, configStatus models.EventStatus) error
- func (pg *PGLayer) SetEventStatusConfig(id uuid.UUID, processingTime time.Duration, refmap map[string]string) error
- func (pg *PGLayer) SetEventStatusConfigK8sNS(id uuid.UUID, ns string) error
- func (pg *PGLayer) SetEventStatusFailed(id uuid.UUID, ce metahelmlib.ChartError) error
- func (pg *PGLayer) SetEventStatusImageBuildID(id uuid.UUID, name string, furanBuildID guuid.UUID) error
- func (pg *PGLayer) SetEventStatusImageCompleted(id uuid.UUID, name string, err bool) error
- func (pg *PGLayer) SetEventStatusImageStarted(id uuid.UUID, name string) error
- func (pg *PGLayer) SetEventStatusRenderedStatus(id uuid.UUID, rstatus models.RenderedEventStatus) error
- func (pg *PGLayer) SetEventStatusTree(id uuid.UUID, tree map[string]models.EventStatusTreeNode) error
- func (p *PGLayer) SetQAEnvironmentCommitSHAMap(ctx context.Context, name string, commitSHAMap RefMap) error
- func (p *PGLayer) SetQAEnvironmentCreated(ctx context.Context, name string, created time.Time) error
- func (p *PGLayer) SetQAEnvironmentRefMap(ctx context.Context, name string, refMap RefMap) error
- func (p *PGLayer) SetQAEnvironmentRepoData(ctx context.Context, name string, repo *RepoRevisionData) error
- func (p *PGLayer) SetQAEnvironmentStatus(ctx context.Context, name string, status EnvironmentStatus) error
- func (pg *PGLayer) UpdateAPIKeyLastUsed(ctx context.Context, token uuid.UUID) error
- func (pg *PGLayer) UpdateHelmReleaseRevision(ctx context.Context, envname, release, revision string) error
- func (pg *PGLayer) UpdateK8sEnvConfigSignature(ctx context.Context, name string, confSig [32]byte) error
- func (pg *PGLayer) UpdateUISession(id int, githubUser string, encryptedtoken []byte, authenticated bool) error
- type QADestroyReason
- type QAEnvironment
- type QAEnvironmentEvent
- type QAEnvironments
- type QAType
- type RefMap
- type RepoRevisionData
- type ServerConfig
- type UISessionsDataLayer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyDataLayer ¶ added in v0.8.0
type APIKeyDataLayer interface { CreateAPIKey(ctx context.Context, permissionLevel models.PermissionLevel, description, githubUser string) (uuid.UUID, error) GetAPIKeyByToken(ctx context.Context, token uuid.UUID) (*models.APIKey, error) GetAPIKeyByID(ctx context.Context, id uuid.UUID) (*models.APIKey, error) GetAPIKeysByGithubUser(ctx context.Context, githubUser string) ([]*models.APIKey, error) UpdateAPIKeyLastUsed(ctx context.Context, token uuid.UUID) error DeleteAPIKeyByID(ctx context.Context, id uuid.UUID) error }
type Cleaner ¶
type Cleaner struct { // DB must be an initialized SQL client DB *sqlx.DB // Maximum ages for old DB records DestroyedEnvRecordsMaxAge, EventLogsMaxAge time.Duration // LogFunc is a function that logs a formatted string somewhere LogFunc func(string, ...interface{}) }
Cleaner is an object that performs data model clean up operations
func (*Cleaner) PruneDestroyedEnvRecords ¶
PruneDestroyedEnvRecords deletes all QAEnvironment records with status Destroyed or Failed with a Created timestamp earlier than time.Now() - olderThan. olderThan must be > 0
type DataLayer ¶
type DataLayer interface { CreateQAEnvironment(context.Context, *QAEnvironment) error GetQAEnvironment(context.Context, string) (*QAEnvironment, error) GetQAEnvironmentConsistently(context.Context, string) (*QAEnvironment, error) GetQAEnvironments(context.Context) ([]QAEnvironment, error) DeleteQAEnvironment(context.Context, string) error RenameQAEnvironment(ctx context.Context, id int64, newName string) error GetQAEnvironmentsByStatus(ctx context.Context, status string) ([]QAEnvironment, error) GetRunningQAEnvironments(context.Context) ([]QAEnvironment, error) GetQAEnvironmentsByRepoAndPR(context.Context, string, uint) ([]QAEnvironment, error) GetQAEnvironmentsByRepo(ctx context.Context, repo string) ([]QAEnvironment, error) GetQAEnvironmentBySourceSHA(ctx context.Context, sourceSHA string) (*QAEnvironment, error) GetQAEnvironmentsBySourceBranch(ctx context.Context, sourceBranch string) ([]QAEnvironment, error) GetQAEnvironmentsByUser(ctx context.Context, user string) ([]QAEnvironment, error) SetQAEnvironmentStatus(context.Context, string, EnvironmentStatus) error SetQAEnvironmentRepoData(context.Context, string, *RepoRevisionData) error SetQAEnvironmentRefMap(context.Context, string, RefMap) error SetQAEnvironmentCommitSHAMap(context.Context, string, RefMap) error SetQAEnvironmentCreated(context.Context, string, time.Time) error GetExtantQAEnvironments(context.Context, string, uint) ([]QAEnvironment, error) SetAminoEnvironmentID(ctx context.Context, name string, did int) error SetAminoServiceToPort(ctx context.Context, name string, serviceToPort map[string]int64) error SetAminoKubernetesNamespace(ctx context.Context, name, namespace string) error AddEvent(context.Context, string, string) error Search(ctx context.Context, opts models.EnvSearchParameters) ([]QAEnvironment, error) SearchEnvsForUser(ctx context.Context, user string, opts models.EnvSearchParameters) ([]QAEnvironment, error) GetMostRecent(ctx context.Context, n uint) ([]QAEnvironment, error) GetMostRecentForUser(ctx context.Context, user string, n uint) ([]QAEnvironment, error) Close() error HelmDataLayer K8sEnvDataLayer EventLoggerDataLayer UISessionsDataLayer APIKeyDataLayer }
DataLayer describes an object that interacts with the persistant data store
type EnvironmentStatus ¶
type EnvironmentStatus = models.EnvironmentStatus
type EventLoggerDataLayer ¶
type EventLoggerDataLayer interface { GetEventLogByID(id uuid.UUID) (*models.EventLog, error) GetEventLogByDeliveryID(deliveryID uuid.UUID) (*models.EventLog, error) GetEventLogsByEnvName(name string) ([]models.EventLog, error) GetEventLogsByRepoAndPR(repo string, pr uint) ([]models.EventLog, error) CreateEventLog(elog *models.EventLog) error SetEventLogEnvName(id uuid.UUID, name string) error AppendToEventLog(id uuid.UUID, msg string) error DeleteEventLog(id uuid.UUID) error DeleteEventLogsByEnvName(name string) (uint, error) DeleteEventLogsByRepoAndPR(repo string, pr uint) (uint, error) SetEventStatus(id uuid.UUID, status models.EventStatusSummary) error SetEventStatusConfig(id uuid.UUID, processingTime time.Duration, refmap map[string]string) error SetEventStatusConfigK8sNS(id uuid.UUID, ns string) error SetEventStatusTree(id uuid.UUID, tree map[string]models.EventStatusTreeNode) error SetEventStatusCompleted(id uuid.UUID, configStatus models.EventStatus) error SetEventStatusImageStarted(id uuid.UUID, name string) error SetEventStatusImageBuildID(id uuid.UUID, name string, furanBuildID guuid.UUID) error SetEventStatusImageCompleted(id uuid.UUID, name string, err bool) error SetEventStatusChartStarted(id uuid.UUID, name string, status models.NodeChartStatus) error SetEventStatusChartCompleted(id uuid.UUID, name string, status models.NodeChartStatus) error GetEventStatus(id uuid.UUID) (*models.EventStatusSummary, error) SetEventStatusRenderedStatus(id uuid.UUID, rstatus models.RenderedEventStatus) error SetEventStatusFailed(id uuid.UUID, ce metahelmlib.ChartError) error }
EventLoggerDataLayer desribes an object that stores event log data
type FakeDataLayer ¶
type FakeDataLayer struct { CreateMissingEventLog bool // contains filtered or unexported fields }
FakeDataLayer is a fake implementation of DataLayer that persists data in-memory, for testing purposes
func NewDelayedFakeDataLayer ¶ added in v0.7.0
func NewDelayedFakeDataLayer(delay time.Duration) *FakeDataLayer
func NewFakeDataLayer ¶
func NewFakeDataLayer() *FakeDataLayer
func NewPopulatedFakeDataLayer ¶
func NewPopulatedFakeDataLayer(qaenvs []models.QAEnvironment, k8senvs []models.KubernetesEnvironment, helmreleases []models.HelmRelease, apikeys []models.APIKey) *FakeDataLayer
NewPopulatedFakeDataLayer returns a FakeDataLayer populated with the supplied data. Input data is not checked for consistency.
func (*FakeDataLayer) AppendToEventLog ¶
func (fdl *FakeDataLayer) AppendToEventLog(id uuid.UUID, msg string) error
func (*FakeDataLayer) Close ¶
func (fdl *FakeDataLayer) Close() error
func (*FakeDataLayer) CreateAPIKey ¶ added in v0.8.0
func (fdl *FakeDataLayer) CreateAPIKey(ctx context.Context, permissionLevel models.PermissionLevel, description, githubUser string) (uuid.UUID, error)
func (*FakeDataLayer) CreateEventLog ¶
func (fdl *FakeDataLayer) CreateEventLog(elog *models.EventLog) error
func (*FakeDataLayer) CreateHelmReleasesForEnv ¶
func (fdl *FakeDataLayer) CreateHelmReleasesForEnv(ctx context.Context, releases []models.HelmRelease) error
func (*FakeDataLayer) CreateK8sEnv ¶
func (fdl *FakeDataLayer) CreateK8sEnv(ctx context.Context, env *models.KubernetesEnvironment) error
func (*FakeDataLayer) CreateQAEnvironment ¶
func (fdl *FakeDataLayer) CreateQAEnvironment(ctx context.Context, qa *QAEnvironment) error
func (*FakeDataLayer) CreateUISession ¶ added in v0.7.6
func (*FakeDataLayer) DeleteAPIKeyByID ¶ added in v0.9.2
func (*FakeDataLayer) DeleteEventLog ¶
func (fdl *FakeDataLayer) DeleteEventLog(id uuid.UUID) error
func (*FakeDataLayer) DeleteEventLogsByEnvName ¶
func (fdl *FakeDataLayer) DeleteEventLogsByEnvName(name string) (uint, error)
func (*FakeDataLayer) DeleteEventLogsByRepoAndPR ¶
func (fdl *FakeDataLayer) DeleteEventLogsByRepoAndPR(repo string, pr uint) (uint, error)
func (*FakeDataLayer) DeleteExpiredUISessions ¶ added in v0.7.6
func (fdl *FakeDataLayer) DeleteExpiredUISessions() (uint, error)
func (*FakeDataLayer) DeleteHelmReleasesForEnv ¶
func (*FakeDataLayer) DeleteK8sEnv ¶
func (fdl *FakeDataLayer) DeleteK8sEnv(ctx context.Context, name string) error
func (*FakeDataLayer) DeleteQAEnvironment ¶
func (fdl *FakeDataLayer) DeleteQAEnvironment(ctx context.Context, name string) error
func (*FakeDataLayer) DeleteUISession ¶ added in v0.7.6
func (fdl *FakeDataLayer) DeleteUISession(id int) error
func (*FakeDataLayer) GetAPIKeyByID ¶ added in v0.9.2
func (*FakeDataLayer) GetAPIKeyByToken ¶ added in v0.9.2
func (*FakeDataLayer) GetAPIKeysByGithubUser ¶ added in v0.8.0
func (*FakeDataLayer) GetEventLogByDeliveryID ¶ added in v0.7.6
func (*FakeDataLayer) GetEventLogByID ¶
func (*FakeDataLayer) GetEventLogsByEnvName ¶
func (fdl *FakeDataLayer) GetEventLogsByEnvName(name string) ([]models.EventLog, error)
func (*FakeDataLayer) GetEventLogsByRepoAndPR ¶
func (*FakeDataLayer) GetEventStatus ¶ added in v0.7.5
func (fdl *FakeDataLayer) GetEventStatus(id uuid.UUID) (*models.EventStatusSummary, error)
func (*FakeDataLayer) GetExtantQAEnvironments ¶
func (fdl *FakeDataLayer) GetExtantQAEnvironments(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
func (*FakeDataLayer) GetHelmReleasesForEnv ¶
func (fdl *FakeDataLayer) GetHelmReleasesForEnv(ctx context.Context, name string) ([]models.HelmRelease, error)
func (*FakeDataLayer) GetK8sEnv ¶
func (fdl *FakeDataLayer) GetK8sEnv(ctx context.Context, name string) (*models.KubernetesEnvironment, error)
func (*FakeDataLayer) GetK8sEnvsByNamespace ¶
func (fdl *FakeDataLayer) GetK8sEnvsByNamespace(ctx context.Context, ns string) ([]models.KubernetesEnvironment, error)
func (*FakeDataLayer) GetMostRecent ¶
func (fdl *FakeDataLayer) GetMostRecent(ctx context.Context, n uint) ([]QAEnvironment, error)
func (*FakeDataLayer) GetMostRecentForUser ¶ added in v0.9.2
func (fdl *FakeDataLayer) GetMostRecentForUser(ctx context.Context, user string, n uint) ([]QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironment ¶
func (fdl *FakeDataLayer) GetQAEnvironment(ctx context.Context, name string) (*QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentBySourceSHA ¶
func (fdl *FakeDataLayer) GetQAEnvironmentBySourceSHA(ctx context.Context, sourceSHA string) (*QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentConsistently ¶
func (fdl *FakeDataLayer) GetQAEnvironmentConsistently(ctx context.Context, name string) (*QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironments ¶
func (fdl *FakeDataLayer) GetQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentsByRepo ¶
func (fdl *FakeDataLayer) GetQAEnvironmentsByRepo(ctx context.Context, repo string) ([]QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentsByRepoAndPR ¶
func (fdl *FakeDataLayer) GetQAEnvironmentsByRepoAndPR(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentsBySourceBranch ¶
func (fdl *FakeDataLayer) GetQAEnvironmentsBySourceBranch(ctx context.Context, sourceBranch string) ([]QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentsByStatus ¶
func (fdl *FakeDataLayer) GetQAEnvironmentsByStatus(ctx context.Context, status string) ([]QAEnvironment, error)
func (*FakeDataLayer) GetQAEnvironmentsByUser ¶
func (fdl *FakeDataLayer) GetQAEnvironmentsByUser(ctx context.Context, user string) ([]QAEnvironment, error)
func (*FakeDataLayer) GetRunningQAEnvironments ¶
func (fdl *FakeDataLayer) GetRunningQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
func (*FakeDataLayer) GetUISession ¶ added in v0.7.6
func (fdl *FakeDataLayer) GetUISession(id int) (*models.UISession, error)
func (*FakeDataLayer) Load ¶
func (fdl *FakeDataLayer) Load(dir string) error
Load reads JSON files in dir and loads them, overwriting any existing data
func (*FakeDataLayer) NewFakeCreateEvent ¶ added in v0.7.6
func (*FakeDataLayer) NewFakeEvent ¶ added in v0.7.6
func (fdl *FakeDataLayer) NewFakeEvent(started time.Time, repo, user, envname string, etype models.EventStatusType, success bool) uuid.UUID
func (*FakeDataLayer) RenameQAEnvironment ¶ added in v0.9.2
func (*FakeDataLayer) Save ¶
func (fdl *FakeDataLayer) Save(dir string) ([]string, error)
Save writes all data to files in dir and returns the filenames, or error
func (*FakeDataLayer) Search ¶
func (fdl *FakeDataLayer) Search(ctx context.Context, opts models.EnvSearchParameters) ([]QAEnvironment, error)
func (*FakeDataLayer) SearchEnvsForUser ¶ added in v0.9.2
func (fdl *FakeDataLayer) SearchEnvsForUser(ctx context.Context, user string, opts models.EnvSearchParameters) ([]QAEnvironment, error)
func (*FakeDataLayer) SetAminoEnvironmentID ¶
func (*FakeDataLayer) SetAminoKubernetesNamespace ¶
func (fdl *FakeDataLayer) SetAminoKubernetesNamespace(ctx context.Context, name, namespace string) error
func (*FakeDataLayer) SetAminoServiceToPort ¶
func (*FakeDataLayer) SetDelay ¶ added in v0.7.0
func (fdl *FakeDataLayer) SetDelay(d time.Duration)
func (*FakeDataLayer) SetEventLogEnvName ¶
func (fdl *FakeDataLayer) SetEventLogEnvName(id uuid.UUID, name string) error
func (*FakeDataLayer) SetEventStatus ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatus(id uuid.UUID, status models.EventStatusSummary) error
func (*FakeDataLayer) SetEventStatusChartCompleted ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusChartCompleted(id uuid.UUID, name string, status models.NodeChartStatus) error
func (*FakeDataLayer) SetEventStatusChartStarted ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusChartStarted(id uuid.UUID, name string, status models.NodeChartStatus) error
func (*FakeDataLayer) SetEventStatusCompleted ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusCompleted(id uuid.UUID, status models.EventStatus) error
func (*FakeDataLayer) SetEventStatusConfig ¶ added in v0.7.5
func (*FakeDataLayer) SetEventStatusConfigK8sNS ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusConfigK8sNS(id uuid.UUID, ns string) error
func (*FakeDataLayer) SetEventStatusFailed ¶ added in v0.8.0
func (fdl *FakeDataLayer) SetEventStatusFailed(id uuid.UUID, ce metahelmlib.ChartError) error
func (*FakeDataLayer) SetEventStatusImageBuildID ¶ added in v0.9.3
func (*FakeDataLayer) SetEventStatusImageCompleted ¶ added in v0.7.5
func (*FakeDataLayer) SetEventStatusImageStarted ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusImageStarted(id uuid.UUID, name string) error
func (*FakeDataLayer) SetEventStatusRenderedStatus ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusRenderedStatus(id uuid.UUID, rstatus models.RenderedEventStatus) error
func (*FakeDataLayer) SetEventStatusTree ¶ added in v0.7.5
func (fdl *FakeDataLayer) SetEventStatusTree(id uuid.UUID, tree map[string]models.EventStatusTreeNode) error
func (*FakeDataLayer) SetQAEnvironmentCommitSHAMap ¶
func (*FakeDataLayer) SetQAEnvironmentCreated ¶
func (*FakeDataLayer) SetQAEnvironmentRefMap ¶
func (*FakeDataLayer) SetQAEnvironmentRepoData ¶
func (fdl *FakeDataLayer) SetQAEnvironmentRepoData(ctx context.Context, name string, rrd *RepoRevisionData) error
func (*FakeDataLayer) SetQAEnvironmentStatus ¶
func (fdl *FakeDataLayer) SetQAEnvironmentStatus(ctx context.Context, name string, status EnvironmentStatus) error
func (*FakeDataLayer) UpdateAPIKeyLastUsed ¶ added in v0.8.0
func (*FakeDataLayer) UpdateHelmReleaseRevision ¶
func (fdl *FakeDataLayer) UpdateHelmReleaseRevision(ctx context.Context, envname, release, revision string) error
func (*FakeDataLayer) UpdateK8sEnvConfigSignature ¶ added in v0.7.6
func (*FakeDataLayer) UpdateUISession ¶ added in v0.7.6
type HelmDataLayer ¶
type HelmDataLayer interface { GetHelmReleasesForEnv(ctx context.Context, name string) ([]models.HelmRelease, error) UpdateHelmReleaseRevision(ctx context.Context, envname, release, revision string) error CreateHelmReleasesForEnv(ctx context.Context, releases []models.HelmRelease) error DeleteHelmReleasesForEnv(ctx context.Context, name string) (uint, error) }
HelmDataLayer describes an object that stores data about Helm
type K8sEnvDataLayer ¶
type K8sEnvDataLayer interface { GetK8sEnv(ctx context.Context, name string) (*models.KubernetesEnvironment, error) GetK8sEnvsByNamespace(ctx context.Context, ns string) ([]models.KubernetesEnvironment, error) CreateK8sEnv(ctx context.Context, env *models.KubernetesEnvironment) error DeleteK8sEnv(ctx context.Context, name string) error UpdateK8sEnvConfigSignature(ctx context.Context, name string, confSig [32]byte) error }
K8sEnvDataLayer describes an object that stores data about the K8s environment details
type LogFunc ¶
type LogFunc func(string, ...interface{})
LogFunc is a function that logs a formatted string somewhere
type MetricsCollector ¶
type PGLayer ¶
type PGLayer struct {
// contains filtered or unexported fields
}
PGLayer contains the data layer implementation for a Postgres database.
func NewPGLayer ¶
NewPGLayer instantiates a new PGLayer.
func (*PGLayer) AppendToEventLog ¶
AppendToEventLog appends a new log line to an EventLog
func (*PGLayer) CreateAPIKey ¶ added in v0.8.0
func (pg *PGLayer) CreateAPIKey(ctx context.Context, permissionLevel models.PermissionLevel, description, githubUser string) (uuid.UUID, error)
CreateAPIKey creates a new user api key
func (*PGLayer) CreateEventLog ¶
CreateEventLog creates a new EventLog. If elog.EnvName is an empty string, null will be persisted in the database for that column.
func (*PGLayer) CreateHelmReleasesForEnv ¶
func (*PGLayer) CreateK8sEnv ¶
CreateK8sEnv inserts a new k8s environment into the DB
func (*PGLayer) CreateQAEnvironment ¶
func (p *PGLayer) CreateQAEnvironment(ctx context.Context, qae *QAEnvironment) error
CreateQAEnvironment persists a new QA record.
func (*PGLayer) CreateUISession ¶ added in v0.7.6
func (pg *PGLayer) CreateUISession(targetRoute string, state []byte, clientIP net.IP, userAgent string, expires time.Time) (int, error)
CreateUISession creates a new unauthenticated UI session and returns the ID
func (*PGLayer) DeleteAPIKeyByID ¶ added in v0.9.2
DeleteAPIKeyByID unconditionally deletes the api key for the api key record id
func (*PGLayer) DeleteEventLog ¶
DeleteEventLog deletes an EventLog
func (*PGLayer) DeleteEventLogsByEnvName ¶
DeleteEventLogsByEnvName deletes all EventLogs associated with an environment and returns the number of EventLogs deleted, or error
func (*PGLayer) DeleteEventLogsByRepoAndPR ¶
DeleteEventLogsByRepoAndPR deletes all EventLogs associated with a repo and PR and returns the number of EventLogs deleted, or error
func (*PGLayer) DeleteExpiredUISessions ¶ added in v0.7.6
DeleteExpiredUISessions deletes all expired sessions and returns the number deleted
func (*PGLayer) DeleteHelmReleasesForEnv ¶
func (*PGLayer) DeleteK8sEnv ¶
DeleteK8sEnv deletes a k8s environment from the DB
func (*PGLayer) DeleteQAEnvironment ¶
DeleteQAEnvironment deletes a QA environment record. The environment must have status Destroyed. Callers must ensure that the underlying k8s environment has been deleted prior to calling this, otherwise potentially orphan k8s resources will be left running.
func (*PGLayer) DeleteUISession ¶ added in v0.7.6
DeleteUISession unconditionally deletes the session with ID
func (*PGLayer) GetAPIKeyByID ¶ added in v0.9.2
GetAPIKeyByID returns the api key by id, nil if not found
func (*PGLayer) GetAPIKeyByToken ¶ added in v0.9.2
GetAPIKeyByToken returns the api key by token, nil if not found
func (*PGLayer) GetAPIKeysByGithubUser ¶ added in v0.8.0
func (pg *PGLayer) GetAPIKeysByGithubUser(ctx context.Context, githubUser string) ([]*models.APIKey, error)
GetAPIKeysByGithubUser returns all api keys for the github user or nil if not found
func (*PGLayer) GetEventLogByDeliveryID ¶ added in v0.7.6
func (*PGLayer) GetEventLogByID ¶
GetEventLogByID returns a single EventLog by id, or nil or error
func (*PGLayer) GetEventLogsByEnvName ¶
GetEventLogsByEnvName gets all EventLogs associated with an environment
func (*PGLayer) GetEventLogsByRepoAndPR ¶
GetEventLogsByRepoAndPR gets all EventLogs associated with a repo and PR, sorted in reverse created order (newest first)
func (*PGLayer) GetEventStatus ¶ added in v0.7.5
func (*PGLayer) GetExtantQAEnvironments ¶
func (p *PGLayer) GetExtantQAEnvironments(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
GetExtantQAEnvironments finds any environments for the given repo/PR combination that are not status Destroyed
func (*PGLayer) GetHelmReleasesForEnv ¶
func (*PGLayer) GetK8sEnv ¶
func (pg *PGLayer) GetK8sEnv(ctx context.Context, name string) (*models.KubernetesEnvironment, error)
GetK8sEnv gets a k8s environment by environment name
func (*PGLayer) GetK8sEnvsByNamespace ¶
func (pg *PGLayer) GetK8sEnvsByNamespace(ctx context.Context, ns string) ([]models.KubernetesEnvironment, error)
GetK8sEnvsByNamespace returns any KubernetesEnvironments associated with a specific namespace name
func (*PGLayer) GetMostRecent ¶
GetMostRecent finds the most recent environments from the last n days. Recency is defined by created/updated timestamps. The returned slice is in descending order of recency.
func (*PGLayer) GetMostRecentForUser ¶ added in v0.9.2
func (p *PGLayer) GetMostRecentForUser(ctx context.Context, user string, n uint) ([]QAEnvironment, error)
GetMostRecent finds the most recent environments for user from the last n days. Recency is defined by created/updated timestamps. The returned slice is in descending order of recency.
func (*PGLayer) GetQAEnvironment ¶
GetQAEnvironment finds a QAEnvironment by the name field.
func (*PGLayer) GetQAEnvironmentBySourceSHA ¶
func (p *PGLayer) GetQAEnvironmentBySourceSHA(ctx context.Context, sourceSHA string) (*QAEnvironment, error)
GetQAEnvironmentBySourceSHA returns an environment with a matching sourceSHA.
func (*PGLayer) GetQAEnvironmentConsistently ¶
func (p *PGLayer) GetQAEnvironmentConsistently(ctx context.Context, name string) (*QAEnvironment, error)
GetQAEnvironmentConsistently finds a QAEnvironment by the name field consistently. This is a legacy method from when DynamoDB was used as the datastore.
func (*PGLayer) GetQAEnvironments ¶
func (p *PGLayer) GetQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
GetQAEnvironments returns all QA records
func (*PGLayer) GetQAEnvironmentsByRepo ¶
func (p *PGLayer) GetQAEnvironmentsByRepo(ctx context.Context, repo string) ([]QAEnvironment, error)
GetQAEnvironmentsByRepo returns all environments which have matching repo.
func (*PGLayer) GetQAEnvironmentsByRepoAndPR ¶
func (p *PGLayer) GetQAEnvironmentsByRepoAndPR(ctx context.Context, repo string, pr uint) ([]QAEnvironment, error)
GetQAEnvironmentsByRepoAndPR teturns all environments which have matching repo AND pull request.
func (*PGLayer) GetQAEnvironmentsBySourceBranch ¶
func (p *PGLayer) GetQAEnvironmentsBySourceBranch(ctx context.Context, sourceBranch string) ([]QAEnvironment, error)
GetQAEnvironmentsBySourceBranch returns all environments which have matching sourceBranch.
func (*PGLayer) GetQAEnvironmentsByStatus ¶
func (p *PGLayer) GetQAEnvironmentsByStatus(ctx context.Context, status string) ([]QAEnvironment, error)
GetQAEnvironmentsByStatus gets all environmens matching status. TODO(geoffrey): Revisit raw_status with @benjamen
func (*PGLayer) GetQAEnvironmentsByUser ¶
func (p *PGLayer) GetQAEnvironmentsByUser(ctx context.Context, user string) ([]QAEnvironment, error)
GetQAEnvironmentsByUser retrieve all QAEnvironment by user (User is username in the DB see models/models.go).
func (*PGLayer) GetRunningQAEnvironments ¶
func (p *PGLayer) GetRunningQAEnvironments(ctx context.Context) ([]QAEnvironment, error)
GetRunningQAEnvironments returns all environments with status "success", "updating" or "spawned", in ascending order of creation time.
func (*PGLayer) GetUISession ¶ added in v0.7.6
GetUISession returns the session with id or nil if not found
func (*PGLayer) RenameQAEnvironment ¶ added in v0.9.2
RenameQAEnvironment renames environment id to newName consistently along with everything associated with it via foreign keys. newName must be unique or this method will fail. At the application level, the environment *must* be rebuilt immediately following this rename to keep data models and objects consistent!
func (*PGLayer) Search ¶
func (p *PGLayer) Search(ctx context.Context, opts models.EnvSearchParameters) ([]QAEnvironment, error)
Search finds environments that satisfy the parameters given. Multiple parameters are combined with implicit AND.
func (*PGLayer) SearchEnvsForUser ¶ added in v0.9.2
func (p *PGLayer) SearchEnvsForUser(ctx context.Context, user string, opts models.EnvSearchParameters) ([]QAEnvironment, error)
SearchEnvsForUser finds environments for specified user that satisfy the parameters given. Multiple parameters are combined with implicit AND.
func (*PGLayer) SetAminoEnvironmentID ¶
SetAminoEnvironmentID sets the Amino environment ID for an environment.
func (*PGLayer) SetAminoKubernetesNamespace ¶
func (p *PGLayer) SetAminoKubernetesNamespace(ctx context.Context, name string, namespace string) error
SetAminoKubernetesNamespace sets the Kubernetes namespace for an environment.
func (*PGLayer) SetAminoServiceToPort ¶
func (p *PGLayer) SetAminoServiceToPort(ctx context.Context, name string, serviceToPort map[string]int64) error
SetAminoServiceToPort sets the Amino service port metadata for an environment.
func (*PGLayer) SetEventLogEnvName ¶
SetEventLogEnvName sets the env name for an EventLog The name must be valid and exist in qa_environments or the foreign key will cause this method to return an error
func (*PGLayer) SetEventStatus ¶ added in v0.7.5
func (*PGLayer) SetEventStatusChartCompleted ¶ added in v0.7.5
func (*PGLayer) SetEventStatusChartStarted ¶ added in v0.7.5
func (*PGLayer) SetEventStatusCompleted ¶ added in v0.7.5
func (*PGLayer) SetEventStatusConfig ¶ added in v0.7.5
func (*PGLayer) SetEventStatusConfigK8sNS ¶ added in v0.7.5
func (*PGLayer) SetEventStatusFailed ¶ added in v0.8.0
func (pg *PGLayer) SetEventStatusFailed(id uuid.UUID, ce metahelmlib.ChartError) error
SetEventStatusFailed will set the event status to indicate that it has failed and will persist the ChartError.
func (*PGLayer) SetEventStatusImageBuildID ¶ added in v0.9.3
func (*PGLayer) SetEventStatusImageCompleted ¶ added in v0.7.5
func (*PGLayer) SetEventStatusImageStarted ¶ added in v0.7.5
func (*PGLayer) SetEventStatusRenderedStatus ¶ added in v0.7.5
func (*PGLayer) SetEventStatusTree ¶ added in v0.7.5
func (*PGLayer) SetQAEnvironmentCommitSHAMap ¶
func (p *PGLayer) SetQAEnvironmentCommitSHAMap(ctx context.Context, name string, commitSHAMap RefMap) error
SetQAEnvironmentCommitSHAMap sets a specific QAEnvironment's commitSHAMap.
func (*PGLayer) SetQAEnvironmentCreated ¶
func (p *PGLayer) SetQAEnvironmentCreated(ctx context.Context, name string, created time.Time) error
SetQAEnvironmentCreated sets a specific QAEnvironment's created time.
func (*PGLayer) SetQAEnvironmentRefMap ¶
SetQAEnvironmentRefMap sets a specific QAEnvironment's RefMap.
func (*PGLayer) SetQAEnvironmentRepoData ¶
func (p *PGLayer) SetQAEnvironmentRepoData(ctx context.Context, name string, repo *RepoRevisionData) error
SetQAEnvironmentRepoData sets a specific QAEnvironment's RepoRevisionData.
func (*PGLayer) SetQAEnvironmentStatus ¶
func (p *PGLayer) SetQAEnvironmentStatus(ctx context.Context, name string, status EnvironmentStatus) error
SetQAEnvironmentStatus sets a specific QAEnvironment's status. This method is unique in that callers often call this in cases where a root operation context is likely to be canceled. Because of this, it often makes sense to pass the background context, or a newly created child of the background context, to this function. For convenience, we set a default operation timeout to make sure that even if the caller passed the background context, we can prevent this function from waiting indefinitely.
func (*PGLayer) UpdateAPIKeyLastUsed ¶ added in v0.8.0
UpdateAPIKeyLastUsed updates the last used field for the api key token
func (*PGLayer) UpdateHelmReleaseRevision ¶
type QADestroyReason ¶
type QADestroyReason = models.QADestroyReason
type QAEnvironment ¶
type QAEnvironment = models.QAEnvironment
type QAEnvironmentEvent ¶
type QAEnvironmentEvent = models.QAEnvironmentEvent
type QAEnvironments ¶
type QAEnvironments = models.QAEnvironments
type RepoRevisionData ¶
type RepoRevisionData = models.RepoRevisionData
type ServerConfig ¶
type ServerConfig = config.ServerConfig
type UISessionsDataLayer ¶ added in v0.7.6
type UISessionsDataLayer interface { CreateUISession(targetRoute string, state []byte, clientIP net.IP, userAgent string, expires time.Time) (int, error) UpdateUISession(id int, githubUser string, encryptedtoken []byte, authenticated bool) error DeleteUISession(id int) error GetUISession(id int) (*models.UISession, error) DeleteExpiredUISessions() (uint, error) }