Class: Connectors::Example::Connector
Instance Attribute Summary
#advanced_filter_config, #rules
Class Method Summary
collapse
Instance Method Summary
collapse
configurable_fields_indifferent_access, #do_health_check!, filter_transformers, #is_healthy?, kibana_features, #metadata, simple_rules_validators, validate_filtering, #yield_with_handling_tolerable_errors
Constructor Details
#initialize(configuration: {}, job_description: nil) ⇒ Connector
Returns a new instance of Connector.
39
40
41
|
# File 'lib/connectors/example/connector.rb', line 39
def initialize(configuration: {}, job_description: nil)
super
end
|
Class Method Details
.advanced_snippet_validators ⇒ Object
.configurable_fields ⇒ Object
Field ‘Foo’ won’t have a default value. Field ‘Bar’ will have the default value ‘Value’.
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/connectors/example/connector.rb', line 26
def self.configurable_fields
{
'foo' => {
'label' => 'Foo',
'value' => nil
},
:bar => {
:label => 'Bar',
:value => 'Value'
}
}
end
|
.display_name ⇒ Object
21
22
23
|
# File 'lib/connectors/example/connector.rb', line 21
def self.display_name
'Example Connector'
end
|
.service_type ⇒ Object
17
18
19
|
# File 'lib/connectors/example/connector.rb', line 17
def self.service_type
'example'
end
|
Instance Method Details
#do_health_check ⇒ Object
43
44
45
46
47
48
|
# File 'lib/connectors/example/connector.rb', line 43
def do_health_check
end
|
#yield_documents ⇒ Object
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/connectors/example/connector.rb', line 54
def yield_documents
attachments = [
load_attachment('first_attachment.txt'),
load_attachment('second_attachment.txt'),
load_attachment('third_attachment.txt'),
]
attachments.each_with_index do |att, index|
data = { id: (index + 1).to_s, name: "example document #{index + 1}", _attachment: File.read(att) }
yield data
end
end
|