socket

package
v1.78.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 10 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. Package socket serves the API over a Unix socket. The socket lives in the container's own filesystem with mode 0600, so only this process's user reaches it — this is the transport for endpoints carrying package values, rendered manifests or hook snapshots.

Example access: curl --unix-socket /path/to/socket http://localhost/endpoint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server serves the given handler on the Unix socket at its path.

func NewServer

func NewServer(socketPath string, handler http.Handler, logger *log.Logger) *Server

NewServer creates a server for the given socket path. Nothing is bound until Start.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown stops serving and unlinks the socket file. Safe to call when Start was never reached, which happens when the other transport failed to bind.

func (*Server) Start

func (s *Server) Start() error

Start binds the socket and serves the handler on it.

func (*Server) Wait

func (s *Server) Wait() error

Wait blocks until serving ends and reports why: nil after Shutdown, the serve error otherwise. Call it once, after Start.

Jump to

Keyboard shortcuts

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