MCPcopy
hub / github.com/bettercap/bettercap / startRecording

Method startRecording

modules/api_rest/api_rest_record.go:80–101  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

78}
79
80func (mod *RestAPI) startRecording(filename string) (err error) {
81 if mod.recording {
82 return mod.errAlreadyRecording()
83 } else if mod.replaying {
84 return mod.errAlreadyReplaying()
85 } else if err, mod.recClock = mod.IntParam("api.rest.record.clock"); err != nil {
86 return err
87 } else if mod.recordFileName, err = fs.Expand(filename); err != nil {
88 return err
89 }
90
91 // we need the api itself up and running
92 if !mod.Running() {
93 if err = mod.Start(); err != nil {
94 return err
95 }
96 }
97
98 go mod.recorder()
99
100 return nil
101}
102
103func (mod *RestAPI) stopRecording() error {
104 if !mod.recording {

Callers 1

NewRestAPIFunction · 0.95

Calls 6

errAlreadyRecordingMethod · 0.95
errAlreadyReplayingMethod · 0.95
StartMethod · 0.95
recorderMethod · 0.95
IntParamMethod · 0.80
RunningMethod · 0.65

Tested by

no test coverage detected