Class: Locd::Agent::Proxy
- Inherits:
-
Locd::Agent
- Object
- Locd::Agent
- Locd::Agent::Proxy
- Includes:
- System
- Defined in:
- lib/locd/agent/proxy.rb
Overview
An server Locd::Agent (HTTP only at the moment) that the proxy can route requests to.
Constant Summary collapse
- TO_H_NAMES =
Attribute / method names that Locd::Agent#to_h uses.
Locd::Agent::TO_H_NAMES.union [:port, :url]
Instance Attribute Summary
Attributes inherited from Locd::Agent
Instance Methods: Attribute Readers collapse
-
#port ⇒ Fixnum
Port service runs on.
-
#url ⇒ String
The URL the agent can be reached at through the proxy.
Class Method Summary collapse
- .default_cmd_template ⇒ return_type
- .default_write_kwds(cmd_template: self.default_cmd_template, **kwds) ⇒ Object
-
.label_name ⇒ String
The non-namespace part of the proxy's label.
Methods included from System
class_for, classes, included, label?, plist?
Methods inherited from Locd::Agent
#<=>, add, add_or_update, all, class_for, #cmd_template, #config, create_plist_data, default_log_path, #default_log_path?, #err_path, exists?, find_all, find_all!, find_only!, from_path, get, #initialize, #label, labels, #last_exit_code, #load, #log_paths, #out_path, #pid, plist?, plist_abs_path, plists, #reload, #remove, render_cmd, resolve_log_path, #restart, #running?, #start, #status, #stop, #stopped?, #to_h, #to_json, #to_yaml, #unload, #update, user_plist_abs_dir, #workdir
Constructor Details
This class inherits a constructor from Locd::Agent
Class Method Details
.default_cmd_template ⇒ return_type
Document cmd_template method.
Returns @todo Document return value.
69 70 71 |
# File 'lib/locd/agent/proxy.rb', line 69 def self.default_cmd_template "{bin} proxy run" end |
.default_write_kwds(cmd_template: self.default_cmd_template, **kwds) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/locd/agent/proxy.rb', line 74 def self.default_write_kwds cmd_template: self.default_cmd_template, **kwds super( keep_alive: true, run_at_load: true, port: Locd.config[:proxy, :port], cmd_template: cmd_template, **kwds, label: self.label ) end |
.label_name ⇒ String
Returns The non-namespace part of the proxy's label.
56 57 58 |
# File 'lib/locd/agent/proxy.rb', line 56 def self.label_name "proxy" end |
Instance Method Details
#port ⇒ Fixnum
Returns Port service runs on.
98 99 100 |
# File 'lib/locd/agent/proxy.rb', line 98 def port config['port'] end |
#url ⇒ String
Returns The URL the agent can be reached at through the proxy.
105 106 107 |
# File 'lib/locd/agent/proxy.rb', line 105 def url "http://#{ label }:#{ Locd.get_port }" end |