()
| 37 | } |
| 38 | |
| 39 | func (f *Filter) String() ( pretty string ) { |
| 40 | if f.ForceDns { pretty += ", forceDns" } |
| 41 | if f.Ads { pretty += ", ads" } |
| 42 | if f.Trackers { pretty += ", trackers" } |
| 43 | if f.Malware { pretty += ", malware" } |
| 44 | if f.SafeSearch { pretty += ", safe search" } |
| 45 | if f.PG > 0 { pretty += ", pg-" + strconv.Itoa( f.PG ) } |
| 46 | if f.Malicious { pretty += ", malicious" } |
| 47 | if len(f.Risk) > 0 { pretty += ", risk=" + strings.Join( f.Risk, "," ) } |
| 48 | if len(f.Illegal) > 0 { pretty += ", illegal=" + strings.Join( f.Illegal, "," ) } |
| 49 | if len(f.Whitelist) > 0 { pretty += ", whitelist=" + strings.Join( f.Whitelist, "," ) } |
| 50 | if len(f.Blacklist) > 0 { pretty += ", blacklist=" + strings.Join( f.Blacklist, "," ) } |
| 51 | if len(f.Categories) > 0 { pretty += ", categories=" + strings.Join( f.Categories, "," ) } |
| 52 | pretty = strings.TrimPrefix( pretty, ", " ) |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | func (f *Filter) Check() error { |
| 57 | switch f.PG { |
no outgoing calls
no test coverage detected