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 ¶ added in v1.0.133
type ConcurrentShardedCounts struct {
// contains filtered or unexported fields
}
ShardedCounts keeps counts for a sharded data structure This implementation is concurrently safe
func NewConcurrentShardedCounts ¶ added in v1.0.133
func NewConcurrentShardedCounts() *ConcurrentShardedCounts
NewShardedCounts creates a new ShardedCounts
func (*ConcurrentShardedCounts) GetTotal ¶ added in v1.0.133
func (counts *ConcurrentShardedCounts) GetTotal() int64
GetTotal gets total count
func (*ConcurrentShardedCounts) IsInterfaceNil ¶ added in v1.0.133
func (counts *ConcurrentShardedCounts) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ConcurrentShardedCounts) PutCounts ¶ added in v1.0.133
func (counts *ConcurrentShardedCounts) PutCounts(shardName string, value int64)
PutCounts registers counts for a shard
func (*ConcurrentShardedCounts) String ¶ added in v1.0.133
func (counts *ConcurrentShardedCounts) String() string
type ConcurrentShardedCountsWithSize ¶ added in v1.0.133
type ConcurrentShardedCountsWithSize struct {
// contains filtered or unexported fields
}
ConcurrentShardedCountsWithSize keeps counts (with sizes) for a sharded data structure
func NewConcurrentShardedCountsWithSize ¶ added in v1.0.133
func NewConcurrentShardedCountsWithSize() *ConcurrentShardedCountsWithSize
NewConcurrentShardedCountsWithSize creates a new ShardedCountsWithSize
func (*ConcurrentShardedCountsWithSize) GetTotal ¶ added in v1.0.133
func (counts *ConcurrentShardedCountsWithSize) GetTotal() int64
GetTotal gets total count
func (*ConcurrentShardedCountsWithSize) GetTotalSize ¶ added in v1.0.133
func (counts *ConcurrentShardedCountsWithSize) GetTotalSize() int64
GetTotalSize gets total size
func (*ConcurrentShardedCountsWithSize) IsInterfaceNil ¶ added in v1.0.133
func (counts *ConcurrentShardedCountsWithSize) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ConcurrentShardedCountsWithSize) PutCounts ¶ added in v1.0.133
func (counts *ConcurrentShardedCountsWithSize) PutCounts(shardName string, counter int64, sizeInBytes int64)
PutCounts registers counts for a shard
func (*ConcurrentShardedCountsWithSize) String ¶ added in v1.0.133
func (counts *ConcurrentShardedCountsWithSize) String() string
type CountsWithSize ¶ added in v1.0.133
CountsWithSize is an interface to interact with counts
type NullCounts ¶
type NullCounts struct { }
NullCounts implements null object pattern for counts
func (*NullCounts) GetTotalSize ¶ added in v1.0.133
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