utils

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToStruct

func BytesToStruct[T any](data []byte) (T, error)

func JSONToStruct

func JSONToStruct[T any](data any) (T, error)

func Pointer

func Pointer[T any](v T) *T

Pointer return pointer for value

func SpecialKey

func SpecialKey(bufSize int) (string, error)

func StructToBytes

func StructToBytes[T any](data T) ([]byte, error)

Types

type Slice

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

func NewSlice

func NewSlice[T any]() *Slice[T]

func NewSliceWithLength

func NewSliceWithLength[T any](length int) *Slice[T]

func (*Slice[T]) Add

func (s *Slice[T]) Add(item T)

func (*Slice[T]) AddMany

func (s *Slice[T]) AddMany(items []T)

func (*Slice[T]) AddToIndex

func (s *Slice[T]) AddToIndex(index int, item T)

func (*Slice[T]) GetAll

func (s *Slice[T]) GetAll() []T

func (*Slice[T]) Len

func (s *Slice[T]) Len() int

Jump to

Keyboard shortcuts

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