application

package
v0.0.0-...-03c8f45 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message[T any] struct {
	Context context.Context
	Data    T
}

Message binds a context to data. It should only be used for passing a request context and data together through channels. The receiver should immediately extract the context and data from the message and use them independently. If you're passing a Message as a function parameter, you are misusing it.

func AsMessage

func AsMessage[T any](ctx context.Context, data T) Message[T]

AsMessage creates a Message from a context and data. The message should be immediately sent through a channel.

Jump to

Keyboard shortcuts

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