Class: OsCtld::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/osctld/config.rb

Overview

osctld config file interface

Defined Under Namespace

Classes: CpuPackage, CpuScheduler, GarbageCollector, Mbuffer, SendReceive, TrashBin

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Config

Returns a new instance of Config.

Parameters:

  • path (String)


156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/osctld/config.rb', line 156

def initialize(path)
  cfg = JSON.parse(File.read(path))

  @debug = cfg.fetch('debug', false)
  @apparmor_paths = cfg.fetch('apparmor_paths', [])
  @enable_time_namespace = cfg.fetch('enable_time_namespace', true)
  @ctstartmenu = cfg['ctstartmenu']
  @enable_lock_registry = cfg.fetch('lock_registry', false)
  @cpu_scheduler = CpuScheduler.new(cfg.fetch('cpu_scheduler', {}))
  @send_receive = SendReceive.new(cfg.fetch('send_receive', {}))
  @trash_bin = TrashBin.new(cfg.fetch('trash_bin', {}))
  @garbage_collector = GarbageCollector.new(cfg.fetch('garbage_bin', {}))
end

Instance Attribute Details

#apparmor_pathsArray<String> (readonly)

Returns:

  • (Array<String>)


130
131
132
# File 'lib/osctld/config.rb', line 130

def apparmor_paths
  @apparmor_paths
end

#cpu_schedulerCpuScheduler (readonly)

Returns:



144
145
146
# File 'lib/osctld/config.rb', line 144

def cpu_scheduler
  @cpu_scheduler
end

#ctstartmenuString (readonly)

Returns:

  • (String)


137
138
139
# File 'lib/osctld/config.rb', line 137

def ctstartmenu
  @ctstartmenu
end

#debugBoolean (readonly) Also known as: debug?

Enable extra debug logs

Returns:

  • (Boolean)


126
127
128
# File 'lib/osctld/config.rb', line 126

def debug
  @debug
end

#enable_lock_registryBoolean (readonly) Also known as: enable_lock_registry?

Returns:

  • (Boolean)


140
141
142
# File 'lib/osctld/config.rb', line 140

def enable_lock_registry
  @enable_lock_registry
end

#enable_time_namespaceBoolean (readonly) Also known as: enable_time_namespace?

Returns:

  • (Boolean)


133
134
135
# File 'lib/osctld/config.rb', line 133

def enable_time_namespace
  @enable_time_namespace
end

#garbage_collectorGarbageCollector (readonly)

Returns:



153
154
155
# File 'lib/osctld/config.rb', line 153

def garbage_collector
  @garbage_collector
end

#send_receiveSendReceive (readonly)

Returns:



147
148
149
# File 'lib/osctld/config.rb', line 147

def send_receive
  @send_receive
end

#trash_binTrashBin (readonly)

Returns:



150
151
152
# File 'lib/osctld/config.rb', line 150

def trash_bin
  @trash_bin
end