Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidDropType = errors.New("invalid drop type") ErrInvalidDropItem = errors.New("invalid drop item") ErrInvalidDropInfoCount = errors.New("invalid drop info count") ErrUnknownItemID = errors.New("unknown item id") ErrUnknownDropInfoTuple = errors.New("unknown drop type + item id tuple") )
View Source
var ( ErrAccountIDEmpty = errors.New("account id is empty") ErrAccountNotFound = errors.New("account not found with given id") )
View Source
var ErrExprMatched = errors.New("reject expr matched")
View Source
var ErrMD5Conflict = errors.New("report with specified md5 has already existed")
Functions ¶
Types ¶
type DropInfoTuple ¶
type DropVerifier ¶
func NewDropVerifier ¶
func NewDropVerifier(dropInfoRepo *repo.DropInfo) *DropVerifier
func (*DropVerifier) Name ¶
func (d *DropVerifier) Name() string
func (*DropVerifier) Verify ¶
func (d *DropVerifier) Verify(ctx context.Context, report *types.ReportTaskSingleReport, reportTask *types.ReportTask) *Rejection
type MD5Verifier ¶
type MD5Verifier struct {
DropReportExtraRepo *repo.DropReportExtra
}
func NewMD5Verifier ¶
func NewMD5Verifier(dropReportExtraRepo *repo.DropReportExtra) *MD5Verifier
func (*MD5Verifier) Name ¶
func (u *MD5Verifier) Name() string
func (*MD5Verifier) Verify ¶
func (u *MD5Verifier) Verify(ctx context.Context, report *types.ReportTaskSingleReport, reportTask *types.ReportTask) *Rejection
type RejectRuleVerifier ¶
type RejectRuleVerifier struct {
RejectRuleRepo *repo.RejectRule
}
func NewRejectRuleVerifier ¶
func NewRejectRuleVerifier(rejectRuleRepo *repo.RejectRule) *RejectRuleVerifier
func (*RejectRuleVerifier) Name ¶
func (d *RejectRuleVerifier) Name() string
func (*RejectRuleVerifier) Verify ¶
func (d *RejectRuleVerifier) Verify(ctx context.Context, report *types.ReportTaskSingleReport, reportTask *types.ReportTask) *Rejection
type ReportContext ¶
type ReportContext struct { Report *types.ReportTaskSingleReport Task *types.ReportTask }
func (ReportContext) SemVerCompare ¶
func (ReportContext) SemVerCompare(a, b string) int
type ReportVerifiers ¶
type ReportVerifiers []Verifier
func NewReportVerifier ¶
func NewReportVerifier(userVerifier *UserVerifier, dropVerifier *DropVerifier, md5Verifier *MD5Verifier, rejectRuleVerifier *RejectRuleVerifier) *ReportVerifiers
func (ReportVerifiers) Verify ¶
func (verifiers ReportVerifiers) Verify(ctx context.Context, reportTask *types.ReportTask) (violations Violations)
type UserVerifier ¶
func NewUserVerifier ¶
func NewUserVerifier(accountRepo *repo.Account) *UserVerifier
func (*UserVerifier) Name ¶
func (u *UserVerifier) Name() string
func (*UserVerifier) Verify ¶
func (u *UserVerifier) Verify(ctx context.Context, report *types.ReportTaskSingleReport, reportTask *types.ReportTask) *Rejection
type Verifier ¶
type Verifier interface { Name() string Verify(ctx context.Context, report *types.ReportTaskSingleReport, reportTask *types.ReportTask) *Rejection }
type Violations ¶
func (Violations) Reliability ¶
func (v Violations) Reliability(index int) int
func (Violations) String ¶
func (v Violations) String() string
Click to show internal directories.
Click to hide internal directories.