httpapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 28 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.

README

Hot-swap HTTP transports

The application creates httpapi.New(service, resources) and serves it on a listener from httpapi.Listen. Unix sockets default to unix:/var/run/cudahotswap.sock; the application owns directory permissions. TCP uses plain HTTP. Keep it on loopback and use an SSH forward.

All service methods appear in httpapi.Endpoints(). Each endpoint takes POST JSON except GET /v1/events?since=SEQ. Events use SSE by default or JSON lines with Accept: application/x-ndjson. The client example in stream_test.go round-trips against an httptest server.

Code/configuration mutations pass label through to the service and preserve the actual generation, config revision and State.Label. For operations without a service label argument, request_label is transport request metadata; it does not change service state. Watch events retain their producer's label and stamp.

Named resources come from the embedding application: checkers, buffers, streams and graph bindings. A client cannot supply a checker implementation or native pointer. The application's Arguments binding fixes each kernel's pointer-versus-scalar argument kinds; unbound launches fail closed. PTX integer storage alone is insufficient to infer that intent. Scalars use { "type": "u32", "value": 32 }; a buffer uses { "type": "buffer", "name": "x" }. Fixture buffers additionally declare their argument index and byte extent. The application must exclude concurrent buffer writes while replay records or uses them.

Pin and launch responses retain opaque handle values even on partial errors. Release pins with release_pin, drain launches with wait, and release fixtures with close_fixture, supplying handle and label. Failed cleanup retains the owner for retry. Close cancels streams and drains launches before releasing pins and closing the service; the application frees native resources only after Close succeeds. The handler limits retained handles to 128 and streams to 32.

Failed checks return HTTP 200 with the classified report. Malformed requests return 400; typed service poisoning returns 503. Other service failures remain structured HTTP 200 failures. Cleanup endpoints remain available after poisoning.

CLI and SSH

Build the CUDA-host CLI from nvidia/:

GOWORK=off go build -o ./cudahotswap ./x/cmd/cudahotswap
./cudahotswap demo -addr tcp:127.0.0.1:8713

The demo owns SAXPY buffers and runs a CPU-reference Checker. It acquires GPU-lock leases for setup, readback and teardown; Service owns per-request launch leases. A finite server may run under a real outer GPU-lock holder when it inherits the verified holder PID and lock directory unchanged. Its request leases then nest under that owner. An unrelated outer holder without that inheritance blocks the server. Bound the server lifetime and retain its cleanup before releasing the outer holder. Its buffers remain private to the serialized loop and checker. General applications supply named launch/fixture resources through httpapi.Resources.

On the Mac, in a separate terminal:

ssh -N -L 127.0.0.1:8713:127.0.0.1:8713 gpu-host
cudahotswap status -addr tcp:127.0.0.1:8713 -name saxpy
cudahotswap push -addr tcp:127.0.0.1:8713 -name saxpy -entry saxpy -source saxpy.cu -label human
cudahotswap tail -addr tcp:127.0.0.1:8713 -since 0
cudahotswap -addr tcp:127.0.0.1:8713 -watch saxpy.cu -name saxpy -entry saxpy

Local watch polls every 100 ms and pushes changed bytes. The service's own Watch endpoint uses the lane 61 directory watcher and debounce semantics.

MCP

The adapter lives in a separate module, x/cmd/cudahotswapmcp. Its SDK dependency does not enter nvidia/go.mod. From that directory:

GOWORK=off go build -o ./cudahotswapmcp .
./cudahotswapmcp -addr tcp:127.0.0.1:8713

The process speaks MCP stdio. Its generated JSON schemas are returned by MCP tools/list; the following table identifies every tool's arguments. A failed report sets MCP isError and preserves the classified reason.

Tool Arguments HTTP endpoint
push_kernel name, label, source: code, entry, optional filename/flags push
revert_kernel name, label revert
list_kernels none list
kernel_status name, label status
set_check name, label, optional checker/fixture/policy/keep_on_failure set_check
set_launch name, label, geometry set_geometry
record_fixture name, label, stream, geometry, args, buffers, outputs, optional policy record_fixture
close_fixture handle, label close_fixture
select_version name, label, version select
wait_for_report name, since, timeout_seconds (1..120) events

Geometry uses Grid and Block objects, each with X, Y, Z, and SharedMem. A null geometry removes a configured override through set_launch. Fixtures require geometry, named stream/buffers and outputs. Checker names and fixture handles must already exist on the server. A retention gap is an explicit error from wait_for_report, never a fabricated success.

A client's replay policy judges its own pushes, so the server clamps it to Resources.ReplayLimits (by default DefaultReplayPolicy: exact output, no noise, at least five rounds), and ignores keep_on_failure unless Resources.AllowKeepOnFailure is set.

Native consumer

The adapter's TestNativeMacMCPWrongThenCorrect is explicitly gated by CUDAHOTSWAP_NATIVE=1. It runs on the Mac, through the operator-owned forward, starts the actual MCP binary over stdio, pushes a wrong SAXPY and then the correct one, and retains both MCP reports and submitted source digests. It requires absolute CUDAHOTSWAP_MCP_BINARY and CUDAHOTSWAP_ARTIFACTS, and CUDAHOTSWAP_ADDR=tcp:127.0.0.1:8713. It has not been physically qualified by the implementation's host gates.

Host stages

Applications may implement the optional StageService extension and supply Resources.Stages. Each entry fixes a retained builder, immutable StageSpec, ordered buffer registry names, stream registry name, CUDA mode and compiler flags. The client cannot select a compiler executable, context schema or pointer. The application retains these owners and generation directories until Handler.Close succeeds.

The five routes are register_stage, push_stage, revert_stage, run_stage and record_stage_fixture. Registration and push take name, label and stage_code; compiler flags and mode come from the application binding. Revert takes only the named stage and label. Stage calls refuse kernel geometry.

Run takes the declared stream name and ordered buffer-only args. Its response has a completion handle and no invented state stamp. A handle returned with a failure still owns work. Call wait with that handle and a label, retrying after cancellation or cleanup failure. Fixture calls require the same ordered arguments, exact complete buffer extents and explicit outputs/policy; their replay arguments are nil placeholders for the service-owned scratch buffers. Host-only stages cannot record native replay fixtures.

The host lifecycle test compiles and loads actual CPU-only C glue. Synthetic native-dispatch tests cover serialization and refusal, not GPU execution or native resource qualification.

Receipt admission

Set Resources.AdmissionGate to require receipt admission on POST /v1/push. Include the kernelreceipt/v0 object as the request's receipt field. The application configures Authorize to trust only digests of receipts produced by its qualification process. The digest hashes the canonical Receipt.MarshalIndent encoding, so transport whitespace does not affect it. The application also supplies the launch contract for the exact active state through LaunchContract.

A receipt must pass parity and paired timing, and its speedup confidence interval must lie above 1×. The handler checks it against the active kernel and the exact newly compiled CUBIN. The service reruns host ABI, kernelcheck, and layout.CheckSync (when candidate PTX is supplied by the compilation, request ptx field, or AdmissionGate.PTX) before taking a GPU lease, then uses its configured replay or checker during the existing push lifecycle. A stale baseline or admission refusal returns HTTP 422 with failure.code set to admission_rejected. A selected version retains the accepted receipt_sha256 in its state.

While the gate is enabled, HTTP paths that can bypass admission or change launch or check policy are unavailable. Register the original kernel, configure its checks, and manage stage and version selection through the application. Revert can still select the application-owned original.

Stage qualification

An embedding application can construct a StageQualification from a known stage source, retained candidate bytes, and its trusted kernel receipt. QualifyStage checks the receipt's PASS verdict, candidate digest, and applicable standard check definitions, including the required static contract check. The application attests that the bytes correspond to that source and build configuration.

Set StageBinding.Qualifications to the application-owned list of approved sources and artifacts. A non-nil list restricts stage registration and pushes to exact matches. When multiple approvals share source and flags, the caller must provide the application's StageQualification.ID() in the stage_qualification request field. The ID binds the supplied stage receipt, source and application-approved kernel artifacts and selects only from the configured list. An empty list denies both operations. The check happens before the service receives the source, so HTTP callers cannot nominate their own receipts. The stage builder recompiles the approved source and checks the resulting host shared library against the retained receipt artifact before it is loaded or selected. The receipt candidate must be the stage library itself. Use a reproducible compiler configuration and protect the generation directory through load. For a native stage, pass one StageKernelArtifact to QualifyStage for each named function. Its CUBIN SHA-256 and entry must match the registered kernel at publication. The stage version retains those specific loaded kernels, so an independent kernel update leaves the stage available until a new qualified pair is selected. A revert restores the prior stage library and its retained kernels. The service validates the compiler output identity and ABI; correctness and timing remain evidence supplied by the trusted receipt store.

Set Resources.QualifiedStagesOnly for an HTTP surface limited to qualified stage registration and pushes plus read-only endpoints. All stages must opt in. General source mutation, watch, and version selection or rollback routes remain outside this surface. Applications using the unrestricted handler retain their existing rollback behavior.

Use separate handlers for kernel receipt admission and the qualified-stage surface. An embedding server can mount both under the same authorization policy.

To restore approvals after restart, seal the completed evaluation ledger as a snapshot and retain its SHA-256 in a separate trusted deployment configuration. Open the snapshot at startup and pass the reader, configured pin and served cohort to NewPromotionAuthorizer. Use the resulting policy as AdmissionGate.Authorize. A ledger or digest supplied by the HTTP caller does not convey approval. Treat a missing pin, mismatch, incomplete final row, or invalid row as a startup error. The provider retains the decisions read at startup. To publish a different approval set, install a new snapshot and independently trusted pin.

The last row containing a receipt's digest controls that receipt. A later refusal with the digest revokes approval. A Stage 1 refusal has no receipt digest. An evaluation whose receipt describes a different kernel, artifact pair or launch contract also carries no receipt digest. Those rows cannot identify or revoke an earlier approval. The authorizer only recognizes receipt identities. The admission gate separately checks the receipt against the selected baseline, candidate bytes and application launch contract.

Documentation

Overview

Package httpapi exposes cudahotswap.Service as bounded JSON over HTTP.

New accepts an application service and registries of named native resources. Clients receive opaque lifetime handles, never raw CUDA pointers. The application must keep its resources live until Handler.Close succeeds. Optional StageService endpoints use application-owned StageBinding entries. A caller supplies stage_code, never compiler paths, context schemas or native pointers. RunStage returns only a completion handle; wait releases its owners.

Listen accepts unix:/absolute/socket or tcp:host:port. Use an SSH forward for remote TCP access; this package does not provide authentication or TLS. Subscribe uses /v1/events with a since cursor, as SSE or JSON lines selected by Accept: application/x-ndjson. Client.Events owns the response body and must be closed on disconnect.

This package is outside the compatibility promise of github.com/tmc/lib/nvidia. Its API may change or be removed in patch releases.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Endpoints

func Endpoints() map[string]string

Endpoints returns the HTTP endpoint for each exported Service method. Additional endpoints release_pin, wait and close_fixture release owners.

func Listen

func Listen(address string) (net.Listener, error)

Listen listens on unix:/absolute/socket, or tcp:host:port. An empty address selects unix:/var/run/cudahotswap.sock. Existing socket paths are not removed. The embedding application controls directory permissions and shutdown.

func NewPromotionAuthorizer

func NewPromotionAuthorizer(r io.Reader, trustedSHA256, cohort string) (func(context.Context, string) error, error)

NewPromotionAuthorizer uses a retained cudaprof hillclimb JSONL snapshot as an AdmissionGate.Authorize policy. The embedding application must supply the trusted SHA-256 of the complete file from an independent trust source and the cohort it serves. Computing a pin from an untrusted upload does not establish authority. The returned policy retains no reader or file.

The latest row carrying each receipt digest controls that receipt. A refusal with that digest revokes it. A refusal without a receipt digest, such as a Stage 1 failure, cannot identify or revoke an earlier approval.

Example

The pin is supplied by a trusted deployment configuration.

const snapshot = `{"schema":"cudaprof-hillclimb-step/v1","cohort":"sm_121a","kernel":"kernel","stage":1,"promoted":false,"dead_end":"candidate_static_rejected"}` + "\n"
const trustedPin = "sha256:76ba363f36902b5c09ef71dfc0aa041523979a797f94b1193cd81b736beed4d5"
authorize, err := NewPromotionAuthorizer(strings.NewReader(snapshot), trustedPin, "sm_121a")
fmt.Println(err)
fmt.Println(authorize(context.Background(), receipt.DigestBytes([]byte("unapproved receipt"))))
Output:
<nil>
receipt is not promoted in the pinned snapshot

Types

type AdmissionGate

type AdmissionGate struct {
	// Authorize receives the SHA-256 digest of Receipt.MarshalIndent.
	Authorize func(context.Context, string) error
	// LaunchContract returns the application-owned launch contract for the
	// current kernel state. A receipt must describe this exact contract.
	LaunchContract func(context.Context, hotswap.State) (receipt.LaunchContract, error)
	Static         kernelcheck.Checker
	// SASS can supply a trusted disassembly by CUBIN digest on hosts without
	// a native decoder or nvdisasm. The checker rechecks its instruction bytes.
	SASS func(cubinSHA256 string) string
	// PTX can supply candidate PTX by CUBIN digest when neither the compiled
	// candidate nor the request carries PTX inline.
	PTX func(cubinSHA256 string) string
	// SyncLaunch optionally customizes the layout.SyncLaunch passed to
	// layout.CheckSync when candidate PTX is verified. When nil, Block and
	// fixed Grid dimensions are derived from the receipt launch contract.
	SyncLaunch func(context.Context, hotswap.State, receipt.LaunchContract) (layout.SyncLaunch, error)
}

AdmissionGate checks uploaded receipt evidence and host static safety before a candidate can load. Authorize must accept only receipt digests obtained from a trusted evidence producer: kernelreceipt/v0 is unsigned.

func (AdmissionGate) Candidate

func (g AdmissionGate) Candidate(ctx context.Context, entry string, evidence []byte) (hotswap.CandidateAdmission, error)

Candidate checks reviewed evidence and returns the admission function for a trusted embedding application to pass to Service.PushWithAdmission.

type Argument

type Argument struct {
	Type  string          `json:"type"`
	Name  string          `json:"name,omitempty"`
	Value json.RawMessage `json:"value,omitempty"`
}

Argument is a typed scalar or a named application buffer. Supported scalar types are u32, i32, u64, i64, f32 and f64. Buffer arguments have Type "buffer" and Name, with no Value. Pointer integers are never accepted.

type Buffer

type Buffer struct {
	Name   string `json:"name"`
	Arg    int    `json:"arg"`
	Bytes  int    `json:"bytes"`
	Stable bool   `json:"stable"`
}

Buffer describes a fixture buffer by its server registry name and byte extent.

type Client

type Client struct {
	URL  string
	HTTP *http.Client
}

Client calls the HTTP service. HTTP is the only wire protocol used by the CLI and MCP adapter. A service Failure is returned in Response, not hidden.

func NewClient

func NewClient(address string) (*Client, error)

NewClient accepts unix:/absolute/socket or tcp:host:port. TCP is plain HTTP; use an SSH forward for remote hosts. The default address is application-owned.

func (*Client) Call

func (c *Client) Call(ctx context.Context, method string, q Request) (Response, error)

Call round-trips a named endpoint. Non200 statuses return both the structured response and an error. A failed candidate check is a200 with Failure and Push.

Example
h, _ := New(new(fakeService), Resources{})
server := httptest.NewServer(h)
defer server.Close()
client := &Client{URL: server.URL, HTTP: server.Client()}
response, err := client.Call(context.Background(), "status", Request{Name: "kernel"})
fmt.Println(response.State.Generation, response.State.ConfigRevision, err)
Output:
9 7 <nil>

func (*Client) Events

func (c *Client) Events(ctx context.Context, since uint64) (*EventStream, error)

Events streams NDJSON events until cancellation or a terminal service error. The caller owns the returned response body and must close it. Its decoder refuses frames over 512 KiB, including JSON escaping of the service's 64 KiB retained-value budget.

type EventStream

type EventStream struct {
	// contains filtered or unexported fields
}

EventStream owns a streaming HTTP body. Close disconnects and releases the server subscription. Read is serial; Close may run concurrently to stop it.

func (*EventStream) Close

func (s *EventStream) Close() error

Close disconnects this stream.

func (*EventStream) Read

func (s *EventStream) Read() (Frame, error)

Read reads one bounded frame, including explicit retention gaps.

type Failure

type Failure struct {
	Code     string          `json:"code,omitempty"`
	Message  string          `json:"message"`
	Outcome  hotswap.Outcome `json:"outcome"`
	Poisoned bool            `json:"poisoned,omitempty"`
}

Failure preserves a service failure without turning a failed check into a transport success. Admission refusals use HTTP 422; other non-poisoning service failures use 200.

type Frame

type Frame struct {
	Event  *hotswap.Event `json:"event,omitempty"`
	Result *Response      `json:"result,omitempty"`
}

Frame contains one report event, watched push result, or terminal failure.

type Graph

type Graph struct {
	Exec   *graph.Exec
	Node   *graph.Node
	Stream *cuda.Stream
	Grid   driver.Dim3
	Args   []any
}

Graph names an application-owned graph binding. Args and all referenced native allocations must remain live until Handler.Close succeeds.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler owns transport lifetime handles, but not the application's native resources. Close must succeed before the application destroys those resources. It bounds handles to128 and streams to32. A disconnected caller does not release submitted work; opaque handles remain retained for retry or Close.

func New

func New(service Service, resources Resources) (*Handler, error)

New constructs an HTTP handler with application-owned named resources.

func (*Handler) Close

func (h *Handler) Close(ctx context.Context) error

Close cancels transport streams, drains completion handles, releases pins, then closes the Service. It waits for in-flight requests to return before releasing owners. Cancellation leaves those requests and owners retained for a later Close; callers must not destroy application resources until it succeeds.

func (*Handler) HasAdmissionGate

func (h *Handler) HasAdmissionGate() bool

HasAdmissionGate reports whether this handler requires admission receipts.

func (*Handler) QualifiedStagesOnly

func (h *Handler) QualifiedStagesOnly() bool

QualifiedStagesOnly reports whether the handler restricts mutations to registration and push of application-qualified stages.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type QualifiedStageService

QualifiedStageService binds stage publication to an exact compiled library.

type Request

type Request struct {
	Name               string                  `json:"name,omitempty"`
	Label              string                  `json:"label,omitempty"`
	Source             hotswap.Source          `json:"source,omitempty"`
	PTX                string                  `json:"ptx,omitempty"`
	Receipt            json.RawMessage         `json:"receipt,omitempty"`
	StageCode          string                  `json:"stage_code,omitempty"`
	Version            uint64                  `json:"version,omitempty"`
	Flags              []string                `json:"flags,omitempty"`
	Geometry           *hotswap.LaunchGeometry `json:"geometry,omitempty"`
	Paths              *hotswap.WatchPaths     `json:"paths,omitempty"`
	Checker            string                  `json:"checker,omitempty"`
	Fixture            string                  `json:"fixture,omitempty"`
	Policy             *hotswap.ReplayPolicy   `json:"policy,omitempty"`
	KeepOnFailure      bool                    `json:"keep_on_failure,omitempty"`
	Stream             string                  `json:"stream,omitempty"`
	Graph              string                  `json:"graph,omitempty"`
	Args               []Argument              `json:"args,omitempty"`
	Buffers            []Buffer                `json:"buffers,omitempty"`
	Outputs            []hotswap.FixtureOutput `json:"outputs,omitempty"`
	Watch              hotswap.WatchConfig     `json:"watch,omitempty"`
	Handle             string                  `json:"handle,omitempty"`
	StageQualification string                  `json:"stage_qualification,omitempty"`
}

Request is the bounded JSON request shared by endpoints. An endpoint checks required fields before calling its corresponding service method.

type Resources

type Resources struct {
	// AdmissionGate requires trusted receipts on push. Nil leaves the
	// application's existing admission behavior unchanged.
	AdmissionGate *AdmissionGate
	// Arguments fixes each kernel's application-declared argument kinds.
	// PTX integer storage alone does not prove scalar versus pointer intent.
	// Launch and RecordFixture fail closed without this binding.
	Arguments map[string][]string
	Checkers  map[string]hotswap.Checker
	Buffers   map[string]cuda.Slice[byte]
	Streams   map[string]*cuda.Stream
	Graphs    map[string]Graph
	// Stages fixes each stage's builder, schema and named launch resources.
	// All owners remain live until Handler.Close succeeds.
	Stages map[string]StageBinding
	// QualifiedStagesOnly serves qualified stage registration and pushes plus
	// read-only status endpoints. Every stage must opt into qualifications.
	QualifiedStagesOnly bool
	// ReplayLimits bounds the replay policy a client requests in set_check,
	// record_fixture and record_stage_fixture, since that policy judges the
	// client's own pushes. Each tolerance is clamped to at most the limit's,
	// Rounds to at least the limit's, and an Exact limit forces exact
	// comparison. Nil means cudahotswap.DefaultReplayPolicy.
	ReplayLimits *hotswap.ReplayPolicy
	// AllowKeepOnFailure honors a client's keep_on_failure. Otherwise it is
	// cleared, and a failed application check rolls the push back.
	AllowKeepOnFailure bool
}

Resources names objects supplied by the embedding application. Clients cannot supply device addresses, Go functions, streams or graph handles. The handler copies the maps; the application keeps the native owners alive and excludes concurrent buffer writes until Handler.Close succeeds. Checkers implement the application's reference policy; a transport never invents a correctness hook.

type Response

type Response struct {
	// RequestLabel identifies the transport request. It never replaces the
	// service's State.Label or invents a generation or configuration revision.
	RequestLabel string              `json:"request_label,omitempty"`
	State        *hotswap.State      `json:"state,omitempty"`
	States       []hotswap.State     `json:"states,omitempty"`
	Waiting      []hotswap.LockWait  `json:"waiting,omitempty"`
	Versions     []hotswap.Version   `json:"versions,omitempty"`
	Push         *hotswap.PushResult `json:"push,omitempty"`
	Paths        *hotswap.WatchPaths `json:"paths,omitempty"`
	Handle       string              `json:"handle,omitempty"`
	Failure      *Failure            `json:"failure,omitempty"`
}

Response returns service values and opaque lifetime handles. A nonempty Handle with Failure still owns resources and must be waited or released.

type Service

Service is the transport's complete service surface. Implementations must preserve the ownership and completion contracts of cudahotswap.Service.

type StageBinding

type StageBinding struct {
	Builder     *stage.Builder
	Schema      hotswap.StageSpec
	BufferNames []string
	Stream      string
	CUDA        bool
	Flags       []string

	// Qualifications, when non-nil, restrict register_stage and push_stage
	// to the exact source, library and named function artifacts approved by the application.
	// An empty non-nil slice admits neither operation.
	Qualifications []StageQualification
}

StageBinding fixes one application-owned stage's compilation and context. Builder, its generation directories and all named owners must remain live until Handler.Close succeeds. BufferNames is in Schema.Buffers order. Stream names an application stream. HostOnly requires no stream or device bindings. CUDA and Flags are fixed by the application, never by the HTTP caller.

Example
// Supply the application's retained Builder before passing this binding
// to New. A host-only C stage has no buffers, functions or CUDA stream.
binding := StageBinding{Schema: hotswap.StageSpec{HostOnly: true}}
fmt.Println(binding.Schema.HostOnly, len(binding.BufferNames), binding.CUDA)
Output:
true 0 false

type StageQualification

type StageQualification struct {
	// contains filtered or unexported fields
}

StageQualification authorizes one exact source and compile configuration. Its zero value is invalid. The embedding application supplies qualifications from its trusted receipt store.

func QualifyStage

func QualifyStage(source stage.Source, candidate []byte, r *receipt.Receipt, kernels ...hotswap.StageKernelArtifact) (StageQualification, error)

QualifyStage validates a passing receipt against the retained candidate artifact and binds it to the supplied stage source. The caller attests that source and artifact correspond. This check does not reproduce compilation, timings or correctness. For a native stage, the caller also supplies the approved CUBIN digest and entry for each named function.

func (StageQualification) ID

func (q StageQualification) ID() string

ID returns the selection digest of an application-owned approval. A caller may select this approval only when it is present in the stage binding.

type StageService

StageService is the optional host-stage extension of Service. An application without this extension refuses stage calls; existing kernel calls still work.

Example
// The real service implements the optional extension without adding
// stage methods to kernel-only transport implementations.
var service StageService = (*hotswap.Service)(nil)
fmt.Printf("%T\n", service)
Output:
*hotswap.Service

Jump to

Keyboard shortcuts

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