RepoRegistry
🛈 DocStrings¶
Registry for repository implementations.
Source code in src/githarbor/registry.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
clear_cache
classmethod
¶
create
classmethod
¶
create(name: str, **kwargs: Any) -> Repository
Create a proxy-wrapped repository instance by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the repository type. |
required |
**kwargs
|
Any
|
Repository-specific configuration. |
{}
|
Returns:
| Type | Description |
|---|---|
Repository
|
Proxy-wrapped repository instance. |
Raises:
| Type | Description |
|---|---|
RepositoryNotFoundError
|
If repository type is not found or creation fails. |
Source code in src/githarbor/registry.py
from_url
classmethod
¶
from_url(url: str, **kwargs: Any) -> Repository
Create a proxy-wrapped repository instance from a URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL. |
required |
**kwargs
|
Any
|
Repository-specific configuration. |
{}
|
Returns:
| Type | Description |
|---|---|
Repository
|
Proxy-wrapped repository instance. |
Raises:
| Type | Description |
|---|---|
RepositoryNotFoundError
|
If no implementation supports the URL. |
Source code in src/githarbor/registry.py
get
classmethod
¶
get(url: str, **kwargs: Any) -> Repository
Get cached repository instance or create new one.
Source code in src/githarbor/registry.py
get_owner
classmethod
¶
get_owner(url: str, **kwargs: Any) -> Owner
Get cached owner instance or create new one.
Source code in src/githarbor/registry.py
get_registered_repo_classes
classmethod
¶
Get a list of all registered repository types.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of registered repository type names. |
get_repo_class_for_url
classmethod
¶
get_repo_class_for_url(url: str) -> type[BaseRepository] | None
Get the repository class that can handle the given URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Repository URL. |
required |
Returns:
| Type | Description |
|---|---|
type[BaseRepository] | None
|
Repository class or None if no implementation supports the URL. |
Source code in src/githarbor/registry.py
owner_from_url
classmethod
¶
owner_from_url(url: str, **kwargs: Any) -> Owner
Create an owner instance from a URL.
Source code in src/githarbor/registry.py
register
classmethod
¶
Decorator to register a repository class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the repository under. |
required |
Source code in src/githarbor/registry.py
register_owner
classmethod
¶
Decorator to register an owner class.