
    9i\
                        U d Z ddlmZ ddlZddlZddlmZ ddlmZm	Z	 ddl
mZmZmZ dd	lmZ dd
lmZ ddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZ dZded<   	 	 	 	 	 	 ddZg dZ y)zg
Implementations of storage backends to be used with
:class:`limits.strategies.RateLimiter` strategies
    )annotationsN   )ConfigurationError)	TypeAliascast   )MovingWindowSupportSlidingWindowCounterSupportStorage)MemcachedStorage)MemoryStorage)MongoDBStorageMongoDBStorageBase)RedisStorage)RedisClusterStorage)RedisSentinelStorage)SCHEMESz$Storage | limits.aio.storage.Storager   StorageTypesc                    t         j                  j                  |       j                  }|t        vrt        d|        t        t        t	        |   | fi |      S )a%  
    Factory function to get an instance of the storage class based
    on the uri of the storage. In most cases using it should be sufficient
    instead of directly instantiating the storage classes. for example::

        from limits.storage import storage_from_string

        memory = storage_from_string("memory://")
        memcached = storage_from_string("memcached://localhost:11211")
        redis = storage_from_string("redis://localhost:6379")

    The same function can be used to construct the :ref:`storage:async storage`
    variants, for example::

        from limits.storage import storage_from_string

        memory = storage_from_string("async+memory://")
        memcached = storage_from_string("async+memcached://localhost:11211")
        redis = storage_from_string("async+redis://localhost:6379")

    :param storage_string: a string of the form ``scheme://host:port``.
     More details about supported storage schemes can be found at
     :ref:`storage:storage scheme`
    :param options: all remaining keyword arguments are passed to the
     constructor matched by :paramref:`storage_string`.
    :raises ConfigurationError: when the :attr:`storage_string` cannot be
     mapped to a registered :class:`limits.storage.Storage`
     or :class:`limits.aio.storage.Storage` instance.


    zunknown storage scheme : )urllibparseurlparseschemer   r   r   r   )storage_stringoptionsr   s      J/var/www/html/venv/lib/python3.12/site-packages/limits/storage/__init__.pystorage_from_stringr      sV    D \\"">299FW #<^<L!MNNgfonHHII    )r   r   r   r   r	   r   r   r   r
   r   r   )r   strr   zfloat | str | boolreturnr   )!__doc__
__future__r   r   limitserrorsr   typingr   r   baser	   r
   r   	memcachedr   memoryr   mongodbr   r   redisr   redis_clusterr   redis_sentinelr   registryr   r   __annotations__r   __all__ r   r   <module>r1      si   
 #   ' $ K K ' ! 7  . 0 @i @'J'J$6'J'JTr   