connectors_utility 8.6.0.4.pre.20221115T000648Z → 8.6.0.4.pre.20221115T001453Z
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/core/connector_settings.rb +1 -1
- metadata +1 -2
- data/lib/connectors/registry.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ce30cca8213ab393ffc87c34442b10e1a075d17a9df05589938bf0b88feb4c
|
4
|
+
data.tar.gz: 53a95968b2481cc53febfa847555979fe7719a861648020467557991d4d14d2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b900a27b30fd10a035d205011fe80d5a72c977c3761f201a2debaaa09a21579008831fdd326ca67652e32dff79855e84cec312e5a4a5e1231f6e0576074ff142
|
7
|
+
data.tar.gz: 82d5f5851ed643a53faa95d773dfd41dcceef7afe4fadd065c7ab2613746c984473a7b6939b6809f79049a881ad2166f94b96c3a20accfe4e01571aed51e8294
|
@@ -8,7 +8,6 @@
|
|
8
8
|
|
9
9
|
require 'active_support/core_ext/hash/indifferent_access'
|
10
10
|
require 'connectors/connector_status'
|
11
|
-
require 'connectors/registry'
|
12
11
|
require 'core/elastic_connector_actions'
|
13
12
|
require 'utility'
|
14
13
|
|
@@ -36,6 +35,7 @@ module Core
|
|
36
35
|
end
|
37
36
|
|
38
37
|
def self.fetch_native_connectors(page_size = DEFAULT_PAGE_SIZE)
|
38
|
+
require 'connectors/registry' unless defined?(Connectors::REGISTRY)
|
39
39
|
query = {
|
40
40
|
bool: {
|
41
41
|
filter: [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: connectors_utility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.6.0.4.pre.
|
4
|
+
version: 8.6.0.4.pre.20221115T001453Z
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -104,7 +104,6 @@ files:
|
|
104
104
|
- NOTICE.txt
|
105
105
|
- lib/connectors/connector_status.rb
|
106
106
|
- lib/connectors/crawler/scheduler.rb
|
107
|
-
- lib/connectors/registry.rb
|
108
107
|
- lib/connectors/sync_status.rb
|
109
108
|
- lib/connectors_utility.rb
|
110
109
|
- lib/core/connector_settings.rb
|
data/lib/connectors/registry.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
3
|
-
# or more contributor license agreements. Licensed under the Elastic License;
|
4
|
-
# you may not use this file except in compliance with the Elastic License.
|
5
|
-
#
|
6
|
-
|
7
|
-
module Connectors
|
8
|
-
class Factory
|
9
|
-
attr_reader :connectors
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
@connectors = {}
|
13
|
-
end
|
14
|
-
|
15
|
-
def register(name, klass)
|
16
|
-
@connectors[name] = klass
|
17
|
-
end
|
18
|
-
|
19
|
-
def registered?(name)
|
20
|
-
@connectors.has_key?(name)
|
21
|
-
end
|
22
|
-
|
23
|
-
def connector_class(name)
|
24
|
-
@connectors[name]
|
25
|
-
end
|
26
|
-
|
27
|
-
def connector(name, configuration, job_description: {})
|
28
|
-
klass = connector_class(name)
|
29
|
-
if klass.present?
|
30
|
-
return klass.new(configuration: configuration, job_description: job_description)
|
31
|
-
end
|
32
|
-
raise "Connector #{name} is not yet registered. You need to register it before use"
|
33
|
-
end
|
34
|
-
|
35
|
-
def registered_connectors
|
36
|
-
@connectors.keys.sort
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
REGISTRY = Factory.new
|
41
|
-
|
42
|
-
require_relative './example/connector'
|
43
|
-
REGISTRY.register(Connectors::Example::Connector.service_type, Connectors::Example::Connector)
|
44
|
-
|
45
|
-
# loading plugins (might replace this with a directory scan and conventions on names)
|
46
|
-
require_relative './gitlab/connector'
|
47
|
-
|
48
|
-
REGISTRY.register(Connectors::GitLab::Connector.service_type, Connectors::GitLab::Connector)
|
49
|
-
|
50
|
-
require_relative 'mongodb/connector'
|
51
|
-
REGISTRY.register(Connectors::MongoDB::Connector.service_type, Connectors::MongoDB::Connector)
|
52
|
-
end
|