Documentation ¶
Index ¶
- type DailyReport
- type MismatchReport
- type ReportRepo
- type ReportRepoImpl
- func (r *ReportRepoImpl) CountMatched(ctx context.Context, whereParams url.Values) (count int64, err error)
- func (r *ReportRepoImpl) CountUniquePage(ctx context.Context, whereParams url.Values) (count int64, err error)
- func (r *ReportRepoImpl) DailyReports(ctx context.Context, startDate, endDate, ruleID string) (list []*DailyReport, err error)
- func (r *ReportRepoImpl) MismatchReports(ctx context.Context, paginationParam repository.PaginationParam) (list []*MismatchReport, err error)
- type RuleMatching
- type RuleMatchingRepo
- type RuleMatchingRepoImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DailyReport ¶
DailyReport contain sumary of daily hit
type MismatchReport ¶
type MismatchReport struct { URL string `json:"url"` Count int64 `json:"count"` FirstSeen time.Time `json:"first_seen"` LastSeen time.Time `json:"last_seen"` }
MismatchReport contain sumary of total count of not-matching rule
type ReportRepo ¶
type ReportRepo interface { MismatchReports(ctx context.Context, paginationParam repository.PaginationParam) (list []*MismatchReport, err error) DailyReports(ctx context.Context, startDate, endDate, ruleID string) (list []*DailyReport, err error) CountMatched(ctx context.Context, whereParams url.Values) (count int64, err error) CountUniquePage(ctx context.Context, whereParams url.Values) (count int64, err error) }
ReportRepo responsble to generate report [mock]
func NewReportRepo ¶
func NewReportRepo(impl ReportRepoImpl) ReportRepo
NewReportRepo return new instance of MetricsRuleMatchingRepo [constructor]
type ReportRepoImpl ¶
type ReportRepoImpl struct { dig.In *typpostgres.DB }
ReportRepoImpl is implementation of ReportRepo
func (*ReportRepoImpl) CountMatched ¶
func (r *ReportRepoImpl) CountMatched(ctx context.Context, whereParams url.Values) (count int64, err error)
CountMatched is count matched
func (*ReportRepoImpl) CountUniquePage ¶
func (r *ReportRepoImpl) CountUniquePage(ctx context.Context, whereParams url.Values) (count int64, err error)
CountUniquePage is count unique page
func (*ReportRepoImpl) DailyReports ¶
func (r *ReportRepoImpl) DailyReports(ctx context.Context, startDate, endDate, ruleID string) (list []*DailyReport, err error)
DailyReports return list of daily report
func (*ReportRepoImpl) MismatchReports ¶
func (r *ReportRepoImpl) MismatchReports(ctx context.Context, paginationParam repository.PaginationParam) (list []*MismatchReport, err error)
MismatchReports return list of not-matching report
type RuleMatching ¶
RuleMatching represented metrics_rule_matching entity
type RuleMatchingRepo ¶
type RuleMatchingRepo interface {
Insert(context.Context, RuleMatching) (err error)
}
RuleMatchingRepo to handle metrics_rule_matching entity [mock]
func NewRuleMatchingRepo ¶
func NewRuleMatchingRepo(impl RuleMatchingRepoImpl) RuleMatchingRepo
NewRuleMatchingRepo return new instance of MetricsRuleMatchingRepo [constructor]
type RuleMatchingRepoImpl ¶
type RuleMatchingRepoImpl struct { dig.In *typpostgres.DB }
RuleMatchingRepoImpl is implementation metrics_rule_matching repository
func (*RuleMatchingRepoImpl) Insert ¶
func (r *RuleMatchingRepoImpl) Insert(ctx context.Context, e RuleMatching) (err error)
Insert metrics_rule_matching