collection

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericMap

type GenericMap[K MapKey, V any] map[K]V

func (*GenericMap[K, V]) ContainsKey added in v1.1.4

func (m *GenericMap[K, V]) ContainsKey(k K) bool

func (*GenericMap[K, V]) DelKey added in v1.1.4

func (m *GenericMap[K, V]) DelKey(k K)

func (GenericMap[K, V]) Keys added in v1.1.4

func (m GenericMap[K, V]) Keys() Slice[K]

func (*GenericMap[K, V]) Put added in v1.1.4

func (m *GenericMap[K, V]) Put(k K, v V)

func (GenericMap[K, V]) Values added in v1.1.4

func (m GenericMap[K, V]) Values() Slice[V]

type MapKey added in v1.1.4

type MapKey interface {
	comparable
}

type Slice

type Slice[T any] []T

func Map

func Map[E, V any](s Slice[E], f func(e E) V) Slice[V]

func New added in v1.1.0

func New[T any](a []T) *Slice[T]

func (*Slice[T]) Append added in v1.1.4

func (s *Slice[T]) Append(t ...T)

func (Slice[T]) Contains

func (s Slice[T]) Contains(f func(t T) bool) bool

func (Slice[T]) Find

func (s Slice[T]) Find(f func(t T) bool) Slice[T]

func (Slice[T]) FindOne

func (s Slice[T]) FindOne(f func(t T) bool) T

func (Slice[T]) Foreach

func (s Slice[T]) Foreach(f func(t T))

func (Slice[T]) Len added in v1.0.5

func (s Slice[T]) Len() int

func (Slice[T]) MapToStrList

func (s Slice[T]) MapToStrList(f func(t T) string) []string

func (*Slice[T]) Push

func (s *Slice[T]) Push(t T)

Jump to

Keyboard shortcuts

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