connectors_utility 8.6.0.4.pre.20221115T001258Z → 8.6.0.4.pre.20221115T001812Z
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/core/filtering/validation_status.rb +17 -0
- metadata +2 -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: ac5e3edace211b9ddceef02ec8785a9967ddbce0c346f629f40bce93bb1e4951
|
4
|
+
data.tar.gz: e766607f3784e051d52beedb5acec6a8e1fdbfc8334245980c21ac2e06777c10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8cb0768b2bd020d16b54bde70b396f88316fa68092663d0cf05045140b932e94e4aeb3646700527bc07517fff04e7296efccf77d22df8aad6ddbb7b7eaaa7b1
|
7
|
+
data.tar.gz: ae307da6fdec1df3733d910ee7df68aad9fb52f15710539dabde845a405359534c63793649da5445c0191b2c51252ca3616e1f515177038dc317302e95cfcd64
|
@@ -0,0 +1,17 @@
|
|
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
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Core
|
10
|
+
module Filtering
|
11
|
+
class ValidationStatus
|
12
|
+
INVALID = 'invalid'
|
13
|
+
VALID = 'valid'
|
14
|
+
EDITED = 'edited'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
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.20221115T001812Z
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -104,11 +104,11 @@ 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
|
111
110
|
- lib/core/elastic_connector_actions.rb
|
111
|
+
- lib/core/filtering/validation_status.rb
|
112
112
|
- lib/core/scheduler.rb
|
113
113
|
- lib/utility.rb
|
114
114
|
- lib/utility/bulk_queue.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
|