socket

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 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

Package socket is where the per-user Blitz service listens and how clients reach it: a Unix socket that only its user can open. The service runs shell commands, so it is never on a network port by default.

Index

Constants

View Source
const BaseURL = "http://blitz"

BaseURL is the URL clients use over the socket (the host is ignored).

Variables

View Source
var ErrRunning = errors.New("a Blitz service is already running")

ErrRunning reports a service already answering on the socket.

Functions

func Client

func Client(path string) *http.Client

Client returns an HTTP client that reaches the service on the socket; use it with BaseURL.

func DefaultSocket

func DefaultSocket() string

DefaultSocket is where the per-user service listens: $BLITZ_SOCKET, or ~/.blitz/run/blitz.sock.

func Listen

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

Listen opens the Unix socket at path for this user only. It refuses when a service already answers there, and replaces a socket left by one that died.

On Windows, permission bits mean nothing (Chmod only sets read-only); there the socket is as private as the folder it's in, whose access control list the user's profile gives it: ~/.blitz/run is only the user's (and the system's, and administrators').

func Running

func Running(path string) bool

Running reports whether a service answers on the socket.

Types

This section is empty.

Jump to

Keyboard shortcuts

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