daemon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package daemon implements the kukeond process: it owns a controller.Exec, exposes the kukeonv1 API over a unix socket using net/rpc + jsonrpc, and manages its own lifecycle (listener, PID file, graceful shutdown).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
}

func NewController

func NewController() *Controller

func (*Controller) Restart

func (c *Controller) Restart() error

func (*Controller) Start

func (c *Controller) Start() error

func (*Controller) Status

func (c *Controller) Status() (apidaemon.Status, error)

func (*Controller) Stop

func (c *Controller) Stop() error

type DaemonFake

type DaemonFake struct{}

func NewDaemonFake

func NewDaemonFake() *DaemonFake

type KukeonV1Service

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

KukeonV1Service implements the net/rpc server methods for the KukeonV1 service. Each method always returns nil to net/rpc and carries structured errors inside the Reply envelope so errdefs sentinels survive the wire.

func NewKukeonV1Service

func NewKukeonV1Service(ctx context.Context, logger *slog.Logger, core kukeonv1.Client) *KukeonV1Service

NewKukeonV1Service constructs a service bound to the given kukeon Client. The service borrows the client; the caller owns its lifecycle.

func (*KukeonV1Service) ApplyDocuments

func (*KukeonV1Service) CreateCell

CreateCell is the net/rpc method for KukeonV1.CreateCell. net/rpc requires exported pointer-to-struct args and reply plus a single error return.

func (*KukeonV1Service) CreateContainer

func (s *KukeonV1Service) CreateContainer(
	args *kukeonv1.CreateContainerArgs,
	reply *kukeonv1.CreateContainerReply,
) error

CreateContainer is the net/rpc method for KukeonV1.CreateContainer.

func (*KukeonV1Service) CreateRealm

CreateRealm is the net/rpc method for KukeonV1.CreateRealm.

func (*KukeonV1Service) CreateSpace

CreateSpace is the net/rpc method for KukeonV1.CreateSpace.

func (*KukeonV1Service) CreateStack

CreateStack is the net/rpc method for KukeonV1.CreateStack.

func (*KukeonV1Service) DeleteCell

func (*KukeonV1Service) DeleteContainer

func (s *KukeonV1Service) DeleteContainer(
	args *kukeonv1.DeleteContainerArgs,
	reply *kukeonv1.DeleteContainerReply,
) error

func (*KukeonV1Service) DeleteRealm

func (*KukeonV1Service) DeleteSpace

func (*KukeonV1Service) DeleteStack

func (*KukeonV1Service) GetCell

func (s *KukeonV1Service) GetCell(args *kukeonv1.GetCellArgs, reply *kukeonv1.GetCellReply) error

func (*KukeonV1Service) GetContainer

func (*KukeonV1Service) GetRealm

func (s *KukeonV1Service) GetRealm(args *kukeonv1.GetRealmArgs, reply *kukeonv1.GetRealmReply) error

func (*KukeonV1Service) GetSpace

func (s *KukeonV1Service) GetSpace(args *kukeonv1.GetSpaceArgs, reply *kukeonv1.GetSpaceReply) error

func (*KukeonV1Service) GetStack

func (s *KukeonV1Service) GetStack(args *kukeonv1.GetStackArgs, reply *kukeonv1.GetStackReply) error

func (*KukeonV1Service) KillCell

func (s *KukeonV1Service) KillCell(args *kukeonv1.KillCellArgs, reply *kukeonv1.KillCellReply) error

func (*KukeonV1Service) KillContainer

func (*KukeonV1Service) ListCells

func (s *KukeonV1Service) ListCells(args *kukeonv1.ListCellsArgs, reply *kukeonv1.ListCellsReply) error

func (*KukeonV1Service) ListContainers

func (*KukeonV1Service) ListRealms

func (*KukeonV1Service) ListSpaces

func (*KukeonV1Service) ListStacks

func (*KukeonV1Service) Ping

Ping acks that the kukeonv1 RPC handler is serving and reports the daemon build version. Used by `kuke init` to wait until kukeond is ready.

func (*KukeonV1Service) PurgeCell

func (s *KukeonV1Service) PurgeCell(args *kukeonv1.PurgeCellArgs, reply *kukeonv1.PurgeCellReply) error

func (*KukeonV1Service) PurgeContainer

func (*KukeonV1Service) PurgeRealm

func (*KukeonV1Service) PurgeSpace

func (*KukeonV1Service) PurgeStack

func (*KukeonV1Service) RefreshAll

func (*KukeonV1Service) StartCell

func (s *KukeonV1Service) StartCell(args *kukeonv1.StartCellArgs, reply *kukeonv1.StartCellReply) error

func (*KukeonV1Service) StartContainer

func (*KukeonV1Service) StopCell

func (s *KukeonV1Service) StopCell(args *kukeonv1.StopCellArgs, reply *kukeonv1.StopCellReply) error

func (*KukeonV1Service) StopContainer

type Options

type Options struct {
	// SocketPath is the unix socket path the daemon listens on.
	SocketPath string
	// SocketMode is the file mode applied to the socket after creation.
	SocketMode os.FileMode
	// PIDFile, when non-empty, is written on Serve and removed on Stop.
	PIDFile string
	// Controller is forwarded to controller.NewControllerExec.
	Controller controller.Options
}

Options configures a Server.

type Server

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

Server hosts the kukeonv1 API over JSON-RPC on a unix socket.

func NewServer

func NewServer(ctx context.Context, logger *slog.Logger, opts Options) *Server

NewServer constructs a Server. It does not open the listener; call Serve.

func (*Server) Serve

func (s *Server) Serve() error

Serve opens the listener and accepts connections until Stop is called or the context is cancelled. Returns nil on graceful shutdown.

func (*Server) Stop

func (s *Server) Stop() error

Stop closes the listener, releases the controller, and removes the socket and PID file. Safe to call multiple times.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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