Documentation
¶
Index ¶
- func GenerateJSONSchema(v interface{}) (json.RawMessage, error)
- func JSONToStruct(data json.RawMessage, v interface{}) error
- func MergeJSONObjects(objects ...json.RawMessage) (json.RawMessage, error)
- func ValidateAgainstSchema(data json.RawMessage, schema json.RawMessage) error
- type GoroutineLeakDetector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJSONSchema ¶
func GenerateJSONSchema(v interface{}) (json.RawMessage, error)
GenerateJSONSchema generates a JSON schema from a Go struct This is useful for creating tool input/output schemas
func JSONToStruct ¶
func JSONToStruct(data json.RawMessage, v interface{}) error
JSONToStruct unmarshals JSON into a struct with better error messages
func MergeJSONObjects ¶
func MergeJSONObjects(objects ...json.RawMessage) (json.RawMessage, error)
MergeJSONObjects merges multiple JSON objects, with later objects taking precedence
func ValidateAgainstSchema ¶
func ValidateAgainstSchema(data json.RawMessage, schema json.RawMessage) error
ValidateAgainstSchema validates data against a JSON schema
Types ¶
type GoroutineLeakDetector ¶
type GoroutineLeakDetector struct {
// contains filtered or unexported fields
}
GoroutineLeakDetector helps detect goroutine leaks in tests
func NewGoroutineLeakDetector ¶
func NewGoroutineLeakDetector(t *testing.T) *GoroutineLeakDetector
NewGoroutineLeakDetector creates a new goroutine leak detector
func (*GoroutineLeakDetector) Check ¶
func (d *GoroutineLeakDetector) Check()
Check verifies that goroutine count hasn't grown beyond allowed threshold
func (*GoroutineLeakDetector) SetAllowedGrowth ¶
func (d *GoroutineLeakDetector) SetAllowedGrowth(n int) *GoroutineLeakDetector
SetAllowedGrowth sets the number of goroutines allowed to grow
func (*GoroutineLeakDetector) SetStabilizeDelay ¶
func (d *GoroutineLeakDetector) SetStabilizeDelay(delay time.Duration) *GoroutineLeakDetector
SetStabilizeDelay sets the delay to allow goroutines to stabilize
func (*GoroutineLeakDetector) Start ¶
func (d *GoroutineLeakDetector) Start()
Start records the initial goroutine count