types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const MaxCategory = Category(1000000000)
View Source
const MaxIntSliceCapacity = 20
View Source
const MinCategory = Category(0)

Variables

View Source
var EmptyAndOrSet = AndOrSet(*immutable.Of[immutable.Set[Category]]())

Functions

func FilterSlice

func FilterSlice[T any](a []T, f func(T) bool) []T

func FindFirstInSlice

func FindFirstInSlice[T any](a []T, f func(T) bool) *T

func GetIntSlice

func GetIntSlice() []int

func MapSlice

func MapSlice[T any, M any](a []T, f func(T) M) []M

func NewHashMap

func NewHashMap[K immutable.SetElement, T any]() *hashmap.Map[K, T]

func NewHashSet

func NewHashSet[K immutable.SetElement]() *hashset.Set[K]

func PutIntSlice

func PutIntSlice(v []int)

func Reduce

func Reduce[T, M any](s []T, f func(M, T) M, initValue M) M

func SliceToBoolMap

func SliceToBoolMap[T comparable](s []T) map[T]bool

func SliceToSet

func SliceToSet[K immutable.SetElement](s []K) immutable.Set[K]

func SliceToSetOfSets

func SliceToSetOfSets[K immutable.SetElement](s []K) immutable.Set[immutable.Set[K]]

Types

type AndOrSet

type AndOrSet immutable.Set[immutable.Set[Category]]

func AndOrSetFromSlices

func AndOrSetFromSlices(slices [][]Category) AndOrSet

func SliceToAndOrSet

func SliceToAndOrSet(s []Category) AndOrSet

func (AndOrSet) Difference

func (set AndOrSet) Difference(a AndOrSet) AndOrSet

func (AndOrSet) Each

func (set AndOrSet) Each(fn func(key immutable.Set[Category]))

func (AndOrSet) Equals

func (set AndOrSet) Equals(element immutable.SetElement) bool

func (AndOrSet) GetHash

func (set AndOrSet) GetHash() uint64

func (AndOrSet) Size

func (set AndOrSet) Size() int

func (AndOrSet) ToHashSet

func (set AndOrSet) ToHashSet() hashset.Set[immutable.Set[Category]]

func (AndOrSet) ToSlice

func (set AndOrSet) ToSlice() []immutable.Set[Category]

func (AndOrSet) ToSlices

func (set AndOrSet) ToSlices() [][]Category

func (AndOrSet) Union

func (set AndOrSet) Union(a AndOrSet) AndOrSet

type AppContext

type AppContext struct {
	// contains filtered or unexported fields
}

func NewAppContext

func NewAppContext() *AppContext

func (*AppContext) Errorf

func (ctx *AppContext) Errorf(format string, a ...any) error

func (*AppContext) GetError

func (ctx *AppContext) GetError(index int) error

func (*AppContext) LogError

func (ctx *AppContext) LogError(err error) error

func (*AppContext) NewError

func (ctx *AppContext) NewError(err string) error

func (*AppContext) NumErrors

func (ctx *AppContext) NumErrors() int

func (*AppContext) PrintErrors

func (ctx *AppContext) PrintErrors()

type Category

type Category int32

func (Category) Equals

func (v Category) Equals(element immutable.SetElement) bool

func (Category) GetHash

func (v Category) GetHash() uint64

type ErrorLog

type ErrorLog struct {
	// contains filtered or unexported fields
}

func (*ErrorLog) LogError

func (errLog *ErrorLog) LogError(err error)

func (*ErrorLog) PrintErrors

func (errLog *ErrorLog) PrintErrors()

type Mask

type Mask int64

Jump to

Keyboard shortcuts

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