Module: EsHttpClient
- Defined in:
- lib/es_http_client.rb,
lib/es_http_client/ref.rb,
lib/es_http_client/page.rb,
lib/es_http_client/event.rb,
lib/es_http_client/client.rb,
lib/es_http_client/connection.rb,
lib/es_http_client/error_handler.rb,
lib/es_http_client/stream_events.rb,
lib/es_http_client/readonly_stream.rb,
lib/es_http_client/caught_up_stream.rb,
lib/es_http_client/writeable_stream.rb,
lib/es_http_client/es_http_client_error.rb
Defined Under Namespace
Modules: ExpectedVersion
Classes: CaughtUpStream, Client, Connection, ErrorHandler, EsHttpClientError, Event, Page, ReadonlyStream, Ref, StreamEvents, WriteableStream
Class Method Summary
collapse
Class Method Details
.connect(endpoint, username, password) ⇒ Object
14
15
16
|
# File 'lib/es_http_client.rb', line 14
def self.connect(endpoint, username, password)
Client.new(Connection.new(endpoint, username, password))
end
|
.create_event(type, data) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/es_http_client.rb', line 18
def self.create_event(type, data)
id = UUIDTools::UUID.random_create.to_s
timestamp = Time.now.strftime('%FT%T.%3N%:z')
data = data.merge({
occurredAt: timestamp
})
Event.new(id, type, data, timestamp, 0)
end
|