Documentation
¶
Index ¶
- type By
- type Contribution
- type HTMLGenerator
- type Model
- func (cm *Model) Append(c Contribution) error
- func (cm *Model) Contributions() []*Contribution
- func (model *Model) Generate(generator generator, out io.Writer) error
- func (cm *Model) MoveDown(c *Contribution)
- func (cm *Model) MoveUp(c *Contribution)
- func (cm *Model) Remove(c *Contribution) bool
- func (cm *Model) RemoveFull(c *Contribution) bool
- func (m Model) SaveToDisk() error
- type Section
- type TextGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type By ¶
type By func(c1, c2 *Contribution) bool
By is the type of a "less" function that defines the ordering of its arguments.
type Contribution ¶
type Contribution struct { Title string Link string Description string ID int AuthorID int GLProjectName string GLTargetType string GLActionName string GLCreatedAt time.Time ProjectName string TargetType string ActionName string ReportTitle string ReportDescription string }
Contribution is a contribution element for a give project/target/action
func (Contribution) String ¶
func (i Contribution) String() string
type Model ¶
type Model struct {
Sections []*Section
}
Model is the main contribution element, contains all sections and contributions in a wrapping recursive manner
func NewModel ¶
func NewModel(contribs []Contribution) *Model
NewModel creates a new Model from given existing contributions fetched from GitLab
func (*Model) Append ¶
func (cm *Model) Append(c Contribution) error
Append inserts contribution to model in the last position of the subsection
func (*Model) Contributions ¶
func (cm *Model) Contributions() []*Contribution
Contributions retrieves contributions in breath first order, and sections being first before section contributions
func (*Model) MoveDown ¶
func (cm *Model) MoveDown(c *Contribution)
MoveDown moves the contribution one position down
func (*Model) MoveUp ¶
func (cm *Model) MoveUp(c *Contribution)
MoveUp moves the contribution one position up
func (*Model) Remove ¶
func (cm *Model) Remove(c *Contribution) bool
Remove removes contribution from model
func (*Model) RemoveFull ¶
func (cm *Model) RemoveFull(c *Contribution) bool
RemoveFull removes contribution from model plus empty parent sections
type Section ¶
type Section struct { Title string Subsections []*Section Contributions []*Contribution }
Section is a recursive data that holds both contributions and other sections