1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/godbus/dbus/v5/sequence.go
Sebastiaan van Stijn 3987dc264b
vendor: github.com/godbus/dbus/v5 v5.0.4
full diff: https://github.com/godbus/dbus/compare/v5.0.3...v5.0.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-05-06 16:16:50 +02:00

24 lines
555 B
Go

package dbus
// Sequence represents the value of a monotonically increasing counter.
type Sequence uint64
const (
// NoSequence indicates the absence of a sequence value.
NoSequence Sequence = 0
)
// sequenceGenerator represents a monotonically increasing counter.
type sequenceGenerator struct {
nextSequence Sequence
}
func (generator *sequenceGenerator) next() Sequence {
result := generator.nextSequence
generator.nextSequence++
return result
}
func newSequenceGenerator() *sequenceGenerator {
return &sequenceGenerator{nextSequence: 1}
}