common

package
v0.0.0-...-5510b13 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ReportingPluginTimeoutWarningGracePeriod = 100 * time.Millisecond

Variables

This section is empty.

Functions

func CallPlugin

func CallPlugin[T any](
	ctx context.Context,
	logger loghelper.LoggerWithContext,
	logFields commontypes.LogFields,
	name string,
	maxDuration time.Duration,
	f func(context.Context) (T, error),
) (T, bool)

func CallPluginFromBackground

func CallPluginFromBackground[T any](
	ctx context.Context,
	logger loghelper.LoggerWithContext,
	logFields commontypes.LogFields,
	name string,
	recommendedMaxDuration time.Duration,
	f func(context.Context) (T, error),
) (T, bool)

Unlike CallPlugin, CallPluginFromBackground only uses the "recommendedMaxDuration" to warn if the call takes longer than recommended, but does not use it for context expiration purposes. Context expiration is solely controlled by the passed ctx.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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