context

package
v1.1.0-beta.0...-61c2172 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValueStoreContext

type ValueStoreContext interface {
	// SetValue saves a value associated with this context for key.
	SetValue(key fmt.Stringer, value any)

	// Value returns the value associated with this context for key.
	Value(key fmt.Stringer) any

	// ClearValue clears the value associated with this context for key.
	ClearValue(key fmt.Stringer)
}

ValueStoreContext is a context that can store values.

type WarnHandler

type WarnHandler interface {
	// AppendWarning appends a warning
	AppendWarning(err error)
}

WarnHandler provides a function to add a warning. Using interface rather than a simple function/closure can avoid memory allocation in some cases. See https://github.com/pingcap/tidb/issues/49277

var IgnoreWarn WarnHandler = &ignoreWarn{}

IgnoreWarn is WarnHandler which does nothing

func NewFuncWarnHandlerForTest

func NewFuncWarnHandlerForTest(fn func(err error)) WarnHandler

NewFuncWarnHandlerForTest creates a `WarnHandler` which will use the function to handle warn To have a better performance, it's not suggested to use this function in production.

Jump to

Keyboard shortcuts

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