Versions in this module Expand all Collapse all v0 v0.20.0 Oct 3, 2024 v0.19.0 Oct 3, 2024 v0.18.1 Sep 16, 2024 v0.18.0 Sep 12, 2024 Changes in this version + func NewDbConnection(cfg *Config, logger *zap.SugaredLogger) (*pg.DB, error) + type AppRelease struct + AppId int + ChangeSizeLineAdded int + ChangeSizeLineDeleted int + CiArtifactId int + CreatedTime time.Time + EnvironmentId int + Id int + LeadTime *LeadTime + PipelineOverrideId int + ProcessStage ProcessStage + ReleaseId int + ReleaseStatus ReleaseStatus + ReleaseType ReleaseType + TriggerTime time.Time + UpdatedTime time.Time + type AppReleaseRepository interface + CheckDuplicateRelease func(appId, environmentId, ciArtifactId int) (bool, error) + CleanAppDataForEnvironment func(appId, environmentId int) error + GetPreviousRelease func(appId, environmentId int, appReleaseId int) (*AppRelease, error) + GetPreviousReleaseWithinTime func(appId, environmentId int, within time.Time, currentAppReleaseId int) (*AppRelease, error) + GetReleaseBetween func(appId, environmentId int, from time.Time, to time.Time) ([]AppRelease, error) + Save func(appRelease *AppRelease) (*AppRelease, error) + Update func(appRelease *AppRelease) (*AppRelease, error) + type AppReleaseRepositoryImpl struct + func NewAppReleaseRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger, ...) *AppReleaseRepositoryImpl + func (impl *AppReleaseRepositoryImpl) CheckDuplicateRelease(appId, environmentId, ciArtifactId int) (bool, error) + func (impl *AppReleaseRepositoryImpl) CleanAppDataForEnvironment(appId, environmentId int) error + func (impl *AppReleaseRepositoryImpl) GetPreviousRelease(appId, environmentId int, appReleaseId int) (*AppRelease, error) + func (impl *AppReleaseRepositoryImpl) GetPreviousReleaseWithinTime(appId, environmentId int, within time.Time, currentAppReleaseId int) (*AppRelease, error) + func (impl *AppReleaseRepositoryImpl) GetReleaseBetween(appId, environmentId int, from time.Time, to time.Time) ([]AppRelease, error) + func (impl *AppReleaseRepositoryImpl) Save(appRelease *AppRelease) (*AppRelease, error) + func (impl *AppReleaseRepositoryImpl) Update(appRelease *AppRelease) (*AppRelease, error) + type Config struct + Addr string + ApplicationName string + Database string + LogQuery bool + Password string + Port string + User string + func GetConfig() (*Config, error) + type LeadTime struct + AppRelease *AppRelease + AppReleaseId int + CommitHash string + CommitTime time.Time + Id int + LeadTime time.Duration + PipelineMaterialId int + type LeadTimeRepository interface + CleanAppDataForEnvironment func(appId, environmentId int, tx *pg.Tx) error + FindByIds func(ids []int) ([]LeadTime, error) + Save func(leadTime *LeadTime) (*LeadTime, error) + type LeadTimeRepositoryImpl struct + func NewLeadTimeRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *LeadTimeRepositoryImpl + func (impl *LeadTimeRepositoryImpl) CleanAppDataForEnvironment(appId, environmentId int, tx *pg.Tx) error + func (impl *LeadTimeRepositoryImpl) FindByIds(ids []int) ([]LeadTime, error) + func (impl *LeadTimeRepositoryImpl) Save(leadTime *LeadTime) (*LeadTime, error) + type PipelineMaterial struct + AppRelease *AppRelease + AppReleaseId int + CommitHash string + PipelineMaterialId int + type PipelineMaterialRepository interface + CleanAppDataForEnvironment func(appId, environmentId int, tx *pg.Tx) error + FindByAppReleaseId func(appReleaseId int) ([]*PipelineMaterial, error) + FindByAppReleaseIds func(appReleaseIds []int) ([]*PipelineMaterial, error) + Save func(pipelineMaterial ...*PipelineMaterial) error + type PipelineMaterialRepositoryImpl struct + func NewPipelineMaterialRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *PipelineMaterialRepositoryImpl + func (impl *PipelineMaterialRepositoryImpl) CleanAppDataForEnvironment(appId, environmentId int, tx *pg.Tx) error + func (impl *PipelineMaterialRepositoryImpl) FindByAppReleaseId(appReleaseId int) ([]*PipelineMaterial, error) + func (impl *PipelineMaterialRepositoryImpl) FindByAppReleaseIds(appReleaseIds []int) ([]*PipelineMaterial, error) + func (impl *PipelineMaterialRepositoryImpl) Save(pipelineMaterial ...*PipelineMaterial) error + type ProcessStage int + const Init + const LeadTimeFetch + const ReleaseTypeDetermined + func (ProcessStage ProcessStage) String() string + type ReleaseStatus int + const Failure + const Success + func (releaseStatus ReleaseStatus) String() string + type ReleaseType int + const Patch + const RollBack + const RollForward + const Unknown + func (releaseType ReleaseType) String() string