PluginRead reads message from this plugin
()
| 287 | |
| 288 | // PluginRead reads message from this plugin |
| 289 | func (i *FileInput) PluginRead() (*Message, error) { |
| 290 | var msg Message |
| 291 | select { |
| 292 | case <-i.exit: |
| 293 | return nil, ErrorStopped |
| 294 | case buf := <-i.data: |
| 295 | i.stats.Add("read_from", 1) |
| 296 | msg.Meta, msg.Data = payloadMetaWithBody(buf) |
| 297 | return &msg, nil |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | func (i *FileInput) String() string { |
| 302 | return "File input: " + i.path |