Documentation
¶
Index ¶
- Constants
- func CleanEntities(db *sql.DB) error
- func GetCNCFEntityAffiliations() (map[string]*CNCFDeveloper, error)
- func GetDB(path string) (*sql.DB, error)
- func GetDataState(db *sql.DB) (map[string]int64, error)
- func GetDeveloperUsernames(db *sql.DB) ([]string, error)
- func GetNoFullnameDeveloperUsernames(db *sql.DB) ([]string, error)
- func GetState(db *sql.DB, query, org, repo string) (int, error)
- func ImportEvents(dbPath, token, owner, repo string, months int) (map[string]int, error)
- func Init(dbFilePath string) error
- func SaveDevelopers(db *sql.DB, devs []*Developer) error
- func SaveState(db *sql.DB, query, org, repo string, page int) error
- func UpdateDeveloper(ctx context.Context, db *sql.DB, client *http.Client, username string, ...) error
- func UpdateDeveloperNames(db *sql.DB, devs map[string]string) error
- func UpdateEvents(dbPath, token string) (map[string]int, error)
- type AFDeveloper
- type AFDeveloperList
- type AffiliationImportResult
- type ApacheUpdateResult
- type CNCFAffiliation
- type CNCFDeveloper
- type CountedItem
- type CountedResult
- type Developer
- type DeveloperListItem
- type EntityResult
- type Event
- type EventDetails
- type EventImporter
- type EventSearchCriteria
- type EventTypeSeries
- type ListItem
- type Org
- type OrgRepoItem
- type Query
- type Repo
Constants ¶
const ( // EventTypes is a list of event types to import EventTypePR string = "pr_request" EventTypePRComment string = "pr_comment" EventTypeIssue string = "issue_request" EventTypeIssueComment string = "issue_comment" EventAgeMonthsDefault = 6 )
const (
DataFileName string = "data.db"
)
Variables ¶
This section is empty.
Functions ¶
func CleanEntities ¶
func GetCNCFEntityAffiliations ¶
func GetCNCFEntityAffiliations() (map[string]*CNCFDeveloper, error)
func GetDataState ¶
GetDataState returns the current state of the database.
func ImportEvents ¶
ImportEvents imports events from GitHub for a given org/repo combination.
func UpdateDeveloper ¶
Types ¶
type AFDeveloper ¶
type AFDeveloper struct {
Name string `json:"name,omitempty"`
}
type AFDeveloperList ¶
type AFDeveloperList struct {
Count int `json:"people_count,omitempty"`
List map[string]AFDeveloper `json:"people,omitempty"`
}
type AffiliationImportResult ¶
type AffiliationImportResult struct {
Duration string `json:"duration,omitempty"`
DBDevs int `json:"db_devs,omitempty"`
CNCFDevs int `json:"cncf_devs,omitempty"`
MappedDevs int `json:"mapped_devs,omitempty"`
}
func UpdateDevelopersWithCNCFEntityAffiliations ¶
func UpdateDevelopersWithCNCFEntityAffiliations(ctx context.Context, db *sql.DB, client *http.Client) (*AffiliationImportResult, error)
UpdateDevelopersWithCNCFEntityAffiliations updates the developers with the CNCF entity affiliations.
type ApacheUpdateResult ¶
type ApacheUpdateResult struct {
Duration string `json:"duration,omitempty"`
DBDevs int `json:"db_devs,omitempty"`
AFDevs int `json:"af_devs,omitempty"`
MappedDevs int `json:"mapped_devs,omitempty"`
}
func UpdateNoFullnameDevelopersFromApache ¶
func UpdateNoFullnameDevelopersFromApache(db *sql.DB) (*ApacheUpdateResult, error)
type CNCFAffiliation ¶
type CNCFDeveloper ¶
type CNCFDeveloper struct {
Username string `json:"username,omitempty"`
Identities []string `json:"identities,omitempty"`
Affiliations []*CNCFAffiliation `json:"affiliations,omitempty"`
}
func (*CNCFDeveloper) GetBestIdentity ¶
func (c *CNCFDeveloper) GetBestIdentity() string
func (*CNCFDeveloper) GetLatestAffiliation ¶
func (c *CNCFDeveloper) GetLatestAffiliation() string
type CountedItem ¶
func GetDeveloperPercentages ¶
func GetDeveloperPercentages(db *sql.DB, entity, org, repo *string, months int) ([]*CountedItem, error)
GetOrgRepoPercentages returns a list of repo percentages for the given organization.
func GetEntityPercentages ¶
func GetEntityPercentages(db *sql.DB, entity, org, repo *string, months int) ([]*CountedItem, error)
GetEntityPercentages returns a list of entity percentages for the given repository.
func QueryEntities ¶
type CountedResult ¶
type Developer ¶
type Developer struct {
Username string `json:"username,omitempty"`
Updated string `json:"update_date,omitempty"`
ID int64 `json:"id,omitempty"`
FullName string `json:"full_name,omitempty"`
Email string `json:"email,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
ProfileURL string `json:"profile_url,omitempty"`
Entity string `json:"current_entity,omitempty"`
Location string `json:"location,omitempty"`
Organizations []*Org `json:"organizations,omitempty"`
}
type DeveloperListItem ¶
type DeveloperListItem struct {
Username string `json:"username,omitempty"`
Entity string `json:"entity,omitempty"`
UpdatedDate string `json:"update_date,omitempty"`
}
func SearchDevelopers ¶
SearchDevelopers returns a list of developers matching the given query.
func SearchGitHubUsers ¶
type EntityResult ¶
type EntityResult struct {
Entity string `json:"entity,omitempty"`
DeveloperCount int `json:"developer_count,omitempty"`
Developers []*DeveloperListItem `json:"developers,omitempty"`
}
type Event ¶
type EventDetails ¶
type EventDetails struct {
EventID int64 `json:"event_id,omitempty"`
Org string `json:"org,omitempty"`
Repo string `json:"repo,omitempty"`
EventDate string `json:"event_date,omitempty"`
EventType string `json:"event_type,omitempty"`
DevID int64 `json:"dev_id,omitempty"`
Updated string `json:"dev_update_date,omitempty"`
Username string `json:"username,omitempty"`
Email string `json:"email,omitempty"`
FullName string `json:"full_name,omitempty"`
EventURL string `json:"url,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
ProfileURL string `json:"profile_url,omitempty"`
Entity string `json:"entity,omitempty"`
Location string `json:"location,omitempty"`
}
func SearchEvents ¶
func SearchEvents(db *sql.DB, q *EventSearchCriteria) ([]*EventDetails, error)
type EventImporter ¶
type EventImporter struct {
// contains filtered or unexported fields
}
type EventSearchCriteria ¶
type EventSearchCriteria struct {
FromDate *string `json:"from,omitempty"`
ToDate *string `json:"to,omitempty"`
EventType *string `json:"event_type,omitempty"`
Org *string `json:"org,omitempty"`
Repo *string `json:"repo,omitempty"`
Username *string `json:"user,omitempty"`
Entity *string `json:"entity,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"page_size,omitempty"`
}
func (EventSearchCriteria) String ¶
func (c EventSearchCriteria) String() string
type EventTypeSeries ¶
type EventTypeSeries struct {
Dates []string `json:"dates"`
PRs []int `json:"pr_request"`
PRComments []int `json:"pr_comment"`
Issues []int `json:"issue_request"`
IssueComments []int `json:"issue_comment"`
Avg []float32 `json:"avg"`
}
func GetEventTypeSeries ¶
type ListItem ¶
func GetEntityLike ¶
GetEntityLike returns a list of repos that match the given pattern.
func GetOrgLike ¶
GetOrgLike returns a list of orgs and repos that match the given pattern.
type Org ¶
type OrgRepoItem ¶
func GetAllOrgRepos ¶
func GetAllOrgRepos(db *sql.DB) ([]*OrgRepoItem, error)
GetAllOrgRepos returns a list of repo percentages for the given organization.