helper

package
v0.0.0-...-ed03793 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssumeInt

func AssumeInt(i interface{}) int

func Coalesce

func Coalesce[T any](v *T, def T) T

func CoalesceZero

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

func M

func M(marshaller func(any) ([]byte, error), v any) ([]byte, error)

func Ptr

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

func UM

func UM[T any](unmarshaler func([]byte, any) error, data []byte) (v T, err error)

func ZeroOf

func ZeroOf[T any]() (_ T)

Types

type Waiter

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

func NewWaiter

func NewWaiter[T any]() *Waiter[T]

func (Waiter[T]) Close

func (w Waiter[T]) Close()

func (Waiter[T]) Result

func (w Waiter[T]) Result() <-chan T

func (Waiter[T]) Run

func (w Waiter[T]) Run(action func() T)

Jump to

Keyboard shortcuts

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