infra

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

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendErrorStack

func AppendErrorStack(es error, errors ...error) error

func NewErrorStack

func NewErrorStack(errMsg string) error

func OsYield

func OsYield()

func ProcYield

func ProcYield(cycles uint32)

func WrapErrorStack

func WrapErrorStack(err error) error

func WrapErrorStackWithMessage

func WrapErrorStackWithMessage(es error, errMsg string) error

Types

type ClosableChannel

type ClosableChannel[T comparable] interface {
	io.Closer
	ReadOnlyChannel[T]
	SendOnlyChannel[T]
}

func NewSafeClosableChannel

func NewSafeClosableChannel[T comparable](chSize ...int) ClosableChannel[T]

type Complex

type Complex interface {
	~complex64 | ~complex128
}

Complex is a constraint that permits any complex numeric type. If future releases of Go add new predeclared complex numeric types, this constraint will be modified to include them. We have to calc the complex square root. i.e. Amplitude (modulus) comparison in the complex plane.

type ErrorStack

type ErrorStack interface {
	Error() string
	Unwrap() []error
	MarshalJSON() ([]byte, error)
	zapcore.ObjectMarshaler
}

type Float

type Float interface {
	~float32 | ~float64
}

Float is a constraint that permits any floating-point type. If future releases of Go add new predeclared floating-point types, this constraint will be modified to include them.

type Integer

type Integer interface {
	Signed | Unsigned
}

Integer is a constraint that permits any integer type. If future releases of Go add new predeclared integer types, this constraint will be modified to include them.

type OrderedKey

type OrderedKey interface {
	cmp.Ordered
}

OrderedKey byte => ~uint8

type OrderedKeyComparator

type OrderedKeyComparator[K OrderedKey] func(i, j K) int64

OrderedKeyComparator Assume i is the new key.

  1. i == j (i-j == 0, return 0)
  2. i > j (i-j > 0, return 1), turn to right part.
  3. i < j (i-j < 0, return -1), turn to left part.

type ReadOnlyChannel

type ReadOnlyChannel[T comparable] interface {
	Wait() <-chan T
}

type SendOnlyChannel

type SendOnlyChannel[T comparable] interface {
	Send(v T, nonBlocking ...bool) error
	IsClosed() bool
}

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Unsigned is a constraint that permits any unsigned integer type. If future releases of Go add new predeclared unsigned integer types, this constraint will be modified to include them.

Jump to

Keyboard shortcuts

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