Example #1
0
//export swift_io_v_v23_discovery_new
func swift_io_v_v23_discovery_new(ctxHandle C.GoContextHandle, errOut *C.SwiftVError) C.GoDiscoveryHandle {
	ctx := scontext.GoContext(uint64(ctxHandle))
	d, err := v23.NewDiscovery(ctx)
	if err != nil {
		sutil.ThrowSwiftError(ctx, err, unsafe.Pointer(errOut))
		return C.GoDiscoveryHandle(0)
	}
	return C.GoDiscoveryHandle(sutil.GoNewRef(&d))
}
Example #2
0
func SwiftClientCall(call rpc.ClientCall) C.GoClientCallHandle {
	return C.GoClientCallHandle(sutil.GoNewRef(call))
}
Example #3
0
// Converts a Go Context into a native pointer for Swift and increments the go reference count
func SwiftContext(ctx *context.T) C.GoContextHandle {
	id := sutil.GoNewRef(ctx)
	return C.GoContextHandle(id)
}