minos.common.injections.decorators

Classes

Inject

Inject class.

Injectable

Injectable decorator.

class Injectable[source]

Bases: object

Injectable decorator.

__init__(name)[source]
Parameters

name (str) –

property name: str

Get the name.

Returns

A str value.

class Inject[source]

Bases: object

Inject class.

classmethod resolve(type_)[source]

Resolve a dependency by type.

Parameters
  • type – The type of the dependency.

  • type_ (type[~V]) –

Returns

The dependency value.

Return type

V

static resolve_by_name(name, container=Provide['<container>'])[source]

Resolve a dependency by name.

Parameters
  • name (str) – The name of the dependency.

  • container (Container) – The container that contains the dependency.

Returns

The dependency value.

Return type

Any