Documentation ¶
Index ¶
- func AddIfNotExists(vs []string, t string) []string
- func All(vs []string, f func(string) bool) bool
- func AllN(vs []int, f func(int) bool) bool
- func Any(vs []string, f func(string) bool) bool
- func AnyN(vs []int, f func(int) bool) bool
- func BitMaskInclude(src, flag int) bool
- func Concat(slices ...[]string) []string
- func ConcatN(slices ...[]int) []int
- func Distinct(vs []string) []string
- func DistinctN(vs []int) []int
- func Filter(vs []string, f func(string) bool) []string
- func FilterN(vs []int, f func(int) bool) []int
- func Include(vs []string, t string) bool
- func IncludeMask(vs []int, t int) bool
- func IncludeN(vs []int, t int) bool
- func Index(vs []string, t string) int
- func IndexN(vs []int, t int) int
- func Intersect(slices ...[]string) []string
- func IntersectN(slices ...[]int) []int
- func JoinN(slice []int, sep string) string
- func Map(vs []string, f func(string) string) []string
- func MapN(vs []int, f func(int) int) []int
- func Remove(vs []string, t string) []string
- type ConcurrentStringMap
- func (c *ConcurrentStringMap[T]) Delete(key string)
- func (c *ConcurrentStringMap[T]) DeleteAll()
- func (c *ConcurrentStringMap[T]) Get(key string) (T, bool)
- func (c *ConcurrentStringMap[T]) Keys() (result []string)
- func (c *ConcurrentStringMap[T]) KeysAndValues() (keys []string, values []T)
- func (c *ConcurrentStringMap[T]) Put(key string, val T)
- func (c *ConcurrentStringMap[T]) Values() (result []T)
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIfNotExists ¶
Add item to list only if it does not exist
func BitMaskInclude ¶
BitMaskInclude checks if the src bitmask including the flag
func Filter ¶
Filter returns a new slice containing all strings in the slice that satisfy the predicate `f`.
func FilterN ¶
FilterN returns a new slice containing all integers in the slice that satisfy the predicate `f`.
func IncludeMask ¶
func IntersectN ¶
Intersect returns only the values in all slices
func JoinN ¶
JoinN convert all integers in the slice to strings and joins them together as a single string with separator
func Map ¶
Map returns a new slice containing the results of applying the function `f` to each string in the original slice.
Types ¶
type ConcurrentStringMap ¶
ConcurrentStringMap enable safe shared map with Read/Write locks
func NewConcurrentStringMap ¶
func NewConcurrentStringMap[T any]() ConcurrentStringMap[T]
NewConcurrentStringMap factory method
func (*ConcurrentStringMap[T]) Delete ¶ added in v1.2.98
func (c *ConcurrentStringMap[T]) Delete(key string)
Delete remove item from map
func (*ConcurrentStringMap[T]) DeleteAll ¶ added in v1.2.98
func (c *ConcurrentStringMap[T]) DeleteAll()
DeleteAll remove all items from the map
func (*ConcurrentStringMap[T]) Get ¶
func (c *ConcurrentStringMap[T]) Get(key string) (T, bool)
Get retrieve item from map
func (*ConcurrentStringMap[T]) Keys ¶ added in v1.2.63
func (c *ConcurrentStringMap[T]) Keys() (result []string)
Keys returns all the keys in the map
func (*ConcurrentStringMap[T]) KeysAndValues ¶ added in v1.2.63
func (c *ConcurrentStringMap[T]) KeysAndValues() (keys []string, values []T)
KeysAndValues returns all the keys and the values in the map
func (*ConcurrentStringMap[T]) Put ¶
func (c *ConcurrentStringMap[T]) Put(key string, val T)
Put set item in the map
func (*ConcurrentStringMap[T]) Values ¶ added in v1.2.63
func (c *ConcurrentStringMap[T]) Values() (result []T)
Values returns all the values in the map
type Queue ¶
type Queue interface { // Push item into a queue Push(v any) // Pop last item Pop() (any, bool) // Length get length of the queue Length() int }
Queue functions for manager data items in a stack
type Stack ¶
type Stack interface { // push item into a stack Push(v any) // pop last item Pop() (any, bool) // pop many items PopMany(count int64) ([]any, bool) // pop all items PopAll() ([]any, bool) // peek last item Peek() (any, bool) // get length of stack Length() int64 // is empty stack IsEmpty() bool }
Stack functions for manager data items in a stack