Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Olfactor ¶
type Olfactor struct {
// contains filtered or unexported fields
}
Olfactor may be used for 'sniffing' an io stream for strings. In other words, the io stream can be monitored for a particular strings, and if they string are written to the io stream, the olfactor will record that it has 'smelt' that string.
func New ¶
New returns an io.Writer and an Olfactor. Writes to the writer will be forwarded to `dst` and the returned Olfactor will recored whether the elements of `smells` have been written to the io.Writer.
If a smell is the empty string, we consider it to have been smelt, even if nothing was wrtten to the io.Writer. This is consistent with the notion that writing an empty string to a writer is the same as writing nothing to the writer.