Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
Shutdown gracefully stops the HTTP server, closes the listener, and unlinks the Unix socket file.
func (*Server) Start ¶
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.