mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
hand-code. This method is as fast as the hand-coded method and with less writing. - Make message registration easier with a simple 'register' function: class Foo < Message register end We dynamically generate the message 'type' by the class name.
22 lines
564 B
Ruby
22 lines
564 B
Ruby
require "lib/net/message"
|
|
|
|
module LogStash; module Net; module Messages
|
|
class SearchRequest < RequestMessage
|
|
register
|
|
|
|
# Message attributes
|
|
hashbind :query, "/args/query"
|
|
hashbind :log_type, "/args/log_type"
|
|
hashbind :offset, "/args/offset"
|
|
hashbind :limit, "/args/limit"
|
|
end # class SearchRequest
|
|
|
|
class SearchResponse < ResponseMessage
|
|
register
|
|
|
|
# Message attributes
|
|
hashbind :results, "/args/results"
|
|
hashbind :finished, "/args/finished"
|
|
|
|
end # class SearchResponse
|
|
end; end; end # module LogStash::Net::Messages
|