Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶ added in v0.4.0
ContainsString tells whether a contains x.
func MissingStrings ¶ added in v0.4.0
MissingStrings returns the disjunction between given slices: a - b.
Types ¶
type Buffer ¶ added in v0.4.0
type Buffer struct { Elements []Element `json:"elements"` Len int `json:"len"` // Length of the Buffer. When the buffer is full, oldest element will be removed. Mux *sync.RWMutex `json:"mux"` }
Buffer is the buffer with messages.
func (*Buffer) Add ¶ added in v0.4.0
Add adds the given element in buffer. When the buffer is full, oldest element will be removed.
func (*Buffer) ElementsFromIDs ¶ added in v0.4.0
ElementsFromIDs returns a slice with elements from given IDs list.
func (*Buffer) IncrementGossipCount ¶ added in v0.4.0
func (buf *Buffer) IncrementGossipCount()
IncrementGossipCount increments gossip count for each elements from buffer.
type Element ¶ added in v0.4.0
type Element struct { ID string `json:"id"` Timestamp time.Time `json:"timestamp"` Msg any `json:"msg"` CallbackType string `json:"callbackType"` GossipCount int64 `json:"gossipCount"` // number of rounds since the element is in buffer Internal bool `json:"internal"` // true if the element is an internal element, not a user element }
Element is an element from messages buffer.
Click to show internal directories.
Click to hide internal directories.