utils

package
v0.0.0-...-6ab9e56 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatUnit

func FormatUnit(value float64, unit string) string

func IterateMapSorted

func IterateMapSorted[T any, K cmp.Ordered](m map[K]T) iter.Seq2[IndexKey[K], T]

Types

type IndexKey

type IndexKey[K cmp.Ordered] struct {
	Index int
	Key   K
}

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(reader io.Reader) *Reader

func (*Reader) Chunk

func (r *Reader) Chunk(size int) iter.Seq[[]byte]

type SortedList

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

func NewSortedList

func NewSortedList[T any](capacity int, compare func(a T, b T) int) *SortedList[T]

func (*SortedList[T]) All

func (s *SortedList[T]) All() iter.Seq2[int, T]

func (*SortedList[T]) Insert

func (s *SortedList[T]) Insert(value T)

func (*SortedList[T]) Values

func (s *SortedList[T]) Values() iter.Seq[T]

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer) *Writer

func (*Writer) Print

func (w *Writer) Print(a ...any)

func (*Writer) Printf

func (w *Writer) Printf(format string, a ...any)

func (*Writer) Println

func (w *Writer) Println(a ...any)

Jump to

Keyboard shortcuts

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