m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
486 B

7 months ago
  1. from __future__ import absolute_import
  2. import abc
  3. class Serializer(object):
  4. __meta__ = abc.ABCMeta
  5. def __init__(self, **config):
  6. pass
  7. @abc.abstractmethod
  8. def serialize(self, topic, value):
  9. pass
  10. def close(self):
  11. pass
  12. class Deserializer(object):
  13. __meta__ = abc.ABCMeta
  14. def __init__(self, **config):
  15. pass
  16. @abc.abstractmethod
  17. def deserialize(self, topic, bytes_):
  18. pass
  19. def close(self):
  20. pass