service

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package service serves the spacer API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, conn *uds.Conn, spacer Spacer)

Serve services requests on the passed *uds.Conn until the client disconnects, using the passed spacer to carry out the requests.

Since this function is used in testing, it generates slog records over the course of its operation. You might thus want to send slog output to the GinkgoWriter: this way, you won't be bothered with slog output unless your test fails ($HEAVENS forbid!) or you explicitly request to see it all using “-ginkgo.v” when running tests.

Types

type Spacemaker

type Spacemaker struct {
	Exe    string
	Stdout io.Writer
	Stderr io.Writer
	// contains filtered or unexported fields
}

func (*Spacemaker) Room

func (s *Spacemaker) Room(req *api.RoomsRequest) api.Response

Room creates one or multiple new namespaces of the requested types, returning file descriptors referencing these new namespaces. Room does not allow namespaces of type PID and user to be created due to restrictions in the Linux kernel when running multi-threaded; use the Subspace service instead.

func (*Spacemaker) Slog added in v0.7.0

func (s *Spacemaker) Slog() *slog.Logger

func (*Spacemaker) Subspace

func (s *Spacemaker) Subspace(req *api.SubspaceRequest) api.Response

Subspace creates either a new user or PID namespace, or both, and returns open file descriptors referencing them; additionally, it returns a file descriptor for a unix domain socket that is connected to a child Spacemaker service process.

type Spacer

type Spacer interface {
	Subspace(*api.SubspaceRequest) api.Response
	Room(*api.RoomsRequest) api.Response
	Slog() *slog.Logger
}

Spacer services the spacer API.

Directories

Path Synopsis
cmd
spacer-service command
Package main provides the command for running a spacer service as a separate process.
Package main provides the command for running a spacer service as a separate process.

Jump to

Keyboard shortcuts

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