traceutil

package
v2.12.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearContext

func ClearContext(x interface{}) interface{}

func Stub

func Stub(x interface{}, f func(name string, args ...interface{}))

Stub is a helper function that stubs all functional fields of x with given f.

Types

type FieldStubber

type FieldStubber struct {
	// OnStub is an optional callback that is called when field getting
	// stubbed.
	OnStub func(name string)

	// OnCall is an optional callback that will be called for each stubbed
	// field getting called.
	OnCall func(name string, args ...interface{})
}

FieldStubber contains options of filling all struct functional fields.

func (FieldStubber) Stub

func (f FieldStubber) Stub(x reflect.Value)

Stub fills in given x struct.

Jump to

Keyboard shortcuts

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