Class: Entrance::Agent::Service

Inherits:
Restful
  • Object
show all
Extended by:
Globalizer
Defined in:
lib/entrance/agent/service.rb

Instance Attribute Summary collapse

Attributes included from Globalizer

#current

Attributes inherited from Restful

#id

Instance Method Summary collapse

Methods inherited from Restful

#to_rest

Constructor Details

#initialize(params = {}) ⇒ Service

Returns a new instance of Service.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/entrance/agent/service.rb', line 11

def initialize params={}
  super params.merge(load:true)
  backend_params = {
    mode: :http,
    enable_frontend: false,
    port: 0,
    path: zk_path,
    application: name,
    uri: Config.current.health_url
  }
  @backend  = Synapse::Easy::Service.new backend_params
  acl_params = {
    as_digest: true,
    url: url,
    backend: backend
  }
  @acl      = Acl::UrlBackendRouter.new acl_params
  backend.application = acl.label
  backend.name        = acl.label
end

Instance Attribute Details

#aclObject

Returns the value of attribute acl.



10
11
12
# File 'lib/entrance/agent/service.rb', line 10

def acl
  @acl
end

#application_idObject

Returns the value of attribute application_id.



10
11
12
# File 'lib/entrance/agent/service.rb', line 10

def application_id
  @application_id
end

#backendObject

Returns the value of attribute backend.



10
11
12
# File 'lib/entrance/agent/service.rb', line 10

def backend
  @backend
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/entrance/agent/service.rb', line 10

def name
  @name
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/entrance/agent/service.rb', line 10

def url
  @url
end

#zk_pathObject

Returns the value of attribute zk_path.



10
11
12
# File 'lib/entrance/agent/service.rb', line 10

def zk_path
  @zk_path
end