addservice

command
v0.6.20 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command addservice is an XPC service that adds two numbers.

It is the Go equivalent of Apple's low-level XPC service template, the one whose main.c calls xpc_listener_create and replies from an incoming message handler. The service name and the message keys match that template, so this binary can be dropped into the same .xpc bundle:

dev.tmc.sample-xpc-service-ll
{"firstNumber": int64, "secondNumber": int64} -> {"result": int64}

An XPC service is launched by launchd on demand, not run from a shell. It lives in a .xpc bundle inside Contents/XPCServices of a host application, and only a process inside that application can reach it. examples/xpc/ build-bundle.sh assembles both sides:

./examples/xpc/build-bundle.sh ~/tmp/AddDemo.app
~/tmp/AddDemo.app/Contents/MacOS/AddDemo -first 23 -second 19

Jump to

Keyboard shortcuts

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