Hooks¶
-
class
statey.registry.RegistryHooks¶ Specifies hooks for handling different annotations and converting them to types
-
get_caster(from_type: statey.syms.types.Type, to_type: statey.syms.types.Type, registry: statey.registry.Registry) → Caster¶ Hook to get a caster object to cast from one type to another
-
get_differ(type: statey.syms.types.Type, registry: statey.registry.Registry) → Encoder¶ Handle the given type and produce an Differ instance for diffing values of that type
-
get_encoder(type: statey.syms.types.Type, registry: statey.registry.Registry, serializable: bool) → Encoder¶ Handle the given type and produce an Encoder instance that can encode values of that type
serializable indicates that encoded values that the Encoder produces should always be JSON-serializable
-
get_impl_serializer(impl: ObjectImplementation, type: statey.syms.types.Type, registry: statey.registry.Registry) → ObjectImplementationSerializer¶ Hook to get an implementation serializer from an implementation and type
-
get_impl_serializer_from_data(data: Any, registry: statey.registry.Registry) → ObjectImplementationSerializer¶ Hook to get an impl serializer from data
-
get_methods(type: statey.syms.types.Type, registry: statey.registry.Registry) → ObjectMethods¶ Hook to get methods for a particular type
-
get_namespace_serializer(ns: Namespace, registry: statey.registry.Registry) → NamespaceSerializer¶ Hook to get a namespace serializer from a namespace
-
get_namespace_serializer_from_data(data: Any, registry: statey.registry.Registry) → NamespaceSerializer¶ Hook to get a namespace serializer from data
-
get_object(value: Any, registry: statey.registry.Registry) → Object¶ Hook to create an objecxrt from an arbitrary value
-
get_object_serializer(obj: Object, registry: statey.registry.Registry) → ObjectSerializer¶ Hook to get an object serializer from an object
-
get_object_serializer_from_data(data: Any, registry: statey.registry.Registry) → ObjectSerializer¶ Hook to get an object serializer from data
-
get_plugin_installer(name: str, registry: statey.registry.Registry) → PluginInstaller¶ Hook to fetch a plugin installer
-
get_provider(name: str, params: Dict[str, Any], registry: statey.registry.Registry) → Provider¶ Hook to get a provider from a name and params
-
get_provider_config(name: str, params: Dict[str, Any], registry: statey.registry.Registry) → Dict[str, Any]¶ Hook to modify or set a default provider configuration
-
get_semantics(type: statey.syms.types.Type, registry: statey.registry.Registry) → Semantics¶ Handle the given type and produce a Semantics instance for objects of that type
-
get_session_serializer(session: Session, registry: statey.registry.Registry) → SessionSerializer¶ Hook to get a session serializer from a session
-
get_session_serializer_from_data(data: Any, registry: statey.registry.Registry) → SessionSerializer¶ Hook to get a session serializer from data
-
get_state_manager(registry: statey.registry.Registry) → StateManager¶ Hook to fetch a state manager to use for planning operations
-
get_type(annotation: Any, registry: statey.registry.Registry, meta: Dict[str, Any]) → statey.syms.types.Type¶ Handle the given annotation and return a Type, or None to indicate it can’t be handled by this hook
-
get_type_serializer(type: statey.syms.types.Type, registry: statey.registry.Registry) → TypeSerializer¶ Handle the given type and produce an TypeSerializer instance that can encode values of that type
-
get_type_serializer_from_data(data: Any, registry: statey.registry.Registry) → TypeSerializer¶ Handle the given type and produce a TypeSerializer instance for objects of that type
-
infer_type(obj: Any, registry: statey.registry.Registry) → statey.syms.types.Type¶ Infer a type given an object
-
register(plugin: Any, registry: statey.registry.Registry) → None¶ Hook called before a plugin is registeed to add additional side effects.
-
-
class
statey.provider.ProviderHooks¶ Defines hooks to power the default provider
-
get_resource(name: str, provider: statey.provider.Provider) → Resource¶ Analogous to the Provider.get_resource() method
-
-
class
statey.syms.session.SessionHooks¶ Hook for pluggable functionality in sessions
-
after_set(key: str, value: Any, type: statey.syms.types.Type) → Any¶ Hook after we’ve already set a value to customize the value returned instead of a reference to the
-
before_set(key: str, value: Any) → Tuple[Any, statey.syms.types.Type]¶ Hook to handle a value before the usual logic in the set() method. This should return a (value, type) tuple, where type can be utils.MISSING to indicate we want to continue to use the default type inference logic.
-