utils

package
v0.0.0-...-52d8f4a Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QuickItoA = [100]string{
	"00", "01", "02", "03", "04", "05", "06", "07", "08", "09",
	"10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
	"20", "21", "22", "23", "24", "25", "26", "27", "28", "29",
	"30", "31", "32", "33", "34", "35", "36", "37", "38", "39",
	"40", "41", "42", "43", "44", "45", "46", "47", "48", "49",
	"50", "51", "52", "53", "54", "55", "56", "57", "58", "59",
	"60", "61", "62", "63", "64", "65", "66", "67", "68", "69",
	"70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
	"80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
	"90", "91", "92", "93", "94", "95", "96", "97", "98", "99",
}

Functions

func BinarySearch

func BinarySearch[T cmp.Ordered](data []T, target T) (idx int, found bool)

Returns the index in the ordered data set where element `target` should exist, and bool `found` if the actual element at that index matches the target

func QuickHexStringToInt

func QuickHexStringToInt(hexStr string) uint64

func QuickIntToHexString

func QuickIntToHexString(val uint64) (hexStr [16]byte, firstNonzeroChar int)

Types

type ErrorBuffer

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

func NewErrorBuffer

func NewErrorBuffer(writer io.Writer, buf *WriteBuffer) ErrorBuffer

func (*ErrorBuffer) AddStr

func (eb *ErrorBuffer) AddStr(format string, args ...any)

func (*ErrorBuffer) BytesCopy

func (eb *ErrorBuffer) BytesCopy() []byte

func (*ErrorBuffer) BytesRef

func (eb *ErrorBuffer) BytesRef() []byte

func (*ErrorBuffer) Cap

func (eb *ErrorBuffer) Cap() int

func (*ErrorBuffer) Clear

func (eb *ErrorBuffer) Clear()

func (*ErrorBuffer) Close

func (eb *ErrorBuffer) Close() error

func (*ErrorBuffer) EnsureSpace

func (eb *ErrorBuffer) EnsureSpace(pool *data_buffer.WriteBufferPool, space int)

func (*ErrorBuffer) Error

func (eb *ErrorBuffer) Error() string

func (*ErrorBuffer) Flush

func (eb *ErrorBuffer) Flush(prefix string)

func (*ErrorBuffer) IfErrAddErr

func (eb *ErrorBuffer) IfErrAddErr(err error)

func (*ErrorBuffer) IfErrAddErrWithStr

func (eb *ErrorBuffer) IfErrAddErrWithStr(err error, format string, args ...any)

func (*ErrorBuffer) Len

func (eb *ErrorBuffer) Len() int

func (*ErrorBuffer) StringCopy

func (eb *ErrorBuffer) StringCopy() string

type ErrorChecker

type ErrorChecker struct {
	Err error
}

func (*ErrorChecker) IsErr

func (e *ErrorChecker) IsErr(err error) bool

type ErrorCollector

type ErrorCollector struct {
	Err error
}

func (*ErrorCollector) Add

func (e *ErrorCollector) Add(err error)

func (*ErrorCollector) AddFmt

func (e *ErrorCollector) AddFmt(format string, args ...any)

func (*ErrorCollector) Do

func (e *ErrorCollector) Do(err error)

type FirstError

type FirstError struct {
	Err error
}

func (*FirstError) Add

func (e *FirstError) Add(err error)

func (*FirstError) Read

func (e *FirstError) Read(r io.Reader, dst []byte) (n int)

type WriteBuffer

type WriteBuffer = data_buffer.WriteBuffer

Jump to

Keyboard shortcuts

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