Documentation ¶
Index ¶
- func Dir(useLocal bool, name string) http.FileSystem
- func FS(useLocal bool) http.FileSystem
- func FSByte(useLocal bool, name string) ([]byte, error)
- func FSMustByte(useLocal bool, name string) []byte
- func FSMustString(useLocal bool, name string) string
- func FSString(useLocal bool, name string) (string, error)
- func HashPeopleDiscoverySQL() string
- func ReducePeople(people People, matcher external.Matcher, blacklist Blacklist, ...) error
- func SetPrimaryValues(people People, nameFreqs, emailFreqs map[string]*Frequency, minRecentCount int)
- type Blacklist
- type Commit
- type Frequency
- type Int64Slice
- type NameWithRepo
- type People
- type Person
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir(useLocal bool, name string) http.FileSystem
Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.
func FS ¶
func FS(useLocal bool) http.FileSystem
FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSByte ¶
FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSMustByte ¶
FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustString ¶
FSMustString is the string version of FSMustByte.
func HashPeopleDiscoverySQL ¶
func HashPeopleDiscoverySQL() string
HashPeopleDiscoverySQL returns the hashsum of the SQL used to fetch the raw Git signatures.
func ReducePeople ¶
func ReducePeople(people People, matcher external.Matcher, blacklist Blacklist, maxIdentities int) error
ReducePeople merges the identities together by following the fixed set of rules.
- Run the external matching, if available.
- Run the series of heuristics on those items which were left untouched in the list (everything in case of ext == nil, not found in case of ext != nil).
The heuristics are: TODO(vmarkovtsev): describe the current approach
func SetPrimaryValues ¶
func SetPrimaryValues(people People, nameFreqs, emailFreqs map[string]*Frequency, minRecentCount int)
SetPrimaryValues sets people primary name and email to the most frequent name and email of the person's identity. Stats for the fixed recent period of time are used if there are at least minRecentCount commits made by the person's identity in that period. Otherwise the stats for all the time are used.
Types ¶
type Blacklist ¶
type Blacklist struct { Domains map[string]struct{} TopLevelDomains map[string]struct{} Names map[string]struct{} Emails map[string]struct{} PopularEmails map[string]struct{} PopularNames map[string]struct{} }
Blacklist contains all the data to filter identities or identities connection
func NewBlacklist ¶
NewBlacklist generates Blacklist from the data files embedded to blacklists.go
type Frequency ¶
Frequency is a pair of word frequencies for a certain recent period of time and for all the time
type Int64Slice ¶
type Int64Slice []int64
Int64Slice attaches the methods of Interface to []int64, sorting in increasing order.
func (Int64Slice) Len ¶
func (p Int64Slice) Len() int
func (Int64Slice) Less ¶
func (p Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (p Int64Slice) Swap(i, j int)
type NameWithRepo ¶
NameWithRepo is a Name that can be linked to a specific repo.
func (NameWithRepo) String ¶
func (rn NameWithRepo) String() string
String describes the person's identity parts.
type People ¶
People is a map of persons indexed by their ID.
func FindPeople ¶
func FindPeople(ctx context.Context, connString string, cachePath string, blacklist Blacklist, recentMonths int) (People, map[string]*Frequency, map[string]*Frequency, error)
FindPeople returns all the people in the database or from the disk cache.
func (People) ForEach ¶
ForEach executes a function over each person in the collection. The order is fixed and constant.
type Person ¶
type Person struct { ID int64 NamesWithRepos []NameWithRepo Emails []string // SampleCommit in an example Git commit which mentions this identity. May be nil. SampleCommit *Commit ExternalID string PrimaryName string PrimaryEmail string }
Person is a single individual that can have multiple names and emails.