Documentation ¶
Overview ¶
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
Index ¶
- Variables
- func Cast[T any](value any) (T, error)
- func Require[T any](value any) T
- func With[V any](variable *ConcurrentVariable[V], callback func(value V))
- func WithRef[V any](variable *ConcurrentVariable[V], callback func(value *V))
- func WithReturn[V any, R any](variable *ConcurrentVariable[V], callback func(value V) R) R
- type CommaValue
- type ConcurrentMap
- func (cmap *ConcurrentMap[K, V]) Clear()
- func (cmap *ConcurrentMap[K, V]) Delete(key K)
- func (cmap *ConcurrentMap[K, V]) Empty() bool
- func (cmap *ConcurrentMap[K, V]) Foreach(callback func(key K, value V) bool)
- func (cmap *ConcurrentMap[K, V]) Get(key K) (V, bool)
- func (cmap *ConcurrentMap[K, V]) Len() int
- func (cmap *ConcurrentMap[K, V]) Set(key K, value V)
- type ConcurrentVariable
- type LinkedList
- type Node
- type NodeIterator
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCast = errors.New("utilities: invalid cast")
)
Functions ¶
func With ¶
func With[V any](variable *ConcurrentVariable[V], callback func(value V))
func WithRef ¶
func WithRef[V any](variable *ConcurrentVariable[V], callback func(value *V))
func WithReturn ¶
func WithReturn[V any, R any](variable *ConcurrentVariable[V], callback func(value V) R) R
Types ¶
type CommaValue ¶
type CommaValue struct {
Value *[]string
}
A `flag.Value` compatible Value that accepts a comma seperated string and produces an array of strings
func (CommaValue) Set ¶
func (v CommaValue) Set(s string) error
func (CommaValue) String ¶
func (v CommaValue) String() string
type ConcurrentMap ¶
type ConcurrentMap[K comparable, V any] struct { sync.Mutex Map map[K]V }
func NewConcurrentMap ¶
func NewConcurrentMap[K comparable, V any]() *ConcurrentMap[K, V]
func (*ConcurrentMap[K, V]) Clear ¶
func (cmap *ConcurrentMap[K, V]) Clear()
func (*ConcurrentMap[K, V]) Delete ¶
func (cmap *ConcurrentMap[K, V]) Delete(key K)
func (*ConcurrentMap[K, V]) Empty ¶
func (cmap *ConcurrentMap[K, V]) Empty() bool
func (*ConcurrentMap[K, V]) Foreach ¶
func (cmap *ConcurrentMap[K, V]) Foreach(callback func(key K, value V) bool)
func (*ConcurrentMap[K, V]) Get ¶
func (cmap *ConcurrentMap[K, V]) Get(key K) (V, bool)
func (*ConcurrentMap[K, V]) Len ¶
func (cmap *ConcurrentMap[K, V]) Len() int
func (*ConcurrentMap[K, V]) Set ¶
func (cmap *ConcurrentMap[K, V]) Set(key K, value V)
type ConcurrentVariable ¶
func NewConcurrentVariable ¶
func NewConcurrentVariable[V any]() *ConcurrentVariable[V]
func NewConcurrentVariableD ¶
func NewConcurrentVariableD[V any](value V) *ConcurrentVariable[V]
func (*ConcurrentVariable[V]) Get ¶
func (cvar *ConcurrentVariable[V]) Get() V
func (*ConcurrentVariable[V]) Set ¶
func (cvar *ConcurrentVariable[V]) Set(value V)
type LinkedList ¶
type LinkedList[T any] struct { // contains filtered or unexported fields }
func NewLinkedList ¶
func NewLinkedList[T any]() *LinkedList[T]
func (*LinkedList[T]) Append ¶
func (list *LinkedList[T]) Append(data T) *Node[T]
func (*LinkedList[T]) AppendMany ¶
func (list *LinkedList[T]) AppendMany(data []T)
func (*LinkedList[T]) Iterator ¶
func (list *LinkedList[T]) Iterator() NodeIterator[T]
func (*LinkedList[T]) Remove ¶
func (list *LinkedList[T]) Remove(iterator NodeIterator[T]) NodeIterator[T]
func (*LinkedList[T]) RemoveNode ¶
func (list *LinkedList[T]) RemoveNode(current *Node[T]) *Node[T]
type NodeIterator ¶
type NodeIterator[T any] struct { // contains filtered or unexported fields }
func (*NodeIterator[T]) Next ¶
func (iterator *NodeIterator[T]) Next() bool
func (*NodeIterator[T]) Node ¶
func (iterator *NodeIterator[T]) Node() *Node[T]
func (*NodeIterator[T]) Value ¶
func (iterator *NodeIterator[T]) Value() *T
Click to show internal directories.
Click to hide internal directories.