Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OnCallbackPanic func(name string, r interface{}, stack []byte)
OnCallbackPanic is called when a panic is recovered inside a generated //export callback (goCallBlock_* or goCallIMP_*). Wire this to your structured logger at application startup. Called from any goroutine.
var OnException func(reason string)
OnException is called by RaiseIfException immediately before panicking with an ObjC exception. Wire this to your structured logger at application startup. Called from any goroutine; must be goroutine-safe.
Functions ¶
func Call ¶
func Call(ctx context.Context, recv cgo.Object, spanName string, args ...cgo.Object) (context.Context, func())
Call starts an OTEL span for the given ObjC method invocation and returns a cleanup func that ends the span and keeps recv and all args alive past the CGo call. Pass nil for recv on class methods and standalone functions. The variadic args should be every ObjC object argument whose Go wrapper must be prevented from being finalised while the CGo callee holds the raw pointer.
func NSErrorToError ¶
NSErrorToError converts an ObjC NSError to a Go error and records it on the active span.
func RaiseIfException ¶
RaiseIfException converts a caught ObjC exception to a Go panic. Calls OnException (if set) then records structured exception fields on the active span before panicking. This gives the application a chance to log the reason through its structured logger before the panic unwinds the stack.
Types ¶
This section is empty.