Documentation
¶
Index ¶
Constants ¶
View Source
const CNTLENGTH = 500
CNTLENGTH is the standard container capacity
Variables ¶
View Source
var ( ErrParent = errors.New("parent is nil, child is closed") ErrContainer = errors.New("couldn't delete counter_child in container") )
Functions ¶
This section is empty.
Types ¶
type ConnCounter ¶
type ConnCounter struct {
// contains filtered or unexported fields
}
ConnCounter is a linked counter for a connection
func NewConnCounter ¶
func NewConnCounter(parent *ContractCounter) *ConnCounter
NewConnCounter returns a new counter for a connection
func (*ConnCounter) Close ¶
func (cc *ConnCounter) Close() (err error)
Close counter, sum inner value to parent and self-destruct
type ContractCounter ¶
type ContractCounter struct {
// contains filtered or unexported fields
}
ContractCounter contains the accumulated for an entire contract
func NewContractCounter ¶
func NewContractCounter() *ContractCounter
NewContractCounter returns new traffic counter per contract
func (*ContractCounter) NewChild ¶
func (ctc *ContractCounter) NewChild() *ConnCounter
NewChild linked to the ContractCounter
func (*ContractCounter) Reset ¶
func (ctc *ContractCounter) Reset() uint64
Reset inner and child values
func (*ContractCounter) Sum ¶
func (ctc *ContractCounter) Sum() uint64
Sum to inner value and child values
Click to show internal directories.
Click to hide internal directories.