Class: Kumonos::Envoy::Cluster

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumonos/envoy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connect_timeout_msObject

Returns the value of attribute connect_timeout_ms

Returns:

  • (Object)

    the current value of connect_timeout_ms



89
90
91
# File 'lib/kumonos/envoy.rb', line 89

def connect_timeout_ms
  @connect_timeout_ms
end

#hostsObject

Returns the value of attribute hosts

Returns:

  • (Object)

    the current value of hosts



89
90
91
# File 'lib/kumonos/envoy.rb', line 89

def hosts
  @hosts
end

#lb_typeObject

Returns the value of attribute lb_type

Returns:

  • (Object)

    the current value of lb_type



89
90
91
# File 'lib/kumonos/envoy.rb', line 89

def lb_type
  @lb_type
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



89
90
91
# File 'lib/kumonos/envoy.rb', line 89

def name
  @name
end

#tlsObject

Returns the value of attribute tls

Returns:

  • (Object)

    the current value of tls



89
90
91
# File 'lib/kumonos/envoy.rb', line 89

def tls
  @tls
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



89
90
91
# File 'lib/kumonos/envoy.rb', line 89

def type
  @type
end

Class Method Details

.build(h) ⇒ Object



91
92
93
# File 'lib/kumonos/envoy.rb', line 91

def build(h)
  new(h.fetch('name'), h.fetch('type'), h.fetch('tls'), h.fetch('connect_timeout_ms'), h.fetch('lb_type'), h.fetch('hosts'))
end

Instance Method Details

#to_hObject



96
97
98
99
100
101
102
103
104
# File 'lib/kumonos/envoy.rb', line 96

def to_h
  h = super
  if tls
    cluster[:ssl_context] = {}
  else
    h.delete(:tls)
  end
  h
end