postgres

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetCNCFEntityAffiliations

func GetCNCFEntityAffiliations(ctx context.Context) (map[string]*data.CNCFDeveloper, error)

func UpdateDevelopersWithCNCFEntityAffiliations

func UpdateDevelopersWithCNCFEntityAffiliations(ctx context.Context, store data.DeveloperStore, entityStore data.EntityStore, client *http.Client) (*data.AffiliationImportResult, error)

UpdateDevelopersWithCNCFEntityAffiliations updates the developers with the CNCF entity affiliations. It accepts a data.DeveloperStore so it can be used with any Store implementation.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements data.Store for PostgreSQL.

func New

func New(dsn string) (*Store, error)

New creates a new PostgreSQL Store, running migrations automatically.

func (*Store) ApplySubstitutions

func (s *Store) ApplySubstitutions() ([]*data.Substitution, error)

func (*Store) CleanEntities

func (s *Store) CleanEntities() error

func (*Store) ClearState

func (s *Store) ClearState(org, repo string) error

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying database connection pool.

func (*Store) ComputeDeepReputation

func (s *Store) ComputeDeepReputation(ctx context.Context, token, username string) (*data.UserReputation, error)

func (*Store) DB

func (s *Store) DB() *sql.DB

DB returns the underlying *sql.DB for cases that need direct access.

func (*Store) DeleteRepoData

func (s *Store) DeleteRepoData(org, repo string) (*data.DeleteResult, error)

func (*Store) GetAllOrgRepos

func (s *Store) GetAllOrgRepos() ([]*data.OrgRepoItem, error)

func (*Store) GetChangeFailureRate

func (s *Store) GetChangeFailureRate(org, repo, entity *string, months int) (*data.ChangeFailureRateSeries, error)

func (*Store) GetContainerActivity

func (s *Store) GetContainerActivity(org, repo *string, months int) (*data.ContainerActivitySeries, error)

func (*Store) GetContributorFunnel

func (s *Store) GetContributorFunnel(org, repo, entity *string, months int) (*data.ContributorFunnelSeries, error)

func (*Store) GetContributorMomentum

func (s *Store) GetContributorMomentum(org, repo, entity *string, months int) (*data.MomentumSeries, error)

func (*Store) GetContributorProfile

func (s *Store) GetContributorProfile(username string, org, repo, entity *string, months int) (*data.ContributorProfileSeries, error)

func (*Store) GetContributorRetention

func (s *Store) GetContributorRetention(org, repo, entity *string, months int) (*data.RetentionSeries, error)

func (*Store) GetDailyActivity

func (s *Store) GetDailyActivity(org, repo, entity *string, months int) (*data.DailyActivitySeries, error)

func (*Store) GetDataState

func (s *Store) GetDataState() (map[string]int64, error)

func (*Store) GetDeveloper

func (s *Store) GetDeveloper(username string) (*data.Developer, error)

func (*Store) GetDeveloperPercentages

func (s *Store) GetDeveloperPercentages(entity, org, repo *string, ex []string, months int) ([]*data.CountedItem, error)

func (*Store) GetDeveloperUsernames

func (s *Store) GetDeveloperUsernames() ([]string, error)

func (*Store) GetEntity

func (s *Store) GetEntity(val string) (*data.EntityResult, error)

func (*Store) GetEntityLike

func (s *Store) GetEntityLike(query string, limit int) ([]*data.ListItem, error)

func (*Store) GetEntityPercentages

func (s *Store) GetEntityPercentages(entity, org, repo *string, ex []string, months int) ([]*data.CountedItem, error)

func (*Store) GetEventTypeSeries

func (s *Store) GetEventTypeSeries(org, repo, entity *string, months int) (*data.EventTypeSeries, error)

func (*Store) GetForksAndActivity

func (s *Store) GetForksAndActivity(org, repo, entity *string, months int) (*data.ForksAndActivitySeries, error)

func (*Store) GetInsightsSummary

func (s *Store) GetInsightsSummary(org, repo, entity *string, months int) (*data.InsightsSummary, error)

func (*Store) GetMinEventDate

func (s *Store) GetMinEventDate(org, repo *string) (string, error)

func (*Store) GetNoFullnameDeveloperUsernames

func (s *Store) GetNoFullnameDeveloperUsernames() ([]string, error)

func (*Store) GetOrComputeDeepReputation

func (s *Store) GetOrComputeDeepReputation(ctx context.Context, token, username string) (*data.UserReputation, error)

func (*Store) GetOrgLike

func (s *Store) GetOrgLike(query string, limit int) ([]*data.ListItem, error)

func (*Store) GetPRReviewRatio

func (s *Store) GetPRReviewRatio(org, repo, entity *string, months int) (*data.PRReviewRatioSeries, error)

func (*Store) GetPRSizeDistribution

func (s *Store) GetPRSizeDistribution(org, repo, entity *string, months int) (*data.PRSizeSeries, error)

func (*Store) GetReleaseCadence

func (s *Store) GetReleaseCadence(org, repo, entity *string, months int) (*data.ReleaseCadenceSeries, error)

func (*Store) GetReleaseDownloads

func (s *Store) GetReleaseDownloads(org, repo *string, months int) (*data.ReleaseDownloadsSeries, error)

func (*Store) GetReleaseDownloadsByTag

func (s *Store) GetReleaseDownloadsByTag(org, repo *string, months int) (*data.ReleaseDownloadsByTagSeries, error)

func (*Store) GetRepoLike

func (s *Store) GetRepoLike(query string, limit int) ([]*data.ListItem, error)

func (*Store) GetRepoMetas

func (s *Store) GetRepoMetas(org, repo *string) ([]*data.RepoMeta, error)

func (*Store) GetRepoMetricHistory

func (s *Store) GetRepoMetricHistory(org, repo *string, months int) ([]*data.RepoMetricHistory, error)

func (*Store) GetRepoOverview added in v0.19.0

func (s *Store) GetRepoOverview(org *string, months int) ([]*data.RepoOverview, error)

func (*Store) GetReputationDistribution

func (s *Store) GetReputationDistribution(org, repo, entity *string, months int) (*data.ReputationDistribution, error)

func (*Store) GetReviewLatency

func (s *Store) GetReviewLatency(org, repo, entity *string, months int) (*data.ReviewLatencySeries, error)

func (*Store) GetState

func (s *Store) GetState(query, org, repo string, min time.Time) (*data.State, error)

func (*Store) GetTimeToClose

func (s *Store) GetTimeToClose(org, repo, entity *string, months int) (*data.VelocitySeries, error)

func (*Store) GetTimeToMerge

func (s *Store) GetTimeToMerge(org, repo, entity *string, months int) (*data.VelocitySeries, error)

func (*Store) GetTimeToRestoreBugs

func (s *Store) GetTimeToRestoreBugs(org, repo, entity *string, months int) (*data.VelocitySeries, error)

func (*Store) ImportAllContainerVersions

func (s *Store) ImportAllContainerVersions(ctx context.Context, token string) error

func (*Store) ImportAllReleases

func (s *Store) ImportAllReleases(ctx context.Context, token string) error

func (*Store) ImportAllRepoMeta

func (s *Store) ImportAllRepoMeta(ctx context.Context, token string) error

func (*Store) ImportAllRepoMetricHistory

func (s *Store) ImportAllRepoMetricHistory(ctx context.Context, token string) error

func (*Store) ImportContainerVersions

func (s *Store) ImportContainerVersions(ctx context.Context, token, org, repo string) error

func (*Store) ImportDeepReputation

func (s *Store) ImportDeepReputation(ctx context.Context, tokenFn data.TokenFunc, limit, staleHours int, org, repo *string) (*data.DeepReputationResult, error)

func (*Store) ImportEvents

func (s *Store) ImportEvents(ctx context.Context, token, owner, repo string, months int) (map[string]int, *data.ImportSummary, error)

func (*Store) ImportReleases

func (s *Store) ImportReleases(ctx context.Context, token, owner, repo string) error

func (*Store) ImportRepoMeta

func (s *Store) ImportRepoMeta(ctx context.Context, token, owner, repo string) error

func (*Store) ImportRepoMetricHistory

func (s *Store) ImportRepoMetricHistory(ctx context.Context, token, owner, repo string) error

func (*Store) ImportReputation

func (s *Store) ImportReputation(org, repo *string) (*data.ReputationResult, error)

func (*Store) MergeDeveloper

func (s *Store) MergeDeveloper(ctx context.Context, client *http.Client, username string, cDev *data.CNCFDeveloper) (*data.Developer, error)

func (*Store) QueryEntities

func (s *Store) QueryEntities(val string, limit int) ([]*data.CountedItem, error)

func (*Store) SaveAndApplyDeveloperSub

func (s *Store) SaveAndApplyDeveloperSub(prop, old, new string) (*data.Substitution, error)

func (*Store) SaveDevelopers

func (s *Store) SaveDevelopers(devs []*data.Developer) error

func (*Store) SaveState

func (s *Store) SaveState(query, org, repo string, state *data.State) error

func (*Store) SearchDeveloperUsernames

func (s *Store) SearchDeveloperUsernames(query string, org, repo *string, months, limit int) ([]string, error)

func (*Store) SearchDevelopers

func (s *Store) SearchDevelopers(val string, limit int) ([]*data.DeveloperListItem, error)

func (*Store) SearchEvents

func (s *Store) SearchEvents(q *data.EventSearchCriteria) ([]*data.EventDetails, error)

func (*Store) UpdateDeveloperNames

func (s *Store) UpdateDeveloperNames(devs map[string]string) error

func (*Store) UpdateEvents

func (s *Store) UpdateEvents(ctx context.Context, token string, concurrency int) (map[string]int, error)

Jump to

Keyboard shortcuts

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