Documentation ¶
Index ¶
- Variables
- func CountCommits(ctx context.Context, repoID int32, rng ztime.Range) (int, error)
- func FindOrInsertAuthor(ctx context.Context, c Commit, names, emails map[string]int64) (int64, error)
- func FindOrInsertFile(ctx context.Context, c Commit, files map[string]int64) ([]int64, Ints, Ints, error)
- type Author
- type AuthorStat
- type AuthorStats
- type Authors
- type Commit
- type CommitFile
- type CommitStat
- type CommitStats
- type Commits
- type Domain
- type Event
- type EventKind
- type Events
- type File
- type FileStat
- type Files
- type Hash
- type Ints
- type Repo
- func (r *Repo) ByName(ctx context.Context, name string) error
- func (r *Repo) ByPath(ctx context.Context, path string) error
- func (r *Repo) Find(ctx context.Context, name string) error
- func (r *Repo) Insert(ctx context.Context) error
- func (r Repo) Remote() bool
- func (r *Repo) Update(ctx context.Context) error
- type Repos
- type Strings
Constants ¶
This section is empty.
Variables ¶
View Source
var DBFiles embed.FS
View Source
var TplFiles embed.FS
Functions ¶
func CountCommits ¶
func FindOrInsertAuthor ¶
func FindOrInsertAuthor(ctx context.Context, c Commit, names, emails map[string]int64) (int64, error)
Find author by name or email, or insert if it doesn't exist.
TODO: treat as case-insensitive, now we have:
Eric Anholt <anholt@freebsd.org>, <anholt@FreeBSD.org> walter harms, Walter Harms <wharms@bfs.de>
And that's not too useful.
Types ¶
type Author ¶
type AuthorStat ¶
type AuthorStat struct { AuthorID int `db:"author_id"` Commits int `db:"commits"` Added int `db:"added"` Removed int `db:"removed"` CommitPerc float32 `db:"commit_perc"` AddedPerc float32 `db:"added_perc"` RemovedPerc float32 `db:"removed_perc"` Names Strings `db:"names"` Emails Strings `db:"emails"` First time.Time `db:"first"` Last time.Time `db:"last"` Domains []string `db:"-"` }
type AuthorStats ¶
type AuthorStats []AuthorStat
func (AuthorStats) Domains ¶
func (s AuthorStats) Domains() []Domain
type Commit ¶
type Commit struct { RepoID int32 `db:"repo_id"` Hash Hash `db:"hash,id"` Date time.Time `db:"date"` AuthorID int `db:"author_id"` Exclude sql.NullBool `db:"exclude"` Files Strings `db:"files"` Added Ints `db:"added"` Removed Ints `db:"removed"` AddedSum int `db:"added_sum"` RemovedSum int `db:"removed_sum"` Subject string `db:"subject"` Email string `db:"-"` Name string `db:"-"` UpdFiles []CommitFile `db:"files"` }
type CommitFile ¶
func (*CommitFile) ShouldExclude ¶
func (c *CommitFile) ShouldExclude() bool
type CommitStat ¶
type CommitStats ¶
type CommitStats []CommitStat
type Event ¶
type FileStat ¶
type Repo ¶
Click to show internal directories.
Click to hide internal directories.