This commit is contained in:
bui 2021-04-30 11:05:15 +02:00
parent 52934934b1
commit 1ad06404f2
3 changed files with 5 additions and 5 deletions

View file

@ -67,7 +67,7 @@ type DataSource interface {
Configure([]byte, *log.Entry) error // Configure the datasource
GetMode() string // Get the mode (TAIL, CAT or SERVER)
SupportedModes() []string // Returns the mode supported by the datasource
SupportedURIPrefixes() []string // Returns the list of supported URI schemes (file:// s3:// ...)
SupportedDSN() []string // Returns the list of supported URI schemes (file:// s3:// ...)
OneShotAcquisition(chan types.Event, *tomb.Tomb) error // Start one shot acquisition(eg, cat a file)
LiveAcquisition(chan types.Event, *tomb.Tomb) error // Start live acquisition (eg, tail a file)
CanRun() error // Whether the datasource can run or not (eg, journalctl on BSD is a non-sense)

View file

@ -41,7 +41,7 @@ func (f *MockSource) LiveAcquisition(chan types.Event, *tomb.Tomb) error { re
func (f *MockSource) CanRun() error { return nil }
func (f *MockSource) GetMetrics() []prometheus.Collector { return nil }
func (f *MockSource) Dump() interface{} { return f }
func (f *MockSource) SupportedURIPrefixes() []string { return []string{"mock://"} }
func (f *MockSource) SupportedDSN() []string { return []string{"mock://"} }
//func (f *MockSource) New() DataSource { return &MockSource{} }
@ -330,7 +330,7 @@ func (f *MockCat) LiveAcquisition(chan types.Event, *tomb.Tomb) error {
func (f *MockCat) CanRun() error { return nil }
func (f *MockCat) GetMetrics() []prometheus.Collector { return nil }
func (f *MockCat) Dump() interface{} { return f }
func (f *MockCat) SupportedURIPrefixes() []string { return []string{"mock://"} }
func (f *MockCat) SupportedDSN() []string { return []string{"mock://"} }
//----
@ -363,7 +363,7 @@ func (f *MockTail) LiveAcquisition(out chan types.Event, t *tomb.Tomb) error {
func (f *MockTail) CanRun() error { return nil }
func (f *MockTail) GetMetrics() []prometheus.Collector { return nil }
func (f *MockTail) Dump() interface{} { return f }
func (f *MockTail) SupportedURIPrefixes() []string { return []string{"mock://"} }
func (f *MockTail) SupportedDSN() []string { return []string{"mock://"} }
//func StartAcquisition(sources []DataSource, output chan types.Event, AcquisTomb *tomb.Tomb) error {

View file

@ -39,7 +39,7 @@ type FileSource struct {
files []string
}
func (f *FileSource) SupportedURIPrefixes() []string {
func (f *FileSource) SupportedDSN() []string {
return []string{"file://"}
}