mirror of
https://github.com/lukaszraczylo/git-velocity.git
synced 2026-07-08 06:34:53 +00:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
// Author represents a Git/GitHub author
|
||||
type Author struct {
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Login string `json:"login"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
AvatarURL string `json:"avatar_url,omitempty"`
|
||||
}
|
||||
|
||||
// DisplayName returns the best available name for display
|
||||
func (a *Author) DisplayName() string {
|
||||
if a.Name != "" {
|
||||
return a.Name
|
||||
}
|
||||
if a.Login != "" {
|
||||
return a.Login
|
||||
}
|
||||
if a.Email != "" {
|
||||
return a.Email
|
||||
}
|
||||
return "Unknown"
|
||||
}
|
||||
Reference in New Issue
Block a user