Skip to content

KeyValue API

unreg edited this page Oct 29, 2016 · 9 revisions

KeyValue API

SetValue

from actorbot.api import keyvalue
from actorbot.bots import Conversation

class ExampleConversation(Conversation):
    def sample(self):
        out_msg = keyvalue.SetValue(self._get_id(),
                                    keyspace='test', key='counter', value='42')
        self.send(out_msg)

GetValue

from actorbot.api import keyvalue
from actorbot.bots import Conversation

class ExampleConversation(Conversation):
    def sample(self):
        out_msg = keyvalue.GetValue(self._get_id(),
                                    keyspace='test', key='counter')
        self.send(out_msg)

GetKeys

from actorbot.api import keyvalue
from actorbot.bots import Conversation

class ExampleConversation(Conversation):
    def sample(self):
        out_msg = keyvalue.GetKeys(self._get_id(), keyspace='test')
        self.send(out_msg)

DeleteValue

from actorbot.api import keyvalue
from actorbot.bots import Conversation

class ExampleConversation(Conversation):
    def sample(self):
        out_msg = keyvalue.DeleteValue(self._get_id(),
                                       keyspace='test', key='counter')
        self.send(out_msg)

Clone this wiki locally