Documentation
¶
Index ¶
- Variables
- func RunSaaSMigrations(db *sql.DB) error
- type DBTX
- type Store
- func (s *Store) ApplySubstitutions(ctx context.Context) ([]*data.Substitution, error)
- func (s *Store) CleanEntities(ctx context.Context) error
- func (s *Store) ClearState(ctx context.Context, org, repo string) error
- func (s *Store) Close() error
- func (s *Store) ComputeDeepReputation(ctx context.Context, token, username string) (*data.UserReputation, error)
- func (s *Store) DB() *sql.DB
- func (s *Store) DeleteRepoData(ctx context.Context, org, repo string) (*data.DeleteResult, error)
- func (s *Store) GetAllOrgRepos(ctx context.Context) ([]*data.OrgRepoItem, error)
- func (s *Store) GetChangeFailureRate(ctx context.Context, org, repo, entity *string, months int) (*data.ChangeFailureRateSeries, error)
- func (s *Store) GetContainerActivity(ctx context.Context, org, repo *string, months int) (*data.ContainerActivitySeries, error)
- func (s *Store) GetContributorFunnel(ctx context.Context, org, repo, entity *string, months int) (*data.ContributorFunnelSeries, error)
- func (s *Store) GetContributorMomentum(ctx context.Context, org, repo, entity *string, months int) (*data.MomentumSeries, error)
- func (s *Store) GetContributorProfile(ctx context.Context, username string, org, repo, entity *string, months int) (*data.ContributorProfileSeries, error)
- func (s *Store) GetContributorRetention(ctx context.Context, org, repo, entity *string, months int) (*data.RetentionSeries, error)
- func (s *Store) GetDailyActivity(ctx context.Context, org, repo, entity *string, months int) (*data.DailyActivitySeries, error)
- func (s *Store) GetDataState(ctx context.Context) (map[string]int64, error)
- func (s *Store) GetDeveloper(ctx context.Context, username string) (*data.Developer, error)
- func (s *Store) GetDeveloperPercentages(ctx context.Context, entity, org, repo *string, ex []string, months int) ([]*data.CountedItem, error)
- func (s *Store) GetDeveloperUsernames(ctx context.Context) ([]string, error)
- func (s *Store) GetEntity(ctx context.Context, val string) (*data.EntityResult, error)
- func (s *Store) GetEntityLike(ctx context.Context, query string, limit int) ([]*data.ListItem, error)
- func (s *Store) GetEntityPercentages(ctx context.Context, entity, org, repo *string, ex []string, months int) ([]*data.CountedItem, error)
- func (s *Store) GetEventTypeSeries(ctx context.Context, org, repo, entity *string, months int) (*data.EventTypeSeries, error)
- func (s *Store) GetForksAndActivity(ctx context.Context, org, repo, entity *string, months int) (*data.ForksAndActivitySeries, error)
- func (s *Store) GetInsightsSummary(ctx context.Context, org, repo, entity *string, months int) (*data.InsightsSummary, error)
- func (s *Store) GetIssueOpenCloseRatio(ctx context.Context, org, repo, entity *string, months int) (*data.IssueRatioSeries, error)
- func (s *Store) GetMinEventDate(ctx context.Context, org, repo *string) (string, error)
- func (s *Store) GetNoFullnameDeveloperUsernames(ctx context.Context) ([]string, error)
- func (s *Store) GetOrComputeDeepReputation(ctx context.Context, token, username string) (*data.UserReputation, error)
- func (s *Store) GetOrgLike(ctx context.Context, query string, limit int) ([]*data.ListItem, error)
- func (s *Store) GetPRReviewRatio(ctx context.Context, org, repo, entity *string, months int) (*data.PRReviewRatioSeries, error)
- func (s *Store) GetPRSizeDistribution(ctx context.Context, org, repo, entity *string, months int) (*data.PRSizeSeries, error)
- func (s *Store) GetReleaseCadence(ctx context.Context, org, repo, entity *string, months int) (*data.ReleaseCadenceSeries, error)
- func (s *Store) GetReleaseDownloads(ctx context.Context, org, repo *string, months int) (*data.ReleaseDownloadsSeries, error)
- func (s *Store) GetReleaseDownloadsByTag(ctx context.Context, org, repo *string, months int) (*data.ReleaseDownloadsByTagSeries, error)
- func (s *Store) GetRepoInsights(ctx context.Context, org, repo *string) ([]*data.RepoInsights, error)
- func (s *Store) GetRepoInsightsGeneratedAt(ctx context.Context, org, repo string) (string, error)
- func (s *Store) GetRepoLike(ctx context.Context, query string, limit int) ([]*data.ListItem, error)
- func (s *Store) GetRepoMetas(ctx context.Context, org, repo *string) ([]*data.RepoMeta, error)
- func (s *Store) GetRepoMetricHistory(ctx context.Context, org, repo *string, months int) ([]*data.RepoMetricHistory, error)
- func (s *Store) GetRepoOverview(ctx context.Context, org *string, months int) ([]*data.RepoOverview, error)
- func (s *Store) GetReputationDistribution(ctx context.Context, org, repo, entity *string, months int) (*data.ReputationDistribution, error)
- func (s *Store) GetReviewLatency(ctx context.Context, org, repo, entity *string, months int) (*data.ReviewLatencySeries, error)
- func (s *Store) GetState(ctx context.Context, query, org, repo string, min time.Time) (*data.State, error)
- func (s *Store) GetTimeToClose(ctx context.Context, org, repo, entity *string, months int) (*data.VelocitySeries, error)
- func (s *Store) GetTimeToFirstResponse(ctx context.Context, org, repo, entity *string, months int) (*data.FirstResponseSeries, error)
- func (s *Store) GetTimeToMerge(ctx context.Context, org, repo, entity *string, months int) (*data.VelocitySeries, error)
- func (s *Store) GetTimeToRestoreBugs(ctx context.Context, org, repo, entity *string, months int) (*data.VelocitySeries, error)
- func (s *Store) ImportAllContainerVersions(ctx context.Context, token string) error
- func (s *Store) ImportAllReleases(ctx context.Context, token string) error
- func (s *Store) ImportAllRepoMeta(ctx context.Context, token string) error
- func (s *Store) ImportAllRepoMetricHistory(ctx context.Context, token string) error
- func (s *Store) ImportContainerVersions(ctx context.Context, token, org, repo string) error
- func (s *Store) ImportDeepReputation(ctx context.Context, tokenFn data.TokenFunc, limit, staleHours int, ...) (*data.DeepReputationResult, error)
- func (s *Store) ImportEvents(ctx context.Context, token, owner, repo string, months int) (map[string]int, *data.ImportSummary, error)
- func (s *Store) ImportReleases(ctx context.Context, token, owner, repo string) error
- func (s *Store) ImportRepoMeta(ctx context.Context, token, owner, repo string) error
- func (s *Store) ImportRepoMetricHistory(ctx context.Context, token, owner, repo string) error
- func (s *Store) ImportReputation(ctx context.Context, org, repo *string) (*data.ReputationResult, error)
- func (s *Store) QueryEntities(ctx context.Context, val string, limit int) ([]*data.CountedItem, error)
- func (s *Store) SaveAndApplyDeveloperSub(ctx context.Context, prop, old, new string) (*data.Substitution, error)
- func (s *Store) SaveDevelopers(ctx context.Context, devs []*data.Developer) error
- func (s *Store) SaveRepoInsights(ctx context.Context, org, repo string, ri *data.RepoInsights) error
- func (s *Store) SaveState(ctx context.Context, query, org, repo string, state *data.State) error
- func (s *Store) SearchDeveloperUsernames(ctx context.Context, query string, org, repo *string, months, limit int) ([]string, error)
- func (s *Store) SearchDevelopers(ctx context.Context, val string, limit int) ([]*data.DeveloperListItem, error)
- func (s *Store) SearchEvents(ctx context.Context, q *data.EventSearchCriteria) ([]*data.EventDetails, error)
- func (s *Store) UpdateDeveloperNames(ctx context.Context, devs map[string]string) error
- func (s *Store) UpdateEvents(ctx context.Context, token string, concurrency int) (map[string]int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var EventTypes = []string{ data.EventTypePR, data.EventTypeIssue, data.EventTypeIssueComment, data.EventTypePRReview, data.EventTypeFork, }
Functions ¶
func RunSaaSMigrations ¶
RunSaaSMigrations runs SaaS-specific migrations (tenant tables, RLS policies). Called by devpulse-cloud only, not the self-hosted CLI.
Types ¶
type DBTX ¶
type DBTX interface {
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
}
DBTX is the common interface between *sql.DB and *sql.Conn. Both satisfy this interface natively — no adapter needed.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements data.Store for PostgreSQL.
func NewFromConn ¶
NewFromConn creates a Store backed by a dedicated connection. Used for tenant-scoped requests where RLS requires set_config on a specific connection.
func NewFromEnv ¶
NewFromEnv creates a Store from DATABASE_URL env var, runs base + SaaS migrations.
func (*Store) ApplySubstitutions ¶
func (*Store) ComputeDeepReputation ¶
func (*Store) DeleteRepoData ¶
func (*Store) GetAllOrgRepos ¶
func (*Store) GetChangeFailureRate ¶
func (*Store) GetContainerActivity ¶
func (*Store) GetContributorFunnel ¶
func (*Store) GetContributorMomentum ¶
func (*Store) GetContributorProfile ¶
func (*Store) GetContributorRetention ¶
func (*Store) GetDailyActivity ¶
func (*Store) GetDataState ¶
func (*Store) GetDeveloper ¶
func (*Store) GetDeveloperPercentages ¶
func (*Store) GetDeveloperUsernames ¶
func (*Store) GetEntityLike ¶
func (*Store) GetEntityPercentages ¶
func (*Store) GetEventTypeSeries ¶
func (*Store) GetForksAndActivity ¶
func (*Store) GetInsightsSummary ¶
func (*Store) GetIssueOpenCloseRatio ¶
func (*Store) GetMinEventDate ¶
func (*Store) GetNoFullnameDeveloperUsernames ¶
func (*Store) GetOrComputeDeepReputation ¶
func (*Store) GetOrgLike ¶
func (*Store) GetPRReviewRatio ¶
func (*Store) GetPRSizeDistribution ¶
func (*Store) GetReleaseCadence ¶
func (*Store) GetReleaseDownloads ¶
func (*Store) GetReleaseDownloadsByTag ¶
func (*Store) GetRepoInsights ¶
func (*Store) GetRepoInsightsGeneratedAt ¶
func (*Store) GetRepoLike ¶
func (*Store) GetRepoMetas ¶
func (*Store) GetRepoMetricHistory ¶
func (*Store) GetRepoOverview ¶
func (*Store) GetReputationDistribution ¶
func (*Store) GetReviewLatency ¶
func (*Store) GetTimeToClose ¶
func (*Store) GetTimeToFirstResponse ¶
func (*Store) GetTimeToMerge ¶
func (*Store) GetTimeToRestoreBugs ¶
func (*Store) ImportAllContainerVersions ¶
func (*Store) ImportAllReleases ¶
func (*Store) ImportAllRepoMeta ¶
func (*Store) ImportAllRepoMetricHistory ¶
func (*Store) ImportContainerVersions ¶
func (*Store) ImportDeepReputation ¶
func (*Store) ImportEvents ¶
func (*Store) ImportReleases ¶
func (*Store) ImportRepoMeta ¶
func (*Store) ImportRepoMetricHistory ¶
func (*Store) ImportReputation ¶
func (*Store) QueryEntities ¶
func (*Store) SaveAndApplyDeveloperSub ¶
func (*Store) SaveDevelopers ¶
func (*Store) SaveRepoInsights ¶
func (*Store) SearchDeveloperUsernames ¶
func (*Store) SearchDevelopers ¶
func (*Store) SearchEvents ¶
func (s *Store) SearchEvents(ctx context.Context, q *data.EventSearchCriteria) ([]*data.EventDetails, error)
func (*Store) UpdateDeveloperNames ¶
Click to show internal directories.
Click to hide internal directories.