Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncChannelTransform ¶
func AsyncChannelTransform[In any, Out any]( ctx context.Context, input <-chan *AsyncResult[In], bufferCapacity int, transform func(In) (Out, error)) <-chan *AsyncResult[Out]
AsyncChannelTransform copies messages from an input channel, transforms them, and sends them to an output channel.
Types ¶
type AsyncResult ¶
AsyncResult holds a value and an error, useful for async operations
func NewAsyncError ¶
func NewAsyncError[T any](err error) *AsyncResult[T]
NewAsyncError creates a new AsyncResult with an error
func NewAsyncResult ¶
func NewAsyncResult[T any](value T, err error) *AsyncResult[T]
NewAsyncResult creates a new AsyncResult with a value and an error
func NewAsyncValue ¶
func NewAsyncValue[T any](value T) *AsyncResult[T]
NewAsyncValue creates a new AsyncResult with a value
func (AsyncResult[T]) MarshalJSON ¶
func (ar AsyncResult[T]) MarshalJSON() ([]byte, error)
MarshalJSON customizes the JSON representation of AsyncResult
func (*AsyncResult[T]) UnmarshalJSON ¶
func (ar *AsyncResult[T]) UnmarshalJSON(data []byte) error
UnmarshalJSON customizes the JSON unmarshalling of AsyncResult
func (*AsyncResult[T]) ValueOrError ¶
func (ar *AsyncResult[T]) ValueOrError() (T, error)
Click to show internal directories.
Click to hide internal directories.