sliceof

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any []any

func NewAny added in v0.11.0

func NewAny() Any

func (*Any) Append added in v0.12.0

func (x *Any) Append(values ...any)

Append adds one or more elements to the end of the slice

func (Any) At added in v0.21.5

func (x Any) At(index int) any

At returns a bound-safe element from the slice. If the index is out of bounds, then `At` returns the zero value for the slice type

func (Any) Contains added in v0.21.4

func (x Any) Contains(value any) bool

Contains returns TRUE if the slice contains the specified value

func (Any) ContainsAll added in v0.21.4

func (x Any) ContainsAll(values ...any) bool

ContainsAll returns TRUE if the slice contains all of the specified values

func (Any) ContainsAny added in v0.21.4

func (x Any) ContainsAny(values ...any) bool

ContainsAny returns TRUE if the slice contains any of the specified values

func (Any) Equal added in v0.21.4

func (x Any) Equal(value []any) bool

Equal returns TRUE if the slice contains exactly the same elements as the specified value

func (Any) Find added in v0.23.0

func (x Any) Find(fn func(any) bool) (any, bool)

Find returns the first element in the slice that satisfies the provided function.

func (Any) First added in v0.10.0

func (x Any) First() any

First returns the first element in the slice, or nil if the slice is empty

func (Any) FirstN added in v0.21.4

func (x Any) FirstN(n int) Any

FirstN returns the first "n" elements in the slice, or all elements if "n" is greater than the length of the slice

func (Any) GetAny

func (x Any) GetAny(key string) any

func (Any) GetAnyOK added in v0.10.0

func (x Any) GetAnyOK(key string) (any, bool)

func (Any) GetBool

func (x Any) GetBool(key string) bool

func (Any) GetBoolOK added in v0.11.0

func (x Any) GetBoolOK(key string) (bool, bool)

func (Any) GetFloat

func (x Any) GetFloat(key string) float64

func (Any) GetFloatOK added in v0.10.0

func (x Any) GetFloatOK(key string) (float64, bool)

func (Any) GetIndex added in v0.22.0

func (x Any) GetIndex(index int) (any, bool)

func (Any) GetInt

func (x Any) GetInt(key string) int

func (Any) GetInt64

func (x Any) GetInt64(key string) int64

func (Any) GetInt64OK added in v0.11.0

func (x Any) GetInt64OK(key string) (int64, bool)

func (Any) GetIntOK added in v0.11.0

func (x Any) GetIntOK(key string) (int, bool)

func (*Any) GetPointer added in v0.14.0

func (x *Any) GetPointer(key string) (any, bool)

func (Any) GetString

func (x Any) GetString(key string) string

func (Any) GetStringOK added in v0.11.0

func (x Any) GetStringOK(key string) (string, bool)

func (Any) IsEmpty added in v0.10.0

func (x Any) IsEmpty() bool

IsEmpty returns TRUE if the slice contains no elements

func (Any) IsLength added in v0.10.0

func (x Any) IsLength(length int) bool

IsLength returns TRUE if the slice contains exactly "length" elements

func (Any) Keys added in v0.22.0

func (x Any) Keys() []string

Keys returns a slice of strings representing the indexes of this slice

func (Any) Last added in v0.10.0

func (x Any) Last() any

Last returns the last element in the slice, or nil if the slice is empty

func (Any) Length added in v0.10.0

func (x Any) Length() int

Length returns the number of elements in the slice

func (Any) NotEmpty added in v0.16.3

func (x Any) NotEmpty() bool

NotEmpty returns TRUE if the slice contains at least one element

func (*Any) Remove added in v0.10.0

func (x *Any) Remove(key string) bool

func (Any) Reverse added in v0.10.0

func (x Any) Reverse() Any

Reverse returns a new slice with the elements in reverse order

func (*Any) SetAny

func (x *Any) SetAny(key string, value any) bool

func (*Any) SetBool

func (x *Any) SetBool(key string, value bool) bool

func (*Any) SetFloat

func (x *Any) SetFloat(key string, value float64) bool

func (*Any) SetIndex added in v0.24.0

func (s *Any) SetIndex(index int, value any) bool

func (*Any) SetInt

func (x *Any) SetInt(key string, value int) bool

func (*Any) SetInt64

func (x *Any) SetInt64(key string, value int64) bool

func (*Any) SetString

func (x *Any) SetString(key string, value string) bool

func (*Any) SetValue added in v0.10.0

func (x *Any) SetValue(value any) error

func (Any) Shuffle added in v0.21.4

func (x Any) Shuffle() Any

Shuffle randomizes the order of the elements in the slice

type Object added in v0.10.0

type Object[T any] []T

func NewObject added in v0.11.0

func NewObject[T any]() Object[T]

func (*Object[T]) Append added in v0.12.0

func (x *Object[T]) Append(values ...T)

Append adds one or more elements to the end of the slice

func (Object[T]) At added in v0.21.5

func (x Object[T]) At(index int) T

At returns a bound-safe element from the slice. If the index is out of bounds, then `At` returns the zero value for the slice type

func (Object[T]) AtOK added in v0.22.0

func (x Object[T]) AtOK(index int) (T, bool)

func (Object[T]) Find added in v0.23.0

func (x Object[T]) Find(fn func(T) bool) (T, bool)

Find returns the first element in the slice that satisfies the provided function.

func (Object[T]) First added in v0.10.0

func (x Object[T]) First() T

First returns the first element in the slice, or nil if the slice is empty

func (Object[T]) FirstN added in v0.21.4

func (x Object[T]) FirstN(n int) Object[T]

FirstN returns the first "n" elements in the slice, or all elements if "n" is greater than the length of the slice

func (Object[T]) GetAny added in v0.22.0

func (x Object[T]) GetAny(key string) any

func (Object[T]) GetAnyOK added in v0.22.0

func (x Object[T]) GetAnyOK(key string) (any, bool)

func (*Object[T]) GetPointer added in v0.14.0

func (x *Object[T]) GetPointer(name string) (any, bool)

func (Object[T]) IsEmpty added in v0.10.0

func (x Object[T]) IsEmpty() bool

IsEmpty returns TRUE if the slice contains no elements

func (Object[T]) IsLength added in v0.10.0

func (x Object[T]) IsLength(length int) bool

IsLength returns TRUE if the slice contains exactly "length" elements

func (Object[T]) Keys added in v0.22.0

func (x Object[T]) Keys() []string

Keys returns a slice of strings representing the indexes of this slice

func (Object[T]) Last added in v0.10.0

func (x Object[T]) Last() T

Last returns the last element in the slice, or nil if the slice is empty

func (Object[T]) Length added in v0.10.0

func (x Object[T]) Length() int

Length returns the number of elements in the slice

func (Object[T]) NotEmpty added in v0.16.3

func (x Object[T]) NotEmpty() bool

NotEmpty returns TRUE if the slice contains at least one element

func (*Object[T]) Remove added in v0.10.0

func (x *Object[T]) Remove(key string) bool

func (Object[T]) Reverse added in v0.10.0

func (x Object[T]) Reverse() Object[T]

Reverse returns a new slice with the elements in reverse order

func (*Object[T]) SetIndex added in v0.24.0

func (s *Object[T]) SetIndex(index int, value any) bool

func (*Object[T]) SetValue added in v0.22.1

func (s *Object[T]) SetValue(value any) error

func (Object[T]) Shuffle added in v0.21.4

func (x Object[T]) Shuffle() Object[T]

Shuffle randomizes the order of the elements in the slice

type String

type String []string

func NewString added in v0.11.0

func NewString() String

func (*String) Append added in v0.12.0

func (x *String) Append(values ...string)

Append adds one or more elements to the end of the slice

func (String) At added in v0.21.5

func (x String) At(index int) string

At returns a bound-safe element from the slice. If the index is out of bounds, then `At` returns the zero value for the slice type

func (String) Contains added in v0.11.2

func (x String) Contains(value string) bool

Contains returns TRUE if the slice contains the specified value

func (String) ContainsAll added in v0.14.0

func (x String) ContainsAll(values ...string) bool

ContainsAll returns TRUE if the slice contains all of the specified values

func (String) ContainsAny added in v0.14.0

func (x String) ContainsAny(values ...string) bool

ContainsAny returns TRUE if the slice contains any of the specified values

func (String) Equal added in v0.11.2

func (x String) Equal(value []string) bool

Equal returns TRUE if the slice contains exactly the same elements as the "value" slice

func (String) Find added in v0.23.0

func (x String) Find(fn func(string) bool) (string, bool)

Find returns the first element in the slice that satisfies the provided function.

func (String) First added in v0.10.0

func (x String) First() string

First returns the first element in the slice, or nil if the slice is empty

func (String) FirstN added in v0.21.5

func (x String) FirstN(n int) String

FirstN returns the first "n" elements in the slice, or all elements if "n" is greater than the length of the slice

func (String) GetAny added in v0.22.0

func (x String) GetAny(key string) any

func (String) GetAnyOK added in v0.22.0

func (x String) GetAnyOK(key string) (any, bool)

func (String) GetString

func (x String) GetString(key string) string

func (String) GetStringOK added in v0.11.0

func (x String) GetStringOK(key string) (string, bool)

func (String) IsEmpty added in v0.10.0

func (x String) IsEmpty() bool

IsEmpty returns TRUE if the slice contains no elements

func (String) IsLength added in v0.10.0

func (x String) IsLength(length int) bool

IsLength returns TRUE if the slice contains exactly "length" elements

func (String) Join added in v0.19.1

func (x String) Join(delimiter string) string

Join concatenates all elements of the slice into a single string, separated by the specified delimiter

func (String) Keys added in v0.22.0

func (x String) Keys() []string

Keys returns a slice of strings representing the indexes of this slice

func (String) Last added in v0.10.0

func (x String) Last() string

Last returns the last element in the slice, or nil if the slice is empty

func (String) Length added in v0.10.0

func (x String) Length() int

Length returns the number of elements in the slice

func (String) NotEmpty added in v0.16.3

func (x String) NotEmpty() bool

NotEmpty returns TRUE if the slice contains at least one element

func (*String) Remove added in v0.10.0

func (s *String) Remove(key string) bool

func (String) Reverse added in v0.10.0

func (x String) Reverse() String

Reverse modifies the slice with the elements in reverse order

func (*String) SetIndex added in v0.24.0

func (s *String) SetIndex(index int, value any) bool

func (*String) SetString

func (s *String) SetString(key string, value string) bool

func (*String) SetValue added in v0.10.0

func (s *String) SetValue(value any) error

func (String) Shuffle added in v0.21.4

func (x String) Shuffle() String

Shuffle randomizes the order of the elements in the slice

Jump to

Keyboard shortcuts

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