mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
change package from `main -> goreplay` this will allow importing `goreplay` as a package
34 lines
617 B
Go
34 lines
617 B
Go
package goreplay
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// DummyOutput used for debugging, prints all incoming requests
|
|
type DummyOutput struct {
|
|
}
|
|
|
|
// NewDummyOutput constructor for DummyOutput
|
|
func NewDummyOutput() (di *DummyOutput) {
|
|
di = new(DummyOutput)
|
|
|
|
return
|
|
}
|
|
|
|
// PluginWrite writes message to this plugin
|
|
func (i *DummyOutput) PluginWrite(msg *Message) (int, error) {
|
|
var n, nn int
|
|
var err error
|
|
n, err = os.Stdout.Write(msg.Meta)
|
|
nn, err = os.Stdout.Write(msg.Data)
|
|
n += nn
|
|
nn, err = os.Stdout.Write(payloadSeparatorAsBytes)
|
|
n += nn
|
|
|
|
return n, err
|
|
}
|
|
|
|
func (i *DummyOutput) String() string {
|
|
return "Dummy Output"
|
|
}
|