Documentation ¶
Index ¶
- Constants
- type CurrentView
- type OldViewError
- type Process
- type Update
- type View
- func (v *View) Equal(v2 *View) bool
- func (v *View) GetMembers() []Process
- func (v *View) GetMembersNotIn(v2 *View) []Process
- func (v *View) GetProcessPosition(process Process) int
- func (v *View) GetUpdates() []Update
- func (v *View) HasMember(p Process) bool
- func (v *View) HasUpdate(u Update) bool
- func (v *View) LessUpdatedThan(v2 *View) bool
- func (v *View) NewCopyWithUpdates(updates ...Update) *View
- func (v *View) NumberOfMembers() int
- func (v *View) NumberOfToleratedFaults() int
- func (v *View) NumberOfUpdates() int
- func (v *View) QuorumSize() int
- func (v *View) String() string
- type ViewRef
Constants ¶
View Source
const ( Join updateType = "+" Leave updateType = "-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentView ¶
type CurrentView struct {
// contains filtered or unexported fields
}
func NewCurrentView ¶
func NewCurrentView() CurrentView
func (CurrentView) String ¶
func (currentView CurrentView) String() string
func (*CurrentView) Update ¶
func (currentView *CurrentView) Update(newView *View)
func (*CurrentView) View ¶
func (currentView *CurrentView) View() *View
func (*CurrentView) ViewAndViewRef ¶
func (currentView *CurrentView) ViewAndViewRef() (*View, ViewRef)
func (*CurrentView) ViewRef ¶
func (currentView *CurrentView) ViewRef() ViewRef
type OldViewError ¶
type OldViewError struct {
NewView *View
}
func (OldViewError) Error ¶
func (e OldViewError) Error() string
type View ¶
type View struct { Entries map[Update]bool Members map[Process]bool // Cache, can be rebuilt from Entries }
View represents a server's view of the members of the distributed system. A View once created is immutable, for a mutable View, see CurrentView type.
func NewWithProcesses ¶
func NewWithUpdates ¶
func (*View) GetMembers ¶
func (*View) GetMembersNotIn ¶
func (*View) GetProcessPosition ¶
GetProcessPosition returns an unique number for the process in the view. Returns -1 if process is not a member of the view.
func (*View) GetUpdates ¶
func (*View) LessUpdatedThan ¶
func (*View) NewCopyWithUpdates ¶
func (*View) NumberOfMembers ¶
func (*View) NumberOfToleratedFaults ¶
func (*View) NumberOfUpdates ¶
func (*View) QuorumSize ¶
Click to show internal directories.
Click to hide internal directories.