sync

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SvMap added in v1.4.3

type SvMap map[string][]spec_svs.SeqNoEntry

Map representation of the state vector.

func NewSvMap added in v1.4.3

func NewSvMap(size int) SvMap

Create a new state vector map.

func (SvMap) Encode added in v1.4.3

func (m SvMap) Encode() *spec_svs.StateVector

func (SvMap) Get added in v1.4.3

func (m SvMap) Get(hash string, btime uint64) spec_svs.SeqNoEntry

Get seq entry for a bootstrap time.

func (SvMap) IsNewerThan added in v1.4.3

func (m SvMap) IsNewerThan(other SvMap, existOnly bool) bool

Check if a svHashMap is newer than another. If existOnly is true, only check if the other has all entries.

func (SvMap) Set added in v1.4.3

func (m SvMap) Set(hash string, btime uint64, seq uint64)

Set seq entry for a bootstrap time.

type SvSync

type SvSync struct {
	// contains filtered or unexported fields
}

func NewSvSync

func NewSvSync(opts SvSyncOpts) *SvSync

NewSvSync creates a new SV Sync instance.

func (*SvSync) GetBootTime added in v1.4.3

func (s *SvSync) GetBootTime() uint64

func (*SvSync) IncrSeqNo

func (s *SvSync) IncrSeqNo(name enc.Name) uint64

IncrSeqNo increments the sequence number for a name. The instance must only increment sequence numbers for names it owns.

func (*SvSync) SetSeqNo

func (s *SvSync) SetSeqNo(name enc.Name, seqNo uint64) error

SetSeqNo sets the sequence number for a name. The instance must only set sequence numbers for names it owns. The sequence number must be greater than the previous value.

func (*SvSync) Start

func (s *SvSync) Start() (err error)

Start the SV Sync instance.

func (*SvSync) Stop

func (s *SvSync) Stop()

Stop the SV Sync instance.

func (*SvSync) String added in v1.4.3

func (s *SvSync) String() string

Instance log identifier

type SvSyncOpts added in v1.4.3

type SvSyncOpts struct {
	Client      ndn.Client
	GroupPrefix enc.Name
	OnUpdate    func(SvSyncUpdate)

	BootTime          uint64
	PeriodicTimeout   time.Duration
	SuppressionPeriod time.Duration
}

type SvSyncUpdate

type SvSyncUpdate struct {
	Name enc.Name
	Boot uint64
	High uint64
	Low  uint64
}

Jump to

Keyboard shortcuts

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