Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NullCounts ¶
type NullCounts struct { }
NullCounts implements null object pattern for counts
func (*NullCounts) IsInterfaceNil ¶
func (counts *NullCounts) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*NullCounts) String ¶
func (counts *NullCounts) String() string
String returns a string representation of the counts
type ShardedCounts ¶
type ShardedCounts struct {
// contains filtered or unexported fields
}
ShardedCounts keeps counts for a sharded data structure This implementation is concurrently safe
func NewShardedCounts ¶
func NewShardedCounts() *ShardedCounts
NewShardedCounts creates a new ShardedCounts
func (*ShardedCounts) GetTotal ¶
func (counts *ShardedCounts) GetTotal() int64
GetTotal gets total count
func (*ShardedCounts) IsInterfaceNil ¶
func (counts *ShardedCounts) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardedCounts) PutCounts ¶
func (counts *ShardedCounts) PutCounts(shardName string, value int64)
PutCounts registers counts for a shard
func (*ShardedCounts) String ¶
func (counts *ShardedCounts) String() string
String returns a string representation of the counts
Click to show internal directories.
Click to hide internal directories.