Documentation
¶
Overview ¶
Package identity resolves the many identifiers a person accumulates across sources (email, GitHub login, Jira account id) to one canonical identifier, so one human stays one node in the graph.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAliases = errors.New("identity: aliases")
ErrAliases reports a problem reading or parsing an alias file.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver unions identifiers that belong to the same person and resolves any of them to a single canonical identifier. The canonical pick prefers an email over a bare name slug, and either over a source-prefixed identifier such as "github:alice"; ties break lexically so resolution is deterministic.
func NewResolver ¶
func NewResolver() *Resolver
NewResolver returns an empty resolver where every identifier is its own canonical form.
func (*Resolver) Canonical ¶
Canonical returns the canonical identifier for id, or id itself when it has never been unioned with anything.
func (*Resolver) LoadFile ¶
LoadFile merges an alias file into the resolver. The file is a JSON object mapping a canonical identifier to the list of identifiers that belong to the same person, for example {"alice@corp.com": ["github:alice"]}.
func (*Resolver) Pairs ¶
Pairs returns every known identifier mapped to its canonical form, omitting identifiers that are already canonical. The result is nil when the resolver holds nothing worth persisting.