Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / libmemcached / memcached_touch.rst
1 Update expiration on a key
2 ==========================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. function:: memcached_return_t memcached_touch (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
11
12 :param ptr: pointer to initialized `memcached_st` struct
13 :param key: the key to touch
14 :param key_length: the length of `key` without any terminating zero
15 :param expiration: new expiration as a unix timestamp or as relative expiration time in seconds
16 :returns: `memcached_return_t` indicating success
17
18 .. function:: memcached_return_t memcached_touch_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
19
20 :param ptr: pointer to initialized `memcached_st` struct
21 :param group_key: the `key` namespace
22 :param group_key_length: the length of `group_key` without any terminating zero
23 :param key: the key to touch
24 :param key_length: the length of `key` without any terminating zero
25 :param expiration: new expiration as a unix timestamp or as relative expiration time in seconds
26 :returns: `memcached_return_t` indicating success
27
28 DESCRIPTION
29 -----------
30
31 :func:`memcached_touch` is used to update the expiration time on an existing key.
32 :func:`memcached_touch_by_key` works the same, but it takes a master key
33 to find the given value.
34
35 RETURN VALUE
36 ------------
37
38 A value of type :type:`memcached_return_t` is returned.
39 On success that value will be `MEMCACHED_SUCCESS`.
40 Use :func:`memcached_strerror` to translate this value to a printable
41 string.
42
43 SEE ALSO
44 --------
45
46 .. only:: man
47
48 :manpage:`memcached(1)`
49 :manpage:`libmemcached(3)`
50 :manpage:`memcached_strerror(3)`
51
52 .. only:: html
53
54 * :manpage:`memcached(1)`
55 * :doc:`../libmemcached`
56 * :doc:`memcached_strerror`