Documentation ¶
Index ¶
- type ConcurrentShardedCounts
- type ConcurrentShardedCountsWithSize
- func (counts *ConcurrentShardedCountsWithSize) GetTotal() int64
- func (counts *ConcurrentShardedCountsWithSize) GetTotalSize() int64
- func (counts *ConcurrentShardedCountsWithSize) IsInterfaceNil() bool
- func (counts *ConcurrentShardedCountsWithSize) PutCounts(shardName string, counter int64, sizeInBytes int64)
- func (counts *ConcurrentShardedCountsWithSize) String() string
- type Counts
- type CountsWithSize
- type NullCounts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentShardedCounts ¶
type ConcurrentShardedCounts struct {
// contains filtered or unexported fields
}
ConcurrentShardedCounts keeps counts for a sharded data structure This implementation is concurrently safe
func NewConcurrentShardedCounts ¶
func NewConcurrentShardedCounts() *ConcurrentShardedCounts
NewConcurrentShardedCounts creates a new ConcurrentShardedCounts
func (*ConcurrentShardedCounts) GetTotal ¶
func (counts *ConcurrentShardedCounts) GetTotal() int64
GetTotal gets total count
func (*ConcurrentShardedCounts) IsInterfaceNil ¶
func (counts *ConcurrentShardedCounts) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ConcurrentShardedCounts) PutCounts ¶
func (counts *ConcurrentShardedCounts) PutCounts(shardName string, value int64)
PutCounts registers counts for a shard
func (*ConcurrentShardedCounts) String ¶
func (counts *ConcurrentShardedCounts) String() string
type ConcurrentShardedCountsWithSize ¶
type ConcurrentShardedCountsWithSize struct {
// contains filtered or unexported fields
}
ConcurrentShardedCountsWithSize keeps counts (with sizes) for a sharded data structure
func NewConcurrentShardedCountsWithSize ¶
func NewConcurrentShardedCountsWithSize() *ConcurrentShardedCountsWithSize
NewConcurrentShardedCountsWithSize creates a new ShardedCountsWithSize
func (*ConcurrentShardedCountsWithSize) GetTotal ¶
func (counts *ConcurrentShardedCountsWithSize) GetTotal() int64
GetTotal gets total count
func (*ConcurrentShardedCountsWithSize) GetTotalSize ¶
func (counts *ConcurrentShardedCountsWithSize) GetTotalSize() int64
GetTotalSize gets total size
func (*ConcurrentShardedCountsWithSize) IsInterfaceNil ¶
func (counts *ConcurrentShardedCountsWithSize) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ConcurrentShardedCountsWithSize) PutCounts ¶
func (counts *ConcurrentShardedCountsWithSize) PutCounts(shardName string, counter int64, sizeInBytes int64)
PutCounts registers counts for a shard
func (*ConcurrentShardedCountsWithSize) String ¶
func (counts *ConcurrentShardedCountsWithSize) String() string
type CountsWithSize ¶
CountsWithSize is an interface to interact with counts
type NullCounts ¶
type NullCounts struct { }
NullCounts implements null object pattern for counts
func (*NullCounts) GetTotalSize ¶
func (counts *NullCounts) GetTotalSize() int64
GetTotalSize returns -1
func (*NullCounts) IsInterfaceNil ¶
func (counts *NullCounts) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface