Documentation ¶
Overview ¶
Package util contains various general utility functions used throughout the project.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcatStrings ¶
ConcatStrings efficiently concatenates strings with only one extra allocation
func HashBuffer ¶
HashBuffer computes a base64 MD5 hash from a buffer
Types ¶
type MessageBuffer ¶
type MessageBuffer struct {
// contains filtered or unexported fields
}
MessageBuffer provides bufferring and concatenation for post update messages
func (*MessageBuffer) Flush ¶
func (b *MessageBuffer) Flush() ([]byte, uint64)
Flush flushes b into into a []byte and returns it together with the flushed message count. If no messages are stored, the returned buffer is nil.
func (*MessageBuffer) Write ¶
func (b *MessageBuffer) Write(data []byte)
Write writes a message to b
type PausableTicker ¶
PausableTicker is a time.Ticker that can be paused
func (*PausableTicker) StartIfPaused ¶
func (p *PausableTicker) StartIfPaused()
StartIfPaused start p back up, if p is paused
Click to show internal directories.
Click to hide internal directories.