olfactor

package
v3.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 2 Imported by: 0

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 a string. In other words, the io stream can be monitored for a particular string, and if that string is written to the io stream, the olfactor will record that it has 'smelt' the string.

func New

func New(dst io.Writer, smell string) (io.Writer, *Olfactor)

New returns an io.Writer and an Olfactor. Writes to the writer will be forwarded to `dst` and the returned Olfactor will recored whether `smell` has been written to the io.Writer.

func (*Olfactor) Smelt

func (d *Olfactor) Smelt() bool

Smelt returns true if and only if the olfactor smelt the smell.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL