api

package
v1.78.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 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

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.

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.
tcp

Jump to

Keyboard shortcuts

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