Documentation
¶
Index ¶
- Variables
- type Commit
- type Flow
- type Glyph
- type Graph
- func (graph *Graph) AddCommit(row, column int, flowID int64, data []byte) error
- func (graph *Graph) AddGlyph(row, column int, flowID int64, color int, glyph byte)
- func (graph *Graph) Height() int
- func (graph *Graph) LoadAndProcessCommits(ctx context.Context, repository *repo_model.Repository, ...) error
- func (graph *Graph) Width() int
- type Parser
Constants ¶
This section is empty.
Variables ¶
var RelationCommit = &Commit{
Row: -1,
}
RelationCommit represents an empty relation commit
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
Commit *git.Commit
User *user_model.User
Verification *asymkey_model.CommitVerification
Status *git_model.CommitStatus
Flow int64
Row int
Column int
Refs []git.Reference
Rev string
Date time.Time
ShortRev string
Subject string
}
Commit represents a commit at co-ordinate X, Y with the data
func (*Commit) OnlyRelation ¶
OnlyRelation returns whether this a relation only commit
type Flow ¶
type Flow struct {
ID int64
ColorNumber int
Glyphs []Glyph
Commits []*Commit
MinRow int
MinColumn int
MaxRow int
MaxColumn int
}
Flow represents a series of glyphs
type Graph ¶
type Graph struct {
Flows map[int64]*Flow
Commits []*Commit
MinRow int
MinColumn int
MaxRow int
MaxColumn int
// contains filtered or unexported fields
}
Graph represents a collection of flows
func GetCommitGraph ¶
func GetCommitGraph(r *git.Repository, page, maxAllowedColors int, hidePRRefs bool, branches, files []string) (*Graph, error)
GetCommitGraph return a list of commit (GraphItems) from all branches
func (*Graph) LoadAndProcessCommits ¶
func (graph *Graph) LoadAndProcessCommits(ctx context.Context, repository *repo_model.Repository, gitRepo *git.Repository) error
LoadAndProcessCommits will load the git.Commits for each commit in the graph, the associate the commit with the user author, and check the commit verification before finally retrieving the latest status
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents a git graph parser. It is stateful containing the previous glyphs, detected flows and color assignments.
func (*Parser) AddLineToGraph ¶
AddLineToGraph adds the line as a row to the graph
func (*Parser) ParseGlyphs ¶
ParseGlyphs parses the provided glyphs and sets the internal state