Rearrange etw packages

This commit is contained in:
Kevin Parsons
2018-12-13 14:26:45 -08:00
parent bb628025f5
commit 62f7a6b7b9
8 changed files with 3 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
package etw
import (
"bytes"
"encoding/binary"
)
// EventData maintains a buffer which builds up the data for an ETW event. It
// needs to be paired with EventMetadata which describes the event.
type EventData struct {
buffer bytes.Buffer
}
// NewEventData returns a new EventData with an empty buffer.
func NewEventData() *EventData {
return &EventData{}
}
// AddString appends the data for a string to the end of the buffer.
func (ed *EventData) AddString(data string) {
binary.Write(&ed.buffer, binary.LittleEndian, []byte(data))
binary.Write(&ed.buffer, binary.LittleEndian, byte(0))
}