1package main
  2
  3import (
  4	"encoding/xml"
  5	"time"
  6
  7	"github.com/go-git/go-git/v5"
  8	"github.com/go-git/go-git/v5/plumbing"
  9)
 10
 11type Repository struct {
 12	Name        string `yaml:"name" json:"name"`
 13	Path        string `yaml:"path" json:"path"`
 14	Description string `yaml:"description" json:"description"`
 15	Group       string `yaml:"group" json:"group"`
 16}
 17
 18type Commit struct {
 19	Hash           string
 20	AuthorName     string
 21	AuthorEmail    string
 22	AuthorDate     time.Time
 23	CommitterName  string
 24	CommitterEmail string
 25	CommitterDate  time.Time
 26	Message        string
 27	Additions      int
 28	Deletions      int
 29	TooLarge       bool
 30}
 31
 32type DiffLine struct {
 33	LeftNo  string
 34	Left    string
 35	RightNo string
 36	Right   string
 37	Type    string // "add", "del", "mod", "eq", "gap"
 38}
 39
 40type FileDiff struct {
 41	Name     string
 42	Lines    []DiffLine
 43	Addition int
 44	Deletion int
 45	IsBinary bool
 46	Mode     string
 47	OldSize  int64
 48	NewSize  int64
 49	Deleted  bool
 50	TooLarge bool
 51}
 52
 53type GroupedRepositories struct {
 54	Name         string
 55	Repositories []Repository
 56}
 57
 58type TreeEntry struct {
 59	Name  string
 60	Path  string
 61	IsDir bool
 62	Size  int64
 63	Mode  string
 64}
 65
 66type RepoContext struct {
 67	Repo        *Repository
 68	GitRepo     *git.Repository
 69	Config      *Config
 70	CurrentRef  string
 71	Hash        plumbing.Hash
 72	Branches    []string
 73	Tags        []string
 74	ReadmeName  string
 75	LicenseName string
 76}
 77
 78type Marker struct {
 79	Type     string // "TODO" or "FIXME"
 80	FilePath string
 81	Line     int
 82	Content  string
 83}
 84
 85type LanguageStat struct {
 86	Name       string
 87	Percentage float64
 88	Color      string
 89	Size       int64
 90	Offset     float64
 91}
 92
 93type RSS struct {
 94	XMLName xml.Name `xml:"rss"`
 95	Version string   `xml:"version,attr"`
 96	Channel Channel  `xml:"channel"`
 97}
 98
 99type Channel struct {
100	Title       string    `xml:"title"`
101	Link        string    `xml:"link"`
102	Description string    `xml:"description"`
103	PubDate     string    `xml:"pubDate,omitempty"`
104	Items       []RSSItem `xml:"item"`
105}
106
107type RSSItem struct {
108	Title       string `xml:"title"`
109	Link        string `xml:"link"`
110	Description string `xml:"description"`
111	PubDate     string `xml:"pubDate"`
112	GUID        string `xml:"guid"`
113}