You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import"github.com/Ishan27gOrg/vClock"// VectorClock : provides interface to implement vector clocktypeVectorClockinterface {
// SendEvent returns the current vector clock after first updating self clock and then// updating the individual clocks for corresponding addressesSendEvent(idstring, addresses []string) vClock.EventClock// Get returns the current vector clockGet(idstring) vClock.EventClock// ReceiveEvent updates the current vector clock using element wise maximum with the passed vector clockReceiveEvent(idstring, v vClock.EventClock)
Clear(idstring)
print()
}
// Events : provides interface to merge and order events based on vector clockstypeEventsinterface {
// MergeEvents merges the current event clocks with received event clocks, new events are added to current listMergeEvents(es...vClock.Event)
// MergeEvent takes an eventId & clock and merges with existing clock, new events are added to current listMergeEvent(e vClock.Event)
// GetCurrentEvents returns the events currently saved. Not in orderGetCurrentEvents() []vClock.Event// GetEventsOrder returns the eventIds ordered according to vector clock for the eventsGetEventsOrder() (ids []string)
}