counting

package
v1.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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 Counts

type Counts interface {
	GetTotal() int64
	String() string
	IsInterfaceNil() bool
}

Counts is an interface to interact with counts

type CountsWithSize added in v1.0.133

type CountsWithSize interface {
	Counts
	GetTotalSize() int64
}

CountsWithSize is an interface to interact with counts

type NullCounts

type NullCounts struct {
}

NullCounts implements null object pattern for counts

func (*NullCounts) GetTotal

func (counts *NullCounts) GetTotal() int64

GetTotal returns -1

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

func (*NullCounts) String

func (counts *NullCounts) String() string

String returns a placeholder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL