minos.common.config.v1

Classes

ConfigV1

A Minos configuration provides information on the connection points available at that service.

class ConfigV1[source]

Bases: Config

A Minos configuration provides information on the connection points available at that service. It consists of the following parts:

  • Service meta-information (such as name, or version).

  • REST Service endpoints available.

  • Repository database connection for event sourcing.

  • Snapshot database connection.

  • Events it publishes/consumes from de given Kafka service.

  • Commands it reacts to from other microservices.

  • Sagas it takes part on.

DEFAULT_VALUES: dict[str, Any] = {}
__init__(path, with_environment=True, **kwargs)
Parameters
static __new__(cls, *args, **kwargs)
Return type

Config

property already_destroyed: bool

Already Destroy getter.

Returns

A boolean value.

property already_setup: bool

Already Setup getter.

Returns

A boolean value.

async destroy()

Destroy miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

property file_path: pathlib.Path

Get the config’s file path.

Returns

A Path instance.

classmethod from_config(config=None, **kwargs)

Build a new instance from config.

Parameters
  • config (Optional[Union[Config, Path]]) – Config instance. If None is provided, default config is chosen.

  • kwargs – Additional named arguments.

Returns

A instance of the called class.

Return type

S

get_aggregate()

Get the aggregate value.

Returns

A dict instance containing the aggregate’s config values.

Return type

dict[str, Any]

get_by_key(key)

Get a value by key.

Parameters

key (str) – The key that identifies the value.

Returns

A value instance.

Return type

Any

get_database_by_name(name)

Get the database value by name.

Parameters

name (Optional[str]) – The name of the database. If None is provided then the default database will be used.

Returns

A dict containing the database’s config values.

Return type

dict[str, Any]

get_databases()

Get all databases’ values.

Returns

A mapping from database name to database’s config values.

Return type

dict[str, dict[str, Any]]

get_default_database()

Get the default database value.

Returns

A dict containing the database’s config values.

get_discovery()

Get the discovery value.

Returns

A dict instance containing the discovery’s config values.

Return type

dict[str, Any]

classmethod get_injectable_name()

Get the injectable name.

Returns

A str value.

Return type

str

get_injections()

Get the injections value.

Returns

A list of InjectableMixin types.

Return type

list[type[InjectableMixin]]

get_interface_by_name(name)

Get the interface value by name.

Parameters

name (str) – The name of the interface.

Returns

A dict containing the interface’s config values.

Return type

dict[str, Any]

get_interfaces()

Get all interfaces’ values.

Returns

A mapping from interface name to interface’s config values.

Return type

dict[str, dict[str, Any]]

get_middleware()

Get the middleware value.

Returns

A list of Callable instances.

Return type

list[collections.abc.Callable]

get_name()

Get the name value.

Returns

A str instance.

Return type

str

get_pools()

Get the pools value.

Returns

A dict with pool names as keys and pools as values.

Return type

dict[str, type]

get_routers()

Get the routers value.

Returns

A list of type instances.

Return type

list[type]

get_saga()

Get the saga value.

Returns

A dict instance containing the saga’s config values.

Return type

dict[str, Any]

get_services()

Get the services value.

Returns

A list of type instances.

Return type

list[type]

get_type_by_key(key)

Get a type instance by key.

Parameters

key (str) – The key that identifies the value.

Returns

A type instance.

Return type

type

async setup()

Setup miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

property version: int

Get the version value.

Returns

A int instance.