connectors_utility 8.6.0.4.pre.20221115T001258Z → 8.6.0.4.pre.20221115T001453Z

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. metadata +1 -2
  3. data/lib/connectors/registry.rb +0 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3de813570562593126d6ae16c482b183f986e3808cf888efe66de65b3e94571
4
- data.tar.gz: 50039a69879868de3b7326ff99ccfc4a7be5668251bc4c82210d0448fcc41a88
3
+ metadata.gz: f8ce30cca8213ab393ffc87c34442b10e1a075d17a9df05589938bf0b88feb4c
4
+ data.tar.gz: 53a95968b2481cc53febfa847555979fe7719a861648020467557991d4d14d2e
5
5
  SHA512:
6
- metadata.gz: 711ac64f54581a8a16a3002e5394e7239cd565277ae037275b7643a432fcd3017000fe43cbe11245029ad16130a5aa6ce712a3a8c2c6078587ab110dd2455fd3
7
- data.tar.gz: bdf7e91260983c882e4d413a9008591eaa8706b26970ebe7716807427d2078bec801a41946e46418b08fc433fea12549aa037f6ba59924618889276f34ddd962
6
+ metadata.gz: b900a27b30fd10a035d205011fe80d5a72c977c3761f201a2debaaa09a21579008831fdd326ca67652e32dff79855e84cec312e5a4a5e1231f6e0576074ff142
7
+ data.tar.gz: 82d5f5851ed643a53faa95d773dfd41dcceef7afe4fadd065c7ab2613746c984473a7b6939b6809f79049a881ad2166f94b96c3a20accfe4e01571aed51e8294
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.20221115T001258Z
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
@@ -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