array

package module
v0.0.0-...-390e71f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 2 Imported by: 0

README

array

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

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

func New

func New[T any]() *Array[T]

New creates a new array.

func (*Array[T]) Clear

func (arr *Array[T]) Clear()

Clear all the values in the array.

func (*Array[T]) Copy

func (arr *Array[T]) Copy() *Array[T]

Copy the values into a new array.

func (*Array[T]) Delete

func (arr *Array[T]) Delete(index int)

Delete the value at a given index.

func (*Array[T]) Length

func (arr *Array[T]) Length() int

Length returns the number of values in the array.

func (*Array[T]) Lookup

func (arr *Array[T]) Lookup(index int) T

Lookup the value at a given index.

func (*Array[T]) MarshalJSON

func (arr *Array[T]) MarshalJSON() ([]byte, error)

func (*Array[T]) Merge

func (arr *Array[T]) Merge(items *Array[T]) *Array[T]

func (*Array[T]) Pop

func (arr *Array[T]) Pop() T

Pop removes the last value in the array and returns the item.

func (*Array[T]) Push

func (arr *Array[T]) Push(value T) int

Push adds an item to the end of the array and returns the length of the array.

func (*Array[T]) Reverse

func (arr *Array[T]) Reverse()

Reverse the order of values in the array.

func (*Array[T]) Set

func (arr *Array[T]) Set(index int, value T)

func (*Array[T]) UnmarshalJSON

func (arr *Array[T]) UnmarshalJSON(b []byte) error

func (*Array[T]) Values

func (arr *Array[T]) Values() []T

Jump to

Keyboard shortcuts

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