counters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package counters provide types supporting flexible counters within a map. Since counters are mergable, all types are designed not to be thread safe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByString

type ByString map[string]int

ByString is a map of counters with a string as the key.

func (*ByString) Add

func (bs *ByString) Add(key string, inc int) int

Add increases the value of a specific key and returns the updated value.

func (*ByString) MergeWith

func (bs *ByString) MergeWith(that ByString)

MergeWith adds values of another ByString counters into this one.

Jump to

Keyboard shortcuts

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