Documentation
¶
Overview ¶
Package prefs remembers what you ran last time.
Filling in the same interface, destination and MAC on every invocation gets old fast, so Wireblast writes each run's settings to ~/.wireblast and offers them back as the starting point for the next interactive session.
Two rules keep this from becoming surprising:
- Anything you pass on the command line wins over what was saved.
- --no-tui ignores saved settings entirely. A script has to mean exactly what it says, whatever happens to be in a file in someone's home directory.
Index ¶
Constants ¶
const ( // DirName is the directory under the user's home. DirName = ".wireblast" // LastFile holds the most recent run, used to prepopulate the wizard. LastFile = "last-run.json" // HistoryFile holds recent runs, newest first. HistoryFile = "history.json" // HistoryLimit is how many runs are kept. HistoryLimit = 20 )
Layout of the state directory.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
// At is when the run started.
At time.Time `json:"at"`
// Config is what it was configured with.
Config config.Config `json:"config"`
}
Entry is one remembered run.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes the remembered settings.
Every method degrades quietly: an unreadable or corrupt state file must never stop someone generating traffic, so failures mean "no history" rather than an error the user has to deal with.
func New ¶
func New() *Store
New returns a Store rooted at ~/.wireblast, or at $WIREBLAST_HOME when that is set (which is also how the tests get a scratch directory).