Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader is a struct that loads events from a file or stream asynchronously into a queue.
func NewLoader ¶
func NewLoader() *Loader
Example ¶
loader := NewLoader()
// Load the eve.json file asynchronously
if err := loader.LoadFile("pathto/eve.json"); err != nil {
log.Fatal(err)
}
// Range over the events and print dns answers to stdout
for loader.More() {
if err := loader.Err(); err != nil {
log.Fatal(err)
}
event := loader.Event()
if !event.DNS.Empty() && event.DNS.Type == "answer" {
log.Println(event.DNS)
}
}
if err := loader.Err(); err != nil {
log.Fatal(err)
}
func (*Loader) Event ¶
Event removes and returns the next events.EveEvent from the queue.
func (*Loader) ParseReaderAsynchronously ¶
func (l *Loader) ParseReaderAsynchronously(r io.ReadCloser) error
Click to show internal directories.
Click to hide internal directories.