HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/__pycache__/memcached.cpython-310.pyc
o

�N�gt�@sRdZddlZddlZdZdZdZe�e�Z	ddiZ
dd�Zdd	d�Zdd
d�Z
dS)
a]
Memcached sdb Module

:maintainer:    SaltStack
:maturity:      New
:depends:       python-memcached
:platform:      all

This module allows access to memcached using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-memcached``.

Like all sdb modules, the memcached module requires a configuration profile to
be configured in either the minion or master configuration file. This profile
requires very little. In the example:

.. code-block:: yaml

    mymemcache:
      driver: memcached
      memcached.host: localhost
      memcached.port: 11211

The ``driver`` refers to the memcached module, ``host`` and ``port`` the
memcached server to connect to (defaults to ``localhost`` and ``11211``,
and ``mymemcached`` refers to the name that will appear in the URI:

.. code-block:: yaml

    password: sdb://mymemcached/mykey

�Nz	127.0.0.1i�+�set_�setcCstjjjrdSdS)z8
    Only load the module if memcached is installed
    TF)�salt�utils�	memcachedZHAS_LIBS�rr�F/opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/memcached.py�__virtual__.s
r	cCs0tjj�|�}|�dt�}tjjj||||d�S)z+
    Set a key/value pair in memcached
    Zexpire)�time)rrr�get_conn�get�DEFAULT_EXPIRATIONr)�key�value�profile�connr
rrrr7scCstjj�|�}tjj�||�S)z$
    Get a value from memcached
    )rrrrr)rrrrrrr@sr)N)�__doc__�loggingZsalt.utils.memcachedrZDEFAULT_HOSTZDEFAULT_PORTr
�	getLogger�__name__�logZ__func_alias__r	rrrrrr�<module>s