Skip to content

Instantly share code, notes, and snippets.

@josephglanville
Created February 1, 2016 00:58
Show Gist options
  • Save josephglanville/9fab9a7b44cf0e6d286e to your computer and use it in GitHub Desktop.
Save josephglanville/9fab9a7b44cf0e6d286e to your computer and use it in GitHub Desktop.
package xlog
type Position string
type XLog interface {
// Returns the zero position for this xlog
Zero() Position
// Increment increments an xlog position by the given number.
// Returns the new position of the xlog.
Increment(Position, int) (Position, error)
// Compare compares two xlog positions returning -1 if xlog1 < xlog2, 0 if xlog1
// == xlog2, and 1 if xlog1 > xlog2.
Compare(Position, Position) (int, error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment