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.

19 lines
323 B

  1. package sequence
  2. import ()
  3. // just for testing
  4. type MemorySequencer struct {
  5. counter uint64
  6. }
  7. func NewMemorySequencer() (m *MemorySequencer) {
  8. m = &MemorySequencer{counter: 1}
  9. return
  10. }
  11. func (m *MemorySequencer) NextFileId(count int) (uint64, int) {
  12. ret := m.counter
  13. m.counter += uint64(count)
  14. return ret, count
  15. }