# Functions
NOTE: Assumes that s is ASCII as per IsASCIIText(), otherwise panics.
No description provided by the author
No description provided by the author
This uses the OS and the Seed(s).
CRandHex returns a hex encoded string that's floor(numDigits/2) * 2 long.
Returns a crand.Reader mixed with user-supplied entropy.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Fingerprint returns the first 6 bytes of a byte slice.
Returns true if s is a non-empty printable non-tab ascii character.
No description provided by the author
Kill the running process by sending itself SIGTERM.
No description provided by the author
-----------------------------------------------------------------------------.
No description provided by the author
No description provided by the author
No description provided by the author
Mix additional bytes of randomness, e.g.
NewBaseService creates a new BaseService.
NewBitArray returns a new bit array.
No description provided by the author
No description provided by the author
Construct a TickerMaker that always uses `source`.
NewRepeatTimer returns a RepeatTimer with a defaultTicker.
NewRepeatTimerWithTicker returns a RepeatTimer with the given ticker maker.
No description provided by the author
NewTWatch make the new watch.
No description provided by the author
Run tasks in parallel, with ability to abort early.
PrefixEndBytes returns the end byteslice for a noninclusive range that would include all byte slices for which the input is the prefix.
ProtocolAndAddress splits an address into the protocol and address components.
No description provided by the author
-----------------------------------------------------------------------------.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SimpleProofsFromByteSlices computes inclusion proof for given items.
SplitAndTrim slices s into all subslices separated by sep and returns a slice of the string s with all leading and trailing Unicode code points contained in cutset removed.
No description provided by the author
No description provided by the author
WriteFileAtomic creates a temporary file with data and provided perm and swaps it atomically with filename if successful.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
MaxLockTime used to judge the watch is locked.
MaxWatchInChan.
WatchFinishTime used to handle the end event in every watch.
# Structs
Classical-inheritance-style service declarations.
BitArray is a thread-safe implementation of a bit array.
CMap is a goroutine-safe map.
Example usage:
```
h := NewHeap()
h.Push("msg1", 1)
h.Push("msg3", 3)
h.Push("msg2", 2)
fmt.Println(h.Pop()) // msg1
fmt.Println(h.Pop()) // msg2
fmt.Println(h.Pop()) // msg3
```
*/.
RepeatTimer repeatedly sends a struct{}{} to `.Chan()` after each `dur`
period.
SimpleProof represents a simple Merkle proof.
SimpleProofNode is a helper structure to construct merkle proof.
No description provided by the author
No description provided by the author
ThrottleTimer fires an event at most "dur" after each .Set() call.
----------------------------------------------------------------------------- TWatch watch and output the cost time for exec.
No description provided by the author
# Interfaces
No description provided by the author
----------------------------------------------------------------------------- PeerInValidators judge the peer whether in validators set.
Service defines a service that can be started, stopped, and reset.
Ticker is a basic ticker interface.
# Type aliases
No description provided by the author
No description provided by the author
val: the value returned after task execution.
Used by RepeatTimer the first time, and every time it's Reset() after Stop().