bui 4 년 전
부모
커밋
1ad06404f2
3개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      pkg/acquisition/acquisition.go
  2. 3 3
      pkg/acquisition/acquisition_test.go
  3. 1 1
      pkg/acquisition/modules/file/file.go

+ 1 - 1
pkg/acquisition/acquisition.go

@@ -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)

+ 3 - 3
pkg/acquisition/acquisition_test.go

@@ -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 {
 

+ 1 - 1
pkg/acquisition/modules/file/file.go

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