aboutsummaryrefslogtreecommitdiff
path: root/go/sequence/memory_sequencer.go
blob: d72952ff46287032d1d16b49a0c367aed147dc44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package sequence

import ()

// just for testing
type MemorySequencer struct {
	counter uint64
}

func NewMemorySequencer() (m *MemorySequencer) {
	m = &MemorySequencer{counter: 1}
	return
}

func (m *MemorySequencer) NextFileId(count int) (uint64, int) {
	ret := m.counter
	m.counter += uint64(count)
	return ret, count
}