ipc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyRunning indicates the IPC server has already been started.
	ErrAlreadyRunning = errors.New("ipc server is already running")

	// ErrShutdown indicates the server failed to cleanly shut down all resources.
	ErrShutdown = errors.New("ipc server shutdown encountered errors")
)

Functions

This section is empty.

Types

type Server

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

Server coordinates the local Unix domain socket IPC HTTP API for the Concord daemon. It bridges SDK client requests (such as submitting or stopping workloads) with Concord's persistent journal, materialized views, and cluster membership.

func NewServer

func NewServer(
	nodeID uuid.UUID,
	j journal.Journal,
	views []journalview.View,
	workloads *journalview.Workloads,
	peerService *peerdiscovery.MemberService,
	logger *zap.Logger,
	sampler *node.Sampler,
) *Server

NewServer constructs an unstarted IPC server instance.

func (*Server) Shutdown

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

Shutdown gracefully stops the HTTP server, closes the listener, and unlinks the Unix socket file.

func (*Server) Start

func (s *Server) Start(ctx context.Context, socketPath string) error

Start opens the Unix domain socket at socketPath and begins serving incoming IPC requests: 1. Resolves default socket path (~/.config/concord/concord.sock) if none provided. 2. Creates parent directories with 0700 permissions. 3. Cleans up any stale socket files from prior process runs. 4. Binds listener and restricts socket permissions to owner-only (0600). 5. Mounts REST handlers and starts serving HTTP in the background. 6. Listens on context cancellation for automatic graceful shutdown.

Jump to

Keyboard shortcuts

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