lomas_server.utils package

Submodules

lomas_server.utils.config module

class lomas_server.utils.config.ConfigLoader[source]

Bases: object

Singleton object that holds the config for the server.

Initialises the config by calling load_config() with its default arguments.

The config can be reloaded by calling load_config with other arguments.

get_config() Config[source]

Get the config.

Returns:

The config.

Return type:

Config

load_config(config_path: str = '/usr/lomas_server/runtime.yaml', secrets_path: str = '/usr/lomas_server/secrets.yaml') None[source]

Loads the config and the secret data from disk,.

Merges them and returns the config object.

Parameters:
  • config_path (str, optional) – The config filepath. Defaults to CONFIG_PATH.

  • secrets_path (str, optional) – The secrets filepath. Defaults to SECRETS_PATH.

Raises:

InternalServerException – If the config cannot be correctly interpreted.

set_config(config: Config) None[source]

Set the singleton’s config to config.

Parameters:

config (Config) – The new config.

lomas_server.utils.config.get_config() Config[source]

Get the config from the ConfigLoader Singleton instance.

Returns:

The config.

Return type:

Config

lomas_server.utils.query_examples module

Module contents