tel

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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

func NSErrorToError(ctx context.Context, ptr unsafe.Pointer) error

NSErrorToError converts an ObjC NSError to a Go error and records it on the active span.

func RaiseIfException

func RaiseIfException(ctx context.Context, exc unsafe.Pointer)

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.

Jump to

Keyboard shortcuts

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