checkpoint

package
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Initial = New(0, 0)

Initial is the initial value of the checkpoint.

Max is the max value of the checkpoint.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	ServerSeq uint64
	ClientSeq uint32
}

Checkpoint is used to determine the client received changes.

func New

func New(serverSeq uint64, clientSeq uint32) *Checkpoint

New creates a new instance of Checkpoint.

func (*Checkpoint) Equals

func (cp *Checkpoint) Equals(other *Checkpoint) bool

Equals returns whether the given checkpoint is equal to this checkpoint or not.

func (*Checkpoint) Forward

func (cp *Checkpoint) Forward(other *Checkpoint) *Checkpoint

Forward updates the given checkpoint with those values when it is greater than the values of internal properties.

func (*Checkpoint) IncreaseClientSeq

func (cp *Checkpoint) IncreaseClientSeq(inc uint32) *Checkpoint

IncreaseClientSeq creates a new instance with increased client sequence.

func (*Checkpoint) NextClientSeq

func (cp *Checkpoint) NextClientSeq() *Checkpoint

NextClientSeq creates a new instance with next client sequence.

func (*Checkpoint) NextServerSeq

func (cp *Checkpoint) NextServerSeq(serverSeq uint64) *Checkpoint

NextServerSeq creates a new instance with next server sequence.

func (*Checkpoint) String

func (cp *Checkpoint) String() string

String returns the string of information about this checkpoint.

func (*Checkpoint) SyncClientSeq

func (cp *Checkpoint) SyncClientSeq(clientSeq uint32) *Checkpoint

SyncClientSeq updates the given clientSeq if it is greater than the internal value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL