diff --git a/event_delegate.go b/event_delegate.go index 20dd8a399..f0ed3fec2 100644 --- a/event_delegate.go +++ b/event_delegate.go @@ -42,6 +42,10 @@ const ( NodeUpdate ) +func (net NodeEventType) String() string { + return []string{"NodeJoin", "NodeLeave", "NodeUpdate"}[net] +} + // NodeEvent is a single event related to node activity in the memberlist. // The Node member of this struct must not be directly modified. It is passed // as a pointer to avoid unnecessary copies. If you wish to modify the node, diff --git a/state.go b/state.go index 2800e6e5c..fcc163889 100644 --- a/state.go +++ b/state.go @@ -40,6 +40,10 @@ const ( StateLeft ) +func (nst NodeStateType) String() string { + return []string{"StateAlive", "StateSuspect", "StateDead", "StateLeft"}[nst] +} + // Node represents a node in the cluster. type Node struct { Name string