Documentation
¶
Overview ¶
Package scrubber is designed to be used in conjunction with the newman project for flexible email content sanitization
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scrubber ¶
Scrubber defines a method for sanitizing content
func DefaultHTMLScrubber ¶
func DefaultHTMLScrubber() Scrubber
DefaultHTMLScrubber returns an instance of defaultHTMLScrubber
func DefaultTextScrubber ¶
func DefaultTextScrubber() Scrubber
DefaultTextScrubber returns an instance of defaultTextScrubber
type ScrubberFunc ¶
ScrubberFunc is an adapter that allows the use of functions as Scrubbers
Example ¶
package main import ( "fmt" "strings" "github.com/theopenlane/newman/scrubber" ) func main() { scrubFunc := scrubber.ScrubberFunc(func(message string) string { return strings.ReplaceAll(strings.ToLower(strings.TrimSpace(message)), " ", "_") }) scrubdMessage := scrubFunc.Scrub(" some text ") fmt.Println(scrubdMessage) }
Output:
func (ScrubberFunc) Scrub ¶
func (f ScrubberFunc) Scrub(message string) string
Scrub calls the function f with the given message
Click to show internal directories.
Click to hide internal directories.