Documentation
¶
Index ¶
- Constants
- Variables
- func AdFactLines(a ad.Ad, tz *time.Location) []string
- func ContainsPII(s string) bool
- func Invalidate(conversationID int) error
- func InvalidateForAd(adID int) error
- func RedactNames(s string, names ...string) string
- func RedactText(s string) string
- func SanitizeOpinionFields(fields ...string) bool
- func SetImageStore(store imagestore.Store)
- type Opinion
Constants ¶
const ( MinAssessment = 1 MaxAssessment = 10 )
Variables ¶
Functions ¶
func AdFactLines ¶
AdFactLines returns description history lines for UI display.
func ContainsPII ¶
ContainsPII reports whether s still has likely PII patterns.
func Invalidate ¶
Invalidate removes the cached opinion for one conversation.
func InvalidateForAd ¶
InvalidateForAd removes cached opinions for all conversations on an ad.
func RedactNames ¶
RedactNames replaces known participant names in text.
func RedactText ¶
RedactText replaces likely PII with a placeholder.
func SanitizeOpinionFields ¶
SanitizeOpinionFields returns false if any field still contains PII.
func SetImageStore ¶
func SetImageStore(store imagestore.Store)
SetImageStore sets the store used to attach ad images to opinions.
Types ¶
type Opinion ¶
type Opinion struct {
ConversationID int `db:"conversation_id"`
GeneratedAt time.Time `db:"generated_at"`
Summary string `db:"summary"`
Assessment int `db:"assessment"`
AssessmentDetail string `db:"assessment_detail"`
Resolution string `db:"resolution"`
Reasoning string `db:"reasoning"`
}
Opinion is a cached or freshly generated dispute assessment.
func GetOrGenerate ¶
GetOrGenerate returns a cached opinion or generates and stores one.