ebonite.runtime.interface package

exception ebonite.runtime.interface.ExecutionError[source]

Bases: Exception

Exception which is raised when interface method is executed with arguments incompatible to its signature

class ebonite.runtime.interface.Interface[source]

Bases: object

Collection of executable methods with explicitly defined signatures

exposed = {}
executors = {}
execute(method: str, args: Dict[str, object])[source]

Executes given method with given arguments

Parameters:
  • method – method name to execute
  • args – arguments to pass into method
Returns:

method result

exposed_methods()[source]

Lists signatures of methods exposed by interface

Returns:list of signatures
get_method(method_name: str) → callable[source]

Returns callable exposed method object with given name

Parameters:method_name – method name
exposed_method_signature(method_name: str) → pyjackson.core.Signature[source]

Gets signature of given method

Parameters:method_name – name of method to get signature for
Returns:signature
exposed_method_docs(method_name: str) → str[source]

Gets docstring for given method

Parameters:method_name – name of the method
Returns:docstring
exposed_method_args(method_name: str) → List[pyjackson.core.Field][source]

Gets argument types of given method

Parameters:method_name – name of method to get argument types for
Returns:list of argument types
exposed_method_returns(method_name: str) → pyjackson.core.Field[source]

Gets return type of given method

Parameters:method_name – name of method to get return type for
Returns:return type
class ebonite.runtime.interface.InterfaceLoader[source]

Bases: ebonite.runtime.utils.RegType

Base class for loaders of Interface

load() → ebonite.runtime.interface.base.Interface[source]
static get(class_path) → ebonite.runtime.interface.base.InterfaceLoader[source]
ebonite.runtime.interface.expose(class_method)[source]

Decorator which exposes given method into interface

Parameters:class_method – method to expose
Returns:given method with modifications