Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReportService ¶
func NewReportService(rr ReportRepository, logger *log.Logger) *reportService
NewReportService returns a ReportService instance with the dependencies injected
Types ¶
type ChatAnalytics ¶
type ChatAnalytics struct { WordsSent int MessagesSent int Participants map[string]ParticipantAnalytics HourList Hourlist // HourMap is used by the analyzer, it is not stored. HourMap map[string]int `json:"-"` }
ChatAnalytics represents the analytics of the chat
type Hourlist ¶
type Hourlist []Hour
Hourlist is a slice of hours that implements the sort interface to sort by hour.
type Monthlist ¶
type Monthlist []Month
Monthlist is a slice of months that implements the sort interface to sort by month
type ParticipantAnalytics ¶
type ParticipantAnalytics struct { //Name string WordsSent int MessagesSent int WordList Wordlist MonthList Monthlist // These fields are used by the analyzer, they are not stored. WordMap map[string]int `json:"-"` MonthMap map[string]int `json:"-"` }
ParticipantAnalytics represents the analytics for a single participant in a chat
type Report ¶
type Report struct { ReportID string `json:"ReportID"` ChatAnalytics ChatAnalytics `json:"report_analytics"` }
Report represents an individual report
type ReportRepository ¶
type ReportRepository interface { Get(ctx context.Context, id string) (*Report, error) Store(*Report) error }
ReportRepository represents a repository of reports
Click to show internal directories.
Click to hide internal directories.