ConfigurationInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Snowflake;
  12. interface ConfigurationInterface
  13. {
  14. /**
  15. * Get the maximum worker id bits.
  16. */
  17. public function maxWorkerId(): int;
  18. /**
  19. * Get the maximum data center id bits.
  20. */
  21. public function maxDataCenterId(): int;
  22. /**
  23. * Get the maximum sequence bits.
  24. */
  25. public function maxSequence(): int;
  26. /**
  27. * Get the timestamp left shift.
  28. */
  29. public function getTimestampLeftShift(): int;
  30. /**
  31. * Get the data center id shift.
  32. */
  33. public function getDataCenterIdShift(): int;
  34. /**
  35. * Get the worker id shift.
  36. */
  37. public function getWorkerIdShift(): int;
  38. /**
  39. * Get the timestamp bits.
  40. */
  41. public function getTimestampBits(): int;
  42. /**
  43. * Get the data center id bits.
  44. */
  45. public function getDataCenterIdBits(): int;
  46. /**
  47. * Get the worker id bits.
  48. */
  49. public function getWorkerIdBits(): int;
  50. /**
  51. * Get the sequence bits.
  52. */
  53. public function getSequenceBits(): int;
  54. }