Registry
provide.foundation.transport.registry
¶
TODO: Add module docstring.
Classes¶
Functions¶
get_transport
¶
Get transport instance for a URI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Full URI to get transport for |
required |
Returns:
| Type | Description |
|---|---|
Transport
|
Transport instance ready to use |
Raises:
| Type | Description |
|---|---|
TransportNotFoundError
|
If no transport supports the URI scheme |
Source code in provide/foundation/transport/registry.py
get_transport_for_scheme
¶
Get transport class for a URI scheme.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scheme
|
str
|
URI scheme (e.g., 'http', 'https', 'ws') |
required |
Returns:
| Type | Description |
|---|---|
type[Transport]
|
Transport class that handles the scheme |
Raises:
| Type | Description |
|---|---|
TransportNotFoundError
|
If no transport is registered for the scheme |
Source code in provide/foundation/transport/registry.py
get_transport_info
¶
Get detailed information about a transport.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scheme_or_name
|
str
|
URI scheme or transport name |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
Transport information or None if not found |
Source code in provide/foundation/transport/registry.py
list_registered_transports
¶
List all registered transports.
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, Any]]
|
Dictionary mapping transport names to their info |
Source code in provide/foundation/transport/registry.py
register_transport
¶
register_transport(
transport_type: TransportType,
transport_class: type[Transport],
schemes: list[str] | None = None,
**metadata: Any
) -> None
Register a transport implementation in the Hub.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transport_type
|
TransportType
|
The primary transport type |
required |
transport_class
|
type[Transport]
|
Transport implementation class |
required |
schemes
|
list[str] | None
|
List of URI schemes this transport handles |
None
|
**metadata
|
Any
|
Additional metadata for the transport |
{}
|