2022-10-01 04:35:03 +00:00
|
|
|
# Python imports
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
|
|
|
# Application imports
|
2023-03-28 00:53:47 +00:00
|
|
|
from .singleton import Singleton
|
2022-10-01 04:35:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-28 00:53:47 +00:00
|
|
|
class EndpointRegistry(Singleton):
|
2022-10-01 04:35:03 +00:00
|
|
|
def __init__(self):
|
|
|
|
self._endpoints = {}
|
|
|
|
|
|
|
|
def register(self, rule, **options):
|
|
|
|
def decorator(f):
|
|
|
|
self._endpoints[rule] = f
|
|
|
|
return f
|
|
|
|
|
|
|
|
return decorator
|
|
|
|
|
|
|
|
def get_endpoints(self):
|
|
|
|
return self._endpoints
|