Documentation
¶
Overview ¶
Copyright 2026 Flant JSC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Flant JSC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package api provides the shared serve plumbing of the runtime introspection API. The transports live in the socket and tcp subpackages and the endpoint tree under handlers/; this file holds only what both transports must do identically.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeResponse ¶
func EncodeResponse(w http.ResponseWriter, req *http.Request, value any)
EncodeResponse sends value in the format the output query parameter asks for: JSON when it is absent or "json", YAML when it is "yaml". Any other value is refused, so a typo does not silently return the default.
func Serve ¶
func Serve(listen func() (net.Listener, error), handler http.Handler) (*http.Server, func() error, error)
Serve binds the listener the given function returns and serves the handler on it in the background. The listener is bound synchronously, so a busy address is reported here rather than from the goroutine.
The returned wait function blocks until serving ends and reports why: nil after a graceful Shutdown, the serve error otherwise. It reads a single-shot channel, so exactly one caller waits on it — the runtime, which owns the decision of what a dead listener means. One listener is served once: the runtime binds it in Run and closes it in Stop.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
handlers
|
|
|
root
Package root composes the root endpoint tree of an API server: the versioned API, the process probes, pprof and the route listing.
|
Package root composes the root endpoint tree of an API server: the versioned API, the process probes, pprof and the route listing. |
|
root/v1/converge
Package converge serves what the convergence of modules and Global waits for.
|
Package converge serves what the convergence of modules and Global waits for. |