utils

package
v0.0.0-...-40caaf7 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Map[K, V]) Delete

func (m *Map[K, V]) Delete(key K)

func (*Map[K, V]) Load

func (m *Map[K, V]) Load(key K) (value V, ok bool)

func (*Map[K, V]) LoadAndDelete

func (m *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)

func (*Map[K, V]) LoadOrStore

func (m *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)

func (*Map[K, V]) Range

func (m *Map[K, V]) Range(f func(key K, value V) bool)

func (*Map[K, V]) Store

func (m *Map[K, V]) Store(key K, value V)

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[T any]() *Stack[T]

func (*Stack[T]) CanPopUp

func (s *Stack[T]) CanPopUp() bool

func (*Stack[T]) Clone

func (s *Stack[T]) Clone() []*StackItem[T]

func (*Stack[T]) CurrentItem

func (s *Stack[T]) CurrentItem() *StackItem[T]

func (*Stack[T]) PopUp

func (s *Stack[T]) PopUp(force bool)

func (*Stack[T]) Push

func (s *Stack[T]) Push(t *StackItem[T])

func (*Stack[T]) Size

func (s *Stack[T]) Size() int

type StackItem

type StackItem[T any] struct {
	// contains filtered or unexported fields
}

StackItem is intended for switching behavior, unlike push and pop up where stack size changes. children field is read only for this very same reason.

func NewStackItem

func NewStackItem[T any](activeIndex int, children []T, indexChangeListener func()) *StackItem[T]

func (*StackItem[T]) GetActiveIndex

func (s *StackItem[T]) GetActiveIndex() int

func (*StackItem[T]) GetActiveItem

func (s *StackItem[T]) GetActiveItem() T

func (*StackItem[T]) GetChildren

func (s *StackItem[T]) GetChildren() []T

func (*StackItem[T]) SetActiveIndex

func (s *StackItem[T]) SetActiveIndex(newIndex int)

Jump to

Keyboard shortcuts

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