#!/usr/bin/env python3
#
# dht.py: Distributed Hashtable abstraction layer
#
# (Similar motivation to the one in crypto.py, though there
#  are actually some decent DHT implementation, I just still
#  need to decide on one :)). Consideration: might as well use
# Python's dictionary interface for this.
#
# Copyright (C) 2015 Almer S. Tigelaar <almer@gnome.org>
#

# Interface
# =========

class DistributedHashTable:

    def __init__(self):
        pass
    
    def set(self, key, value):
        pass

    def get(self, key):
        pass

    def delete(self, key):
        pass

# Non-distributed implementation
# ==============================

class NonDistributedHashTable:

    def __init__(self):
        self.d = {}

    def set(self, key, value):
        self.d[key] = value

    def get(self, key):
        return self.d.get(key, None)

    def delete(self, key):
        del self.d[key]

