Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedFormats ¶
AllowedFormats creates a map with the allowed report formats and their implementations
func AllowedFormatsCollection ¶
func AllowedFormatsCollection() []string
AllowedFormatsCollection returns the collection of allowed formats
func CreateReporter ¶
CreateReporter creates a new reporter
func IsAllowedFormat ¶
IsAllowedFormat returns true if the format is allowed
Types ¶
type CliReporter ¶
type CliReporter struct { Period core.Period Repo core.ActivityRepository Printer func(...interface{}) (int, error) DurationFormat core.DurationFormat }
CliReporter is an activity reporter that presents activity information in the standard out
func NewCustomCLIReporter ¶
func NewCustomCLIReporter(printer func(...interface{}) (int, error)) *CliReporter
NewCustomCLIReporter creates a new CLI reporter
func (*CliReporter) Initialize ¶
func (reporter *CliReporter) Initialize(repo core.ActivityRepository, period core.Period) error
Initialize initializes a new CLI reporter
func (*CliReporter) ProduceReport ¶
func (reporter *CliReporter) ProduceReport() error
ProduceReport creates a new cli report in the given period
func (*CliReporter) SetDurationFormat ¶
func (reporter *CliReporter) SetDurationFormat(f core.DurationFormat)
SetDurationFormat sets the duration formatter
type CsvReporter ¶
type CsvReporter struct { Period core.Period Repo core.ActivityRepository DurationFormat core.DurationFormat Clock utils.Clock }
CsvReporter is an activity reporter that exports activity information to a csv file.
func (*CsvReporter) Initialize ¶
func (reporter *CsvReporter) Initialize(repo core.ActivityRepository, period core.Period) error
Initialize initializes a new CSV reporter
func (*CsvReporter) ProduceReport ¶
func (reporter *CsvReporter) ProduceReport() error
ProduceReport creates a new CSV report in the given period
func (*CsvReporter) SetDurationFormat ¶
func (reporter *CsvReporter) SetDurationFormat(f core.DurationFormat)
SetDurationFormat sets the duration formatter
type EmptyReporter ¶
type EmptyReporter struct{}
EmptyReporter represents a reporter not supported
func NewEmptyReporter ¶
func NewEmptyReporter() *EmptyReporter
NewEmptyReporter creates a new empty reporter
func (*EmptyReporter) Initialize ¶
func (reporter *EmptyReporter) Initialize(repo core.ActivityRepository, period core.Period) error
Initialize initializes a new empty reporter
func (*EmptyReporter) ProduceReport ¶
func (reporter *EmptyReporter) ProduceReport() error
ProduceReport no-op
func (*EmptyReporter) SetDurationFormat ¶
func (reporter *EmptyReporter) SetDurationFormat(f core.DurationFormat)
SetDurationFormat no-op
type JsonReporter ¶
type JsonReporter struct { Period core.Period Repo core.ActivityRepository DurationFormat core.DurationFormat Clock utils.Clock }
JsonReporter is an activity reporter that exports activity information to a json file.
func NewJsonReporter ¶
func NewJsonReporter() *JsonReporter
NewJsonReporter creates a new JSON reporter
func (*JsonReporter) Initialize ¶
func (reporter *JsonReporter) Initialize(repo core.ActivityRepository, period core.Period) error
Initialize initializes a new JSON reporter
func (*JsonReporter) ProduceReport ¶
func (reporter *JsonReporter) ProduceReport() error
ProduceReport creates a new json report in the given period
func (*JsonReporter) SetDurationFormat ¶
func (reporter *JsonReporter) SetDurationFormat(f core.DurationFormat)
SetDurationFormat sets the duration formatter