Version: v0.0.0-...-1743fbf Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: GPL-3.0 Imports: 12 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


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 HTMLGenerator

type HTMLGenerator struct {

HTMLGenerator is the HTML formater of our report

type Model

type Model struct {
	Sections []*Section

Model is the main contribution element, contains all sections and contributions in a wrapping recursive manner

func NewFromDisk

func NewFromDisk() (*Model, error)

NewFromDisk returns a new model locally saved

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) Generate

func (model *Model) Generate(generator generator, out io.Writer) error

Generate report formatted by generator on current Model.

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

func (Model) SaveToDisk

func (m Model) SaveToDisk() error

SaveToDisk saves model to disk

type Section

type Section struct {
	Title         string
	Subsections   []*Section
	Contributions []*Contribution

Section is a recursive data that holds both contributions and other sections

type TextGenerator

type TextGenerator struct {

TextGenerator is the text formater of our report

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL