Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapInspector ¶
func MapInspector[K comparable, V any](mapToInspect mapInterface[K, V], inspect func(inspectedMap InspectedObject, key K, value V)) func(inspectedMap InspectedObject)
MapInspector is a utility function that can be used to create a manual inspection function for a map.
func SetInspector ¶
func SetInspector[T comparable](setToInspect setInterface[T], inspect func(inspectedSet InspectedObject, element T)) func(inspectedSet InspectedObject)
SetInspector is a utility function that can be used to create a manual inspection function for a set.
Types ¶
type Inspectable ¶
type Inspectable interface { // Inspect returns the inspected version of the object. Inspect(session ...Session) InspectedObject }
Inspectable is an interface that is used to represent an object that can be automatically inspected.
type InspectedObject ¶
type InspectedObject interface { // Type returns the type of the object. Type() string // InstanceID returns the instance identifier of the object. InstanceID() string // Add adds a child object to the inspected object. Add(name string, instance any, inspectManually ...func(object InspectedObject)) // Get returns the child object with the given name. Get(name string) (object InspectedObject, exists bool) // ForEach iterates through all child objects of the inspected object. ForEach(callback func(name string, child InspectedObject)) // ReachableObjectsCount returns the number of reachable objects from the inspected object. ReachableObjectsCount() int // String returns a string representation of the inspected object. String() string }
InspectedObject is an interface that is used to represent an object that has been inspected.
func NewInspectedObject ¶
func NewInspectedObject(instance any, inspect func(InspectedObject), session ...Session) InspectedObject
NewInspectedObject creates a new inspected object from the given instance and inspect function.
Click to show internal directories.
Click to hide internal directories.