Module: Checker
Constant Summary
collapse
- STATES =
{1 => 'Joining',2 => 'Donor/Desynced',3 => 'Joined',4 => 'Synced'}
- CODES =
{200 => 'OK',503 => 'Service Unavailable'}
Instance Method Summary
collapse
Methods included from Galera
#check_cluster_size, #check_local_state, #check_ready_state, #get_galera_status, #run_checks
Instance Method Details
#format_text(texts) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/apprentice/checker.rb', line 8
def format_text(texts)
value = ''
if !texts.empty?
texts.each do |t|
value << "#{t}\r\n"
end
end
return value
end
|
#generate_response(code = 503, text) ⇒ Object
18
19
20
|
# File 'lib/apprentice/checker.rb', line 18
def generate_response(code = 503, text)
"HTTP/1.1 #{code} #{CODES[code]}\r\nContent-type: text/plain\r\nContent-length: #{text.length}\r\n\r\n#{text}"
end
|