shared

package
v0.0.0-...-b41bcdd Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = goenvtostruct.GetConfigFromEnv[config]()

Functions

func FailOnError

func FailOnError(err error, message string, args ...interface{})

func Min

func Min[T constraints.Ordered](a T, b T) T

Types

type FreqMap

type FreqMap[K comparable, V constraints.Integer] map[K]V

func NewFreqMap

func NewFreqMap[K comparable, V constraints.Integer]() FreqMap[K, V]

func (FreqMap[K, V]) Add

func (r FreqMap[K, V]) Add(key K)

func (FreqMap[K, V]) AscSorted

func (r FreqMap[K, V]) AscSorted() PairList[K, V]

func (FreqMap[K, V]) Count

func (r FreqMap[K, V]) Count(key K) (V, bool)

func (FreqMap[K, V]) DecSorted

func (r FreqMap[K, V]) DecSorted() PairList[K, V]

func (FreqMap[K, V]) Len

func (r FreqMap[K, V]) Len() int

func (FreqMap[K, V]) Pairs

func (r FreqMap[K, V]) Pairs() PairList[K, V]

func (FreqMap[K, V]) Top

func (r FreqMap[K, V]) Top(count int) PairList[K, V]

type Pair

type Pair[K comparable, V constraints.Integer] struct {
	Key   K
	Value V
}

type PairList

type PairList[K comparable, V constraints.Integer] []Pair[K, V]

func (PairList[K, V]) Len

func (p PairList[K, V]) Len() int

func (PairList[K, V]) Less

func (p PairList[K, V]) Less(i, j int) bool

func (PairList[K, V]) Swap

func (p PairList[K, V]) Swap(i, j int)

Jump to

Keyboard shortcuts

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