Documentation
¶
Overview ¶
Package kukeonv1 is the public client SDK for the kukeon daemon. It exposes a transport-agnostic Client interface; Dial picks a concrete implementation (unix socket JSON-RPC today, ssh tunnel in the future) based on the address scheme.
Index ¶
- Constants
- Variables
- func FromAPIError(e *APIError) error
- func KindFromError(err error) string
- type APIError
- type ApplyDocumentsArgs
- type ApplyDocumentsReply
- type ApplyDocumentsResult
- type ApplyResourceResult
- type AttachContainerArgs
- type AttachContainerReply
- type AttachContainerResult
- type Client
- type ContainerCreationOutcome
- type CreateCellArgs
- type CreateCellReply
- type CreateCellResult
- type CreateConfigArgs
- type CreateConfigReply
- type CreateConfigResult
- type CreateRealmArgs
- type CreateRealmReply
- type CreateRealmResult
- type CreateSecretArgs
- type CreateSecretReply
- type CreateSecretResult
- type CreateSpaceArgs
- type CreateSpaceReply
- type CreateSpaceResult
- type CreateStackArgs
- type CreateStackReply
- type CreateStackResult
- type DeleteBlueprintArgs
- type DeleteBlueprintReply
- type DeleteBlueprintResult
- type DeleteCellArgs
- type DeleteCellReply
- type DeleteCellResult
- type DeleteConfigArgs
- type DeleteConfigReply
- type DeleteConfigResult
- type DeleteDocumentsArgs
- type DeleteDocumentsReply
- type DeleteDocumentsResult
- type DeleteImageResult
- type DeleteRealmArgs
- type DeleteRealmReply
- type DeleteRealmResult
- type DeleteResourceResult
- type DeleteSecretArgs
- type DeleteSecretReply
- type DeleteSecretResult
- type DeleteSpaceArgs
- type DeleteSpaceReply
- type DeleteSpaceResult
- type DeleteStackArgs
- type DeleteStackReply
- type DeleteStackResult
- type FakeClient
- func (FakeClient) ApplyDocuments(context.Context, []byte) (ApplyDocumentsResult, error)
- func (FakeClient) ApplyDocumentsForTeam(context.Context, []byte, string) (ApplyDocumentsResult, error)
- func (FakeClient) AttachContainer(context.Context, v1beta1.ContainerDoc) (AttachContainerResult, error)
- func (FakeClient) Close() error
- func (FakeClient) CreateCell(context.Context, v1beta1.CellDoc) (CreateCellResult, error)
- func (FakeClient) CreateConfig(context.Context, v1beta1.CellConfigDoc) (CreateConfigResult, error)
- func (FakeClient) CreateRealm(context.Context, v1beta1.RealmDoc) (CreateRealmResult, error)
- func (FakeClient) CreateSecret(context.Context, v1beta1.SecretDoc) (CreateSecretResult, error)
- func (FakeClient) CreateSpace(context.Context, v1beta1.SpaceDoc) (CreateSpaceResult, error)
- func (FakeClient) CreateStack(context.Context, v1beta1.StackDoc) (CreateStackResult, error)
- func (FakeClient) DeleteBlueprint(context.Context, v1beta1.CellBlueprintDoc) (DeleteBlueprintResult, error)
- func (FakeClient) DeleteCell(context.Context, v1beta1.CellDoc) (DeleteCellResult, error)
- func (FakeClient) DeleteConfig(context.Context, v1beta1.CellConfigDoc) (DeleteConfigResult, error)
- func (FakeClient) DeleteDocuments(context.Context, []byte, bool, bool) (DeleteDocumentsResult, error)
- func (FakeClient) DeleteRealm(context.Context, v1beta1.RealmDoc, bool, bool) (DeleteRealmResult, error)
- func (FakeClient) DeleteSecret(context.Context, v1beta1.SecretDoc) (DeleteSecretResult, error)
- func (FakeClient) DeleteSpace(context.Context, v1beta1.SpaceDoc, bool, bool) (DeleteSpaceResult, error)
- func (FakeClient) DeleteStack(context.Context, v1beta1.StackDoc, bool, bool) (DeleteStackResult, error)
- func (FakeClient) GetBlueprint(context.Context, v1beta1.CellBlueprintDoc) (GetBlueprintResult, error)
- func (FakeClient) GetCell(context.Context, v1beta1.CellDoc) (GetCellResult, error)
- func (FakeClient) GetConfig(context.Context, v1beta1.CellConfigDoc) (GetConfigResult, error)
- func (FakeClient) GetContainer(context.Context, v1beta1.ContainerDoc) (GetContainerResult, error)
- func (FakeClient) GetRealm(context.Context, v1beta1.RealmDoc) (GetRealmResult, error)
- func (FakeClient) GetSecret(context.Context, v1beta1.SecretDoc) (GetSecretResult, error)
- func (FakeClient) GetSpace(context.Context, v1beta1.SpaceDoc) (GetSpaceResult, error)
- func (FakeClient) GetStack(context.Context, v1beta1.StackDoc) (GetStackResult, error)
- func (FakeClient) KillCell(context.Context, v1beta1.CellDoc) (KillCellResult, error)
- func (FakeClient) ListBlueprints(context.Context, string, string, string) ([]v1beta1.CellBlueprintDoc, error)
- func (FakeClient) ListCells(context.Context, string, string, string) ([]v1beta1.CellDoc, error)
- func (FakeClient) ListConfigs(context.Context, string, string, string) ([]v1beta1.CellConfigDoc, error)
- func (FakeClient) ListContainers(context.Context, string, string, string, string) ([]v1beta1.ContainerSpec, error)
- func (FakeClient) ListRealms(context.Context) ([]v1beta1.RealmDoc, error)
- func (FakeClient) ListSecrets(context.Context, string, string, string, string) ([]v1beta1.SecretDoc, error)
- func (FakeClient) ListSpaces(context.Context, string) ([]v1beta1.SpaceDoc, error)
- func (FakeClient) ListStacks(context.Context, string, string) ([]v1beta1.StackDoc, error)
- func (FakeClient) LogContainer(context.Context, v1beta1.ContainerDoc) (LogContainerResult, error)
- func (FakeClient) MaterializeCell(context.Context, v1beta1.CellDoc) (CreateCellResult, error)
- func (FakeClient) Ping(context.Context) error
- func (FakeClient) PingVersion(context.Context) (string, error)
- func (FakeClient) PurgeCell(context.Context, v1beta1.CellDoc, bool, bool) (PurgeCellResult, error)
- func (FakeClient) PurgeRealm(context.Context, v1beta1.RealmDoc, bool, bool) (PurgeRealmResult, error)
- func (FakeClient) PurgeSpace(context.Context, v1beta1.SpaceDoc, bool, bool) (PurgeSpaceResult, error)
- func (FakeClient) PurgeStack(context.Context, v1beta1.StackDoc, bool, bool) (PurgeStackResult, error)
- func (FakeClient) RefreshAll(context.Context) (RefreshAllResult, error)
- func (FakeClient) StartCell(context.Context, v1beta1.CellDoc) (StartCellResult, error)
- func (FakeClient) StopCell(context.Context, v1beta1.CellDoc) (StopCellResult, error)
- type GetBlueprintArgs
- type GetBlueprintReply
- type GetBlueprintResult
- type GetCellArgs
- type GetCellReply
- type GetCellResult
- type GetConfigArgs
- type GetConfigReply
- type GetConfigResult
- type GetContainerArgs
- type GetContainerReply
- type GetContainerResult
- type GetImageResult
- type GetRealmArgs
- type GetRealmReply
- type GetRealmResult
- type GetSecretArgs
- type GetSecretReply
- type GetSecretResult
- type GetSpaceArgs
- type GetSpaceReply
- type GetSpaceResult
- type GetStackArgs
- type GetStackReply
- type GetStackResult
- type ImageInfo
- type KillCellArgs
- type KillCellReply
- type KillCellResult
- type ListBlueprintsArgs
- type ListBlueprintsReply
- type ListCellsArgs
- type ListCellsReply
- type ListConfigsArgs
- type ListConfigsReply
- type ListContainersArgs
- type ListContainersReply
- type ListImagesResult
- type ListRealmsArgs
- type ListRealmsReply
- type ListSecretsArgs
- type ListSecretsReply
- type ListSpacesArgs
- type ListSpacesReply
- type ListStacksArgs
- type ListStacksReply
- type LoadImageResult
- type LogContainerArgs
- type LogContainerReply
- type LogContainerResult
- type MaterializeCellArgs
- type MaterializeCellReply
- type PingArgs
- type PingReply
- type PruneImagesResult
- type PurgeCellArgs
- type PurgeCellReply
- type PurgeCellResult
- type PurgeRealmArgs
- type PurgeRealmReply
- type PurgeRealmResult
- type PurgeSpaceArgs
- type PurgeSpaceReply
- type PurgeSpaceResult
- type PurgeStackArgs
- type PurgeStackReply
- type PurgeStackResult
- type RefreshAllArgs
- type RefreshAllReply
- type RefreshAllResult
- type StartCellArgs
- type StartCellReply
- type StartCellResult
- type StopCellArgs
- type StopCellReply
- type StopCellResult
- type UnixClient
- func (c *UnixClient) ApplyDocuments(ctx context.Context, rawYAML []byte) (ApplyDocumentsResult, error)
- func (c *UnixClient) ApplyDocumentsForTeam(ctx context.Context, rawYAML []byte, team string) (ApplyDocumentsResult, error)
- func (c *UnixClient) AttachContainer(ctx context.Context, doc v1beta1.ContainerDoc) (AttachContainerResult, error)
- func (c *UnixClient) Close() error
- func (c *UnixClient) CreateCell(ctx context.Context, doc v1beta1.CellDoc) (CreateCellResult, error)
- func (c *UnixClient) CreateConfig(ctx context.Context, doc v1beta1.CellConfigDoc) (CreateConfigResult, error)
- func (c *UnixClient) CreateRealm(ctx context.Context, doc v1beta1.RealmDoc) (CreateRealmResult, error)
- func (c *UnixClient) CreateSecret(ctx context.Context, doc v1beta1.SecretDoc) (CreateSecretResult, error)
- func (c *UnixClient) CreateSpace(ctx context.Context, doc v1beta1.SpaceDoc) (CreateSpaceResult, error)
- func (c *UnixClient) CreateStack(ctx context.Context, doc v1beta1.StackDoc) (CreateStackResult, error)
- func (c *UnixClient) DeleteBlueprint(ctx context.Context, doc v1beta1.CellBlueprintDoc) (DeleteBlueprintResult, error)
- func (c *UnixClient) DeleteCell(ctx context.Context, doc v1beta1.CellDoc) (DeleteCellResult, error)
- func (c *UnixClient) DeleteConfig(ctx context.Context, doc v1beta1.CellConfigDoc) (DeleteConfigResult, error)
- func (c *UnixClient) DeleteDocuments(ctx context.Context, rawYAML []byte, cascade, force bool) (DeleteDocumentsResult, error)
- func (c *UnixClient) DeleteRealm(ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool) (DeleteRealmResult, error)
- func (c *UnixClient) DeleteSecret(ctx context.Context, doc v1beta1.SecretDoc) (DeleteSecretResult, error)
- func (c *UnixClient) DeleteSpace(ctx context.Context, doc v1beta1.SpaceDoc, force, cascade bool) (DeleteSpaceResult, error)
- func (c *UnixClient) DeleteStack(ctx context.Context, doc v1beta1.StackDoc, force, cascade bool) (DeleteStackResult, error)
- func (c *UnixClient) GetBlueprint(ctx context.Context, doc v1beta1.CellBlueprintDoc) (GetBlueprintResult, error)
- func (c *UnixClient) GetCell(ctx context.Context, doc v1beta1.CellDoc) (GetCellResult, error)
- func (c *UnixClient) GetConfig(ctx context.Context, doc v1beta1.CellConfigDoc) (GetConfigResult, error)
- func (c *UnixClient) GetContainer(ctx context.Context, doc v1beta1.ContainerDoc) (GetContainerResult, error)
- func (c *UnixClient) GetRealm(ctx context.Context, doc v1beta1.RealmDoc) (GetRealmResult, error)
- func (c *UnixClient) GetSecret(ctx context.Context, doc v1beta1.SecretDoc) (GetSecretResult, error)
- func (c *UnixClient) GetSpace(ctx context.Context, doc v1beta1.SpaceDoc) (GetSpaceResult, error)
- func (c *UnixClient) GetStack(ctx context.Context, doc v1beta1.StackDoc) (GetStackResult, error)
- func (c *UnixClient) KillCell(ctx context.Context, doc v1beta1.CellDoc) (KillCellResult, error)
- func (c *UnixClient) ListBlueprints(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellBlueprintDoc, error)
- func (c *UnixClient) ListCells(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellDoc, error)
- func (c *UnixClient) ListConfigs(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellConfigDoc, error)
- func (c *UnixClient) ListContainers(ctx context.Context, realmName, spaceName, stackName, cellName string) ([]v1beta1.ContainerSpec, error)
- func (c *UnixClient) ListRealms(ctx context.Context) ([]v1beta1.RealmDoc, error)
- func (c *UnixClient) ListSecrets(ctx context.Context, realmName, spaceName, stackName, cellName string) ([]v1beta1.SecretDoc, error)
- func (c *UnixClient) ListSpaces(ctx context.Context, realmName string) ([]v1beta1.SpaceDoc, error)
- func (c *UnixClient) ListStacks(ctx context.Context, realmName, spaceName string) ([]v1beta1.StackDoc, error)
- func (c *UnixClient) LogContainer(ctx context.Context, doc v1beta1.ContainerDoc) (LogContainerResult, error)
- func (c *UnixClient) MaterializeCell(ctx context.Context, doc v1beta1.CellDoc) (CreateCellResult, error)
- func (c *UnixClient) Ping(ctx context.Context) error
- func (c *UnixClient) PingVersion(ctx context.Context) (string, error)
- func (c *UnixClient) PurgeCell(ctx context.Context, doc v1beta1.CellDoc, force, cascade bool) (PurgeCellResult, error)
- func (c *UnixClient) PurgeRealm(ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool) (PurgeRealmResult, error)
- func (c *UnixClient) PurgeSpace(ctx context.Context, doc v1beta1.SpaceDoc, force, cascade bool) (PurgeSpaceResult, error)
- func (c *UnixClient) PurgeStack(ctx context.Context, doc v1beta1.StackDoc, force, cascade bool) (PurgeStackResult, error)
- func (c *UnixClient) RefreshAll(ctx context.Context) (RefreshAllResult, error)
- func (c *UnixClient) StartCell(ctx context.Context, doc v1beta1.CellDoc) (StartCellResult, error)
- func (c *UnixClient) StopCell(ctx context.Context, doc v1beta1.CellDoc) (StopCellResult, error)
- type UnixOption
Constants ¶
const ( MethodCreateRealm = ServiceName + ".CreateRealm" MethodCreateSpace = ServiceName + ".CreateSpace" MethodCreateStack = ServiceName + ".CreateStack" MethodCreateCell = ServiceName + ".CreateCell" MethodMaterializeCell = ServiceName + ".MaterializeCell" MethodCreateConfig = ServiceName + ".CreateConfig" MethodCreateSecret = ServiceName + ".CreateSecret" MethodGetRealm = ServiceName + ".GetRealm" MethodGetSpace = ServiceName + ".GetSpace" MethodGetStack = ServiceName + ".GetStack" MethodGetCell = ServiceName + ".GetCell" MethodGetContainer = ServiceName + ".GetContainer" MethodGetSecret = ServiceName + ".GetSecret" MethodGetBlueprint = ServiceName + ".GetBlueprint" MethodGetConfig = ServiceName + ".GetConfig" MethodListRealms = ServiceName + ".ListRealms" MethodListSpaces = ServiceName + ".ListSpaces" MethodListStacks = ServiceName + ".ListStacks" MethodListCells = ServiceName + ".ListCells" MethodListContainers = ServiceName + ".ListContainers" MethodListSecrets = ServiceName + ".ListSecrets" MethodListBlueprints = ServiceName + ".ListBlueprints" MethodListConfigs = ServiceName + ".ListConfigs" MethodStartCell = ServiceName + ".StartCell" MethodAttachContainer = ServiceName + ".AttachContainer" MethodLogContainer = ServiceName + ".LogContainer" MethodStopCell = ServiceName + ".StopCell" MethodKillCell = ServiceName + ".KillCell" MethodDeleteRealm = ServiceName + ".DeleteRealm" MethodDeleteSpace = ServiceName + ".DeleteSpace" MethodDeleteStack = ServiceName + ".DeleteStack" MethodDeleteCell = ServiceName + ".DeleteCell" MethodDeleteSecret = ServiceName + ".DeleteSecret" MethodDeleteBlueprint = ServiceName + ".DeleteBlueprint" MethodDeleteConfig = ServiceName + ".DeleteConfig" MethodPurgeRealm = ServiceName + ".PurgeRealm" MethodPurgeSpace = ServiceName + ".PurgeSpace" MethodPurgeStack = ServiceName + ".PurgeStack" MethodPurgeCell = ServiceName + ".PurgeCell" MethodRefreshAll = ServiceName + ".RefreshAll" MethodApplyDocuments = ServiceName + ".ApplyDocuments" MethodDeleteDocuments = ServiceName + ".DeleteDocuments" MethodPing = ServiceName + ".Ping" )
Fully-qualified method names used on the wire.
const ServiceName = "KukeonV1"
ServiceName is the net/rpc service name registered by the daemon. The "V1" suffix is the wire version prefix; breaking changes land on "KukeonV2".
Variables ¶
var ErrUnexpectedCall = errors.New("unexpected kukeonv1 client call")
ErrUnexpectedCall is returned by FakeClient methods that have not been overridden by the test. Tests that want to assert "this method was not called" can match on errors.Is(err, ErrUnexpectedCall).
var ErrUnsupportedScheme = errors.New("unsupported kukeon host scheme")
ErrUnsupportedScheme is returned by Dial when the address scheme cannot be served by any compiled-in transport.
Functions ¶
func FromAPIError ¶
FromAPIError reconstructs a Go error that unwraps to the matching errdefs sentinel when the Kind is recognized, so callers can use errors.Is. The error's Error() returns the verbatim wire Message (no prefix added): the server already embeds the sentinel in the message via %w wrapping, and we don't want to stutter "failed to X: failed to X: ...".
func KindFromError ¶
KindFromError inspects err and returns the best-matching wire Kind, falling back to "Unknown" when nothing registered matches.
Types ¶
type APIError ¶
APIError is a serializable error. Kind identifies the error class; client code maps it back to an errdefs.* sentinel so that errors.Is(err, errdefs.X) keeps working across the wire.
func ToAPIError ¶
ToAPIError converts a Go error into a wire APIError. Returns nil for nil.
type ApplyDocumentsArgs ¶
ApplyDocumentsArgs carries a raw multi-document YAML blob. The server parses and validates; validation errors are returned in the Reply.Err.
Team, when non-empty, switches the apply into per-team prune mode (issue #1027): every applied CellBlueprint / CellConfig has its `metadata.labels[kukeon.io/team]` set to Team before persistence, and after the apply loop the daemon enumerates daemon-stored Blueprint / Config objects carrying `kukeon.io/team=<Team>` and deletes those not in the applied set. The empty-string default preserves the historical no-team, no-prune `kuke apply -f` behavior.
type ApplyDocumentsReply ¶
type ApplyDocumentsReply struct {
Result ApplyDocumentsResult
Err *APIError
}
type ApplyDocumentsResult ¶
type ApplyDocumentsResult struct {
Resources []ApplyResourceResult
}
type ApplyResourceResult ¶
type ApplyResourceResult struct {
Index int `json:"index" yaml:"index"`
Kind string `json:"kind" yaml:"kind"`
Name string `json:"name" yaml:"name"`
Action string `json:"action" yaml:"action"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
Changes []string `json:"changes,omitempty" yaml:"changes,omitempty"`
Details map[string]string `json:"details,omitempty" yaml:"details,omitempty"`
}
ApplyResourceResult is the per-resource outcome of an ApplyDocuments call. JSON/YAML tags preserve the lowercase `kuke apply -f -o json` shape that matches the sibling `kuke delete -f -o json` contract on DeleteResourceResult (the wire is gob and ignores these tags).
type AttachContainerArgs ¶ added in v0.2.0
type AttachContainerArgs struct {
Doc v1beta1.ContainerDoc
}
AttachContainerArgs identifies the target container for an attach request.
type AttachContainerReply ¶ added in v0.2.0
type AttachContainerReply struct {
Result AttachContainerResult
Err *APIError
}
type AttachContainerResult ¶ added in v0.2.0
type AttachContainerResult struct {
// HostSocketPath is the host path of the per-container sbsh terminal
// socket. Inside the container the same inode is reachable at
// /run/kukeon/tty/socket via the tty directory bind mount. Returned only
// when the target container has Attachable=true and its task is Running;
// the daemon errors with ErrAttachNotSupported when the target is not
// Attachable, or ErrAttachTaskNotRunning when the task is not Running.
HostSocketPath string
}
AttachContainerResult carries the host-side coordinates the `kuke attach` client needs to drive the sbsh terminal. Bytes never traverse this RPC — the client opens HostSocketPath directly.
type Client ¶
type Client interface {
io.Closer
CreateRealm(ctx context.Context, doc v1beta1.RealmDoc) (CreateRealmResult, error)
CreateSpace(ctx context.Context, doc v1beta1.SpaceDoc) (CreateSpaceResult, error)
CreateStack(ctx context.Context, doc v1beta1.StackDoc) (CreateStackResult, error)
CreateCell(ctx context.Context, doc v1beta1.CellDoc) (CreateCellResult, error)
// MaterializeCell creates a cell record (or ensures an existing cell's
// resources exist) without starting any container tasks (#818). The
// resulting cell is left stopped; the operator runs `kuke start <name>`
// to start it. Distinct from CreateCell (which always starts) — used by
// `kuke create cell --from-blueprint` / `--from-config` for the
// materialise-but-don't-start scaffolding modes. Result shape matches
// CreateCell so the same printer renders the outcome (Started will be
// false because the start step was skipped).
MaterializeCell(ctx context.Context, doc v1beta1.CellDoc) (CreateCellResult, error)
// CreateConfig atomically persists a new CellConfig document under
// create-only semantics (issue #839): the daemon-side write fails with
// errdefs.ErrConfigExists if a Config of the same name already lives in
// scope. This is the create-or-fail sibling of ApplyDocuments — used by
// `kuke create config` and any future client that needs "first writer
// wins" rather than the write-through apply path. The same scope /
// blueprint / slot-fill validation as ApplyDocuments runs first — the
// only difference is the atomic gate (which ApplyDocuments doesn't need,
// since apply is intentionally write-through).
CreateConfig(ctx context.Context, doc v1beta1.CellConfigDoc) (CreateConfigResult, error)
// CreateSecret persists a new Secret document to daemon storage. The
// write is create-or-overwrite (the daemon's runner.WriteSecret is
// write-through). The resulting SecretDoc is metadata-only (Spec.Data
// is never echoed back).
CreateSecret(ctx context.Context, doc v1beta1.SecretDoc) (CreateSecretResult, error)
GetRealm(ctx context.Context, doc v1beta1.RealmDoc) (GetRealmResult, error)
GetSpace(ctx context.Context, doc v1beta1.SpaceDoc) (GetSpaceResult, error)
GetStack(ctx context.Context, doc v1beta1.StackDoc) (GetStackResult, error)
GetCell(ctx context.Context, doc v1beta1.CellDoc) (GetCellResult, error)
GetContainer(ctx context.Context, doc v1beta1.ContainerDoc) (GetContainerResult, error)
// GetSecret reports the metadata-only view of a single named, scoped
// `kind: Secret` (issue #622). Spec.data is never echoed — the bytes do
// not traverse this RPC by design (#619).
GetSecret(ctx context.Context, doc v1beta1.SecretDoc) (GetSecretResult, error)
// GetBlueprint reads one named, scoped `kind: CellBlueprint`'s full
// document from daemon storage (issue #620). Unlike GetSecret the whole
// document is returned — a blueprint carries only template references —
// so `kuke run -b` can materialize it. The input doc carries the name and
// scope coordinates only; the spec is ignored.
GetBlueprint(ctx context.Context, doc v1beta1.CellBlueprintDoc) (GetBlueprintResult, error)
// GetConfig reads one named, scoped `kind: CellConfig`'s full document
// from daemon storage (issue #644). Like GetBlueprint the whole document
// is returned — a Config carries no credential bytes — so the blueprint
// ref, values, and slot fills surface to `kuke get config`. The input doc
// carries the name and scope coordinates only; the spec is ignored.
GetConfig(ctx context.Context, doc v1beta1.CellConfigDoc) (GetConfigResult, error)
ListRealms(ctx context.Context) ([]v1beta1.RealmDoc, error)
ListSpaces(ctx context.Context, realmName string) ([]v1beta1.SpaceDoc, error)
ListStacks(ctx context.Context, realmName, spaceName string) ([]v1beta1.StackDoc, error)
ListCells(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellDoc, error)
ListContainers(
ctx context.Context,
realmName, spaceName, stackName, cellName string,
) ([]v1beta1.ContainerSpec, error)
// ListSecrets enumerates the metadata of every Secret bound to the
// filter scope or any scope nested within it (issue #622). An empty
// realmName lists across all realms. spec.data is never echoed.
ListSecrets(ctx context.Context, realmName, spaceName, stackName, cellName string) ([]v1beta1.SecretDoc, error)
// ListBlueprints enumerates the metadata of every CellBlueprint bound to
// the filter scope or any scope nested within it (issue #643). An empty
// realmName lists across all realms. A Blueprint is never cell-scoped, so
// there is no cell coordinate. The spec is not populated for a list.
ListBlueprints(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellBlueprintDoc, error)
// ListConfigs enumerates the metadata of every CellConfig bound to the
// filter scope or any scope nested within it (issue #644). An empty
// realmName lists across all realms. A Config is never cell-scoped, so
// there is no cell coordinate. The spec is not populated for a list.
ListConfigs(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellConfigDoc, error)
StartCell(ctx context.Context, doc v1beta1.CellDoc) (StartCellResult, error)
// AttachContainer is the placeholder endpoint shipped in #57. It only
// validates that the target container has Attachable=true; the
// terminal-bridge client lands in #66.
AttachContainer(ctx context.Context, doc v1beta1.ContainerDoc) (AttachContainerResult, error)
// LogContainer validates that the target container has Attachable=true
// and resolves the host-side path of the per-container sbsh capture
// file. Bytes never traverse this RPC — the caller (`kuke log`) reads
// the file directly. Same Attachable gate as AttachContainer: only
// containers wrapped by sbsh have a capture file to surface.
LogContainer(ctx context.Context, doc v1beta1.ContainerDoc) (LogContainerResult, error)
StopCell(ctx context.Context, doc v1beta1.CellDoc) (StopCellResult, error)
KillCell(ctx context.Context, doc v1beta1.CellDoc) (KillCellResult, error)
DeleteRealm(ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool) (DeleteRealmResult, error)
DeleteSpace(ctx context.Context, doc v1beta1.SpaceDoc, force, cascade bool) (DeleteSpaceResult, error)
DeleteStack(ctx context.Context, doc v1beta1.StackDoc, force, cascade bool) (DeleteStackResult, error)
DeleteCell(ctx context.Context, doc v1beta1.CellDoc) (DeleteCellResult, error)
// DeleteSecret removes a single named, scoped Secret's daemon-stored
// file (issue #622). The live-reference safety gate ships in phase 3c.
DeleteSecret(ctx context.Context, doc v1beta1.SecretDoc) (DeleteSecretResult, error)
// DeleteBlueprint removes a single named, scoped CellBlueprint's
// daemon-stored document (issue #643). No live-reference gate: cells
// materialized from a blueprint are independent copies (#620).
DeleteBlueprint(ctx context.Context, doc v1beta1.CellBlueprintDoc) (DeleteBlueprintResult, error)
// DeleteConfig removes a single named, scoped CellConfig's daemon-stored
// document (issue #644). No live-reference gate: deleting a Config never
// deletes the cell it materialized. The result reports any live cells that
// still carry the back-reference label so the caller can emit a notice.
DeleteConfig(ctx context.Context, doc v1beta1.CellConfigDoc) (DeleteConfigResult, error)
PurgeRealm(ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool) (PurgeRealmResult, error)
PurgeSpace(ctx context.Context, doc v1beta1.SpaceDoc, force, cascade bool) (PurgeSpaceResult, error)
PurgeStack(ctx context.Context, doc v1beta1.StackDoc, force, cascade bool) (PurgeStackResult, error)
PurgeCell(ctx context.Context, doc v1beta1.CellDoc, force, cascade bool) (PurgeCellResult, error)
RefreshAll(ctx context.Context) (RefreshAllResult, error)
ApplyDocuments(ctx context.Context, rawYAML []byte) (ApplyDocumentsResult, error)
// ApplyDocumentsForTeam is the per-team prune-apply sibling of
// ApplyDocuments (issue #1027). It stamps every applied CellBlueprint /
// CellConfig with `kukeon.io/team=<team>` and, after the apply loop,
// deletes daemon-stored Blueprint / Config objects carrying the same
// team label that the applied set did not include. Used by `kuke team
// init` (#796) to make project rosters converge: re-running on a
// shrunken roster prunes the orphans without touching other teams or
// running cells (deleting a Blueprint or Config never deletes the cell
// materialized from it). Empty team is rejected — use ApplyDocuments
// for the no-team path.
ApplyDocumentsForTeam(ctx context.Context, rawYAML []byte, team string) (ApplyDocumentsResult, error)
// DeleteDocuments is the file-driven counterpart to ApplyDocuments —
// `kuke delete -f` sends the raw YAML over the wire so deletes honor
// `--host` routing the same way applies do. Per-resource cascade/force
// semantics match the single-kind Delete{Realm,Space,Stack} methods.
DeleteDocuments(ctx context.Context, rawYAML []byte, cascade, force bool) (DeleteDocumentsResult, error)
Ping(ctx context.Context) error
// PingVersion is the Ping sibling that surfaces the daemon's reported
// build version alongside the ack. `kuke status` uses it to render the
// daemon row; the in-process client returns the current process's
// version (config.Version), so the value is well-defined on both
// transports. New callers preferring the existing ack-only contract
// stay on Ping.
PingVersion(ctx context.Context) (string, error)
}
Client is the transport-agnostic interface for programmatic access to kukeon primitives. All wire types are drawn from pkg/api/model/v1beta1.
type CreateCellArgs ¶
CreateCellArgs is the wire request for CreateCell.
type CreateCellReply ¶
type CreateCellReply struct {
Result CreateCellResult
Err *APIError
}
CreateCellReply is the wire response for CreateCell. Err is non-nil on failure so structured errdefs.* sentinels survive the wire roundtrip.
type CreateCellResult ¶
type CreateCellResult struct {
Cell v1beta1.CellDoc
MetadataExistsPre bool
MetadataExistsPost bool
CgroupExistsPre bool
CgroupExistsPost bool
CgroupCreated bool
RootContainerExistsPre bool
RootContainerExistsPost bool
RootContainerCreated bool
StartedPre bool
StartedPost bool
Started bool
Created bool
Containers []ContainerCreationOutcome
}
CreateCellResult mirrors internal/controller.CreateCellResult using external v1beta1 types, so it is safe to serialize and return to non-privileged callers.
type CreateConfigArgs ¶ added in v0.6.0
type CreateConfigArgs struct {
Doc v1beta1.CellConfigDoc
}
CreateConfigArgs is the wire request for CreateConfig (issue #839). The document carries the candidate CellConfig the daemon writes atomically.
type CreateConfigReply ¶ added in v0.6.0
type CreateConfigReply struct {
Result CreateConfigResult
Err *APIError
}
CreateConfigReply is the wire response for CreateConfig. Err is non-nil on failure so the errdefs.ErrConfigExists sentinel survives the wire roundtrip — the CLI's gap-fill counter loop reads it to retry.
type CreateConfigResult ¶ added in v0.6.0
type CreateConfigResult struct {
Config v1beta1.CellConfigDoc
Created bool
}
CreateConfigResult reports the outcome of an atomic create-only CellConfig write (issue #839). Created mirrors the daemon-side flag; Config is the persisted document echoed back so the CLI can chain into the cell-start path without re-issuing GetConfig.
type CreateRealmArgs ¶
type CreateRealmReply ¶
type CreateRealmReply struct {
Result CreateRealmResult
Err *APIError
}
type CreateRealmResult ¶
type CreateSecretArgs ¶ added in v0.6.0
CreateSecretArgs is the wire request for CreateSecret.
type CreateSecretReply ¶ added in v0.6.0
type CreateSecretReply struct {
Result CreateSecretResult
Err *APIError
}
CreateSecretReply is the wire response for CreateSecret.
type CreateSecretResult ¶ added in v0.6.0
CreateSecretResult reports the outcome of a Secret write.
type CreateSpaceArgs ¶
type CreateSpaceReply ¶
type CreateSpaceReply struct {
Result CreateSpaceResult
Err *APIError
}
type CreateSpaceResult ¶
type CreateStackArgs ¶
type CreateStackReply ¶
type CreateStackReply struct {
Result CreateStackResult
Err *APIError
}
type CreateStackResult ¶
type DeleteBlueprintArgs ¶ added in v0.6.0
type DeleteBlueprintArgs struct {
Doc v1beta1.CellBlueprintDoc
}
type DeleteBlueprintReply ¶ added in v0.6.0
type DeleteBlueprintReply struct {
Result DeleteBlueprintResult
Err *APIError
}
type DeleteBlueprintResult ¶ added in v0.6.0
type DeleteBlueprintResult struct {
Blueprint v1beta1.CellBlueprintDoc
Deleted bool
}
DeleteBlueprintResult reports the removed Blueprint (metadata only) and whether the file existed to delete.
type DeleteCellArgs ¶
type DeleteCellReply ¶
type DeleteCellReply struct {
Result DeleteCellResult
Err *APIError
}
type DeleteCellResult ¶
type DeleteConfigArgs ¶ added in v0.6.0
type DeleteConfigArgs struct {
Doc v1beta1.CellConfigDoc
}
type DeleteConfigReply ¶ added in v0.6.0
type DeleteConfigReply struct {
Result DeleteConfigResult
Err *APIError
}
type DeleteConfigResult ¶ added in v0.6.0
type DeleteConfigResult struct {
Config v1beta1.CellConfigDoc
Deleted bool
BackRefCells []string
}
DeleteConfigResult reports the removed Config (metadata only), whether the file existed to delete, and the scope paths of any live cells that still carry the kukeon.io/config back-reference label (issue #644). BackRefCells is informational — deleting a Config never deletes the cell it materialized — so the CLI surfaces a one-line notice pointing at `kuke delete cell <name>`.
type DeleteDocumentsArgs ¶ added in v0.6.0
DeleteDocumentsArgs carries a raw multi-document YAML blob plus the same cascade/force flags exposed on `kuke delete -f`. The server parses and validates; validation errors are returned in the Reply.Err.
type DeleteDocumentsReply ¶ added in v0.6.0
type DeleteDocumentsReply struct {
Result DeleteDocumentsResult
Err *APIError
}
type DeleteDocumentsResult ¶ added in v0.6.0
type DeleteDocumentsResult struct {
Resources []DeleteResourceResult
}
type DeleteImageResult ¶ added in v0.3.0
DeleteImageResult reports the outcome of a `kuke image delete` removal.
type DeleteRealmReply ¶
type DeleteRealmReply struct {
Result DeleteRealmResult
Err *APIError
}
type DeleteRealmResult ¶
type DeleteResourceResult ¶ added in v0.6.0
type DeleteResourceResult struct {
Index int `json:"index" yaml:"index"`
Kind string `json:"kind" yaml:"kind"`
Name string `json:"name" yaml:"name"`
Action string `json:"action" yaml:"action"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
Cascaded []string `json:"cascaded,omitempty" yaml:"cascaded,omitempty"`
Details map[string]string `json:"details,omitempty" yaml:"details,omitempty"`
}
DeleteResourceResult is the per-resource outcome of a DeleteDocuments call. JSON/YAML tags preserve the lowercase `kuke delete -f -o json` shape that previously came from internal/controller.ResourceDeleteResult's custom marshalers (the wire is gob and ignores these tags).
type DeleteSecretArgs ¶ added in v0.6.0
type DeleteSecretReply ¶ added in v0.6.0
type DeleteSecretReply struct {
Result DeleteSecretResult
Err *APIError
}
type DeleteSecretResult ¶ added in v0.6.0
DeleteSecretResult reports the removed Secret (metadata only) and whether the file existed to delete.
type DeleteSpaceReply ¶
type DeleteSpaceReply struct {
Result DeleteSpaceResult
Err *APIError
}
type DeleteSpaceResult ¶
type DeleteStackReply ¶
type DeleteStackReply struct {
Result DeleteStackResult
Err *APIError
}
type DeleteStackResult ¶
type FakeClient ¶
type FakeClient struct{}
FakeClient is a Client with every method returning ErrUnexpectedCall. Embed it into a per-test fake and override only the methods under test. Close() is a no-op so deferred client.Close() calls never fail.
func (FakeClient) ApplyDocuments ¶
func (FakeClient) ApplyDocuments(context.Context, []byte) (ApplyDocumentsResult, error)
func (FakeClient) ApplyDocumentsForTeam ¶ added in v0.6.0
func (FakeClient) ApplyDocumentsForTeam( context.Context, []byte, string, ) (ApplyDocumentsResult, error)
func (FakeClient) AttachContainer ¶ added in v0.2.0
func (FakeClient) AttachContainer(context.Context, v1beta1.ContainerDoc) (AttachContainerResult, error)
func (FakeClient) Close ¶
func (FakeClient) Close() error
func (FakeClient) CreateCell ¶
func (FakeClient) CreateCell(context.Context, v1beta1.CellDoc) (CreateCellResult, error)
func (FakeClient) CreateConfig ¶ added in v0.6.0
func (FakeClient) CreateConfig(context.Context, v1beta1.CellConfigDoc) (CreateConfigResult, error)
func (FakeClient) CreateRealm ¶
func (FakeClient) CreateRealm(context.Context, v1beta1.RealmDoc) (CreateRealmResult, error)
func (FakeClient) CreateSecret ¶ added in v0.6.0
func (FakeClient) CreateSecret(context.Context, v1beta1.SecretDoc) (CreateSecretResult, error)
func (FakeClient) CreateSpace ¶
func (FakeClient) CreateSpace(context.Context, v1beta1.SpaceDoc) (CreateSpaceResult, error)
func (FakeClient) CreateStack ¶
func (FakeClient) CreateStack(context.Context, v1beta1.StackDoc) (CreateStackResult, error)
func (FakeClient) DeleteBlueprint ¶ added in v0.6.0
func (FakeClient) DeleteBlueprint(context.Context, v1beta1.CellBlueprintDoc) (DeleteBlueprintResult, error)
func (FakeClient) DeleteCell ¶
func (FakeClient) DeleteCell(context.Context, v1beta1.CellDoc) (DeleteCellResult, error)
func (FakeClient) DeleteConfig ¶ added in v0.6.0
func (FakeClient) DeleteConfig(context.Context, v1beta1.CellConfigDoc) (DeleteConfigResult, error)
func (FakeClient) DeleteDocuments ¶ added in v0.6.0
func (FakeClient) DeleteDocuments(context.Context, []byte, bool, bool) (DeleteDocumentsResult, error)
func (FakeClient) DeleteRealm ¶
func (FakeClient) DeleteRealm(context.Context, v1beta1.RealmDoc, bool, bool) (DeleteRealmResult, error)
func (FakeClient) DeleteSecret ¶ added in v0.6.0
func (FakeClient) DeleteSecret(context.Context, v1beta1.SecretDoc) (DeleteSecretResult, error)
func (FakeClient) DeleteSpace ¶
func (FakeClient) DeleteSpace(context.Context, v1beta1.SpaceDoc, bool, bool) (DeleteSpaceResult, error)
func (FakeClient) DeleteStack ¶
func (FakeClient) DeleteStack(context.Context, v1beta1.StackDoc, bool, bool) (DeleteStackResult, error)
func (FakeClient) GetBlueprint ¶ added in v0.6.0
func (FakeClient) GetBlueprint(context.Context, v1beta1.CellBlueprintDoc) (GetBlueprintResult, error)
func (FakeClient) GetCell ¶
func (FakeClient) GetCell(context.Context, v1beta1.CellDoc) (GetCellResult, error)
func (FakeClient) GetConfig ¶ added in v0.6.0
func (FakeClient) GetConfig(context.Context, v1beta1.CellConfigDoc) (GetConfigResult, error)
func (FakeClient) GetContainer ¶
func (FakeClient) GetContainer(context.Context, v1beta1.ContainerDoc) (GetContainerResult, error)
func (FakeClient) GetRealm ¶
func (FakeClient) GetRealm(context.Context, v1beta1.RealmDoc) (GetRealmResult, error)
func (FakeClient) GetSecret ¶ added in v0.6.0
func (FakeClient) GetSecret(context.Context, v1beta1.SecretDoc) (GetSecretResult, error)
func (FakeClient) GetSpace ¶
func (FakeClient) GetSpace(context.Context, v1beta1.SpaceDoc) (GetSpaceResult, error)
func (FakeClient) GetStack ¶
func (FakeClient) GetStack(context.Context, v1beta1.StackDoc) (GetStackResult, error)
func (FakeClient) KillCell ¶
func (FakeClient) KillCell(context.Context, v1beta1.CellDoc) (KillCellResult, error)
func (FakeClient) ListBlueprints ¶ added in v0.6.0
func (FakeClient) ListBlueprints(context.Context, string, string, string) ([]v1beta1.CellBlueprintDoc, error)
func (FakeClient) ListConfigs ¶ added in v0.6.0
func (FakeClient) ListConfigs(context.Context, string, string, string) ([]v1beta1.CellConfigDoc, error)
func (FakeClient) ListContainers ¶
func (FakeClient) ListContainers(context.Context, string, string, string, string) ([]v1beta1.ContainerSpec, error)
func (FakeClient) ListRealms ¶
func (FakeClient) ListSecrets ¶ added in v0.6.0
func (FakeClient) ListSpaces ¶
func (FakeClient) ListStacks ¶
func (FakeClient) LogContainer ¶ added in v0.3.0
func (FakeClient) LogContainer(context.Context, v1beta1.ContainerDoc) (LogContainerResult, error)
func (FakeClient) MaterializeCell ¶ added in v0.6.0
func (FakeClient) MaterializeCell(context.Context, v1beta1.CellDoc) (CreateCellResult, error)
func (FakeClient) PingVersion ¶ added in v0.6.0
func (FakeClient) PingVersion(context.Context) (string, error)
func (FakeClient) PurgeCell ¶
func (FakeClient) PurgeCell(context.Context, v1beta1.CellDoc, bool, bool) (PurgeCellResult, error)
func (FakeClient) PurgeRealm ¶
func (FakeClient) PurgeRealm(context.Context, v1beta1.RealmDoc, bool, bool) (PurgeRealmResult, error)
func (FakeClient) PurgeSpace ¶
func (FakeClient) PurgeSpace(context.Context, v1beta1.SpaceDoc, bool, bool) (PurgeSpaceResult, error)
func (FakeClient) PurgeStack ¶
func (FakeClient) PurgeStack(context.Context, v1beta1.StackDoc, bool, bool) (PurgeStackResult, error)
func (FakeClient) RefreshAll ¶
func (FakeClient) RefreshAll(context.Context) (RefreshAllResult, error)
func (FakeClient) StartCell ¶
func (FakeClient) StartCell(context.Context, v1beta1.CellDoc) (StartCellResult, error)
func (FakeClient) StopCell ¶
func (FakeClient) StopCell(context.Context, v1beta1.CellDoc) (StopCellResult, error)
type GetBlueprintArgs ¶ added in v0.6.0
type GetBlueprintArgs struct {
Doc v1beta1.CellBlueprintDoc
}
type GetBlueprintReply ¶ added in v0.6.0
type GetBlueprintReply struct {
Result GetBlueprintResult
Err *APIError
}
type GetBlueprintResult ¶ added in v0.6.0
type GetBlueprintResult struct {
Blueprint v1beta1.CellBlueprintDoc
MetadataExists bool
}
GetBlueprintResult carries the full CellBlueprintDoc read from daemon storage (issue #620). Unlike GetSecretResult the whole document is populated — a blueprint carries only template references, no secret bytes — so `kuke run -b` can materialize it.
type GetCellArgs ¶
type GetCellReply ¶
type GetCellReply struct {
Result GetCellResult
Err *APIError
}
type GetCellResult ¶
type GetCellResult struct {
Cell v1beta1.CellDoc
MetadataExists bool
CgroupExists bool
RootContainerExists bool
// RootContainerTaskRunning reports whether the cell's root container has a
// live containerd task. Distinct from RootContainerExists, which keys on the
// containerd record that survives a host/daemon restart while the task does
// not (#654, #683). Attach gating must consult task liveness, not record
// existence, to avoid handing back a dead socket.
RootContainerTaskRunning bool
}
type GetConfigArgs ¶ added in v0.6.0
type GetConfigArgs struct {
Doc v1beta1.CellConfigDoc
}
type GetConfigReply ¶ added in v0.6.0
type GetConfigReply struct {
Result GetConfigResult
Err *APIError
}
type GetConfigResult ¶ added in v0.6.0
type GetConfigResult struct {
Config v1beta1.CellConfigDoc
MetadataExists bool
}
GetConfigResult carries the full CellConfigDoc read from daemon storage (issue #644). Unlike GetSecretResult the whole document is populated — a Config carries only a blueprint ref, scalar values, and slot fills, no credential bytes — so `kuke get config` can surface the binding.
type GetContainerArgs ¶
type GetContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type GetContainerReply ¶
type GetContainerReply struct {
Result GetContainerResult
Err *APIError
}
type GetContainerResult ¶
type GetContainerResult struct {
Container v1beta1.ContainerDoc
CellMetadataExists bool
ContainerExists bool
}
type GetImageResult ¶ added in v0.3.0
GetImageResult carries the metadata of one named image in a realm.
type GetRealmArgs ¶
type GetRealmReply ¶
type GetRealmReply struct {
Result GetRealmResult
Err *APIError
}
type GetRealmResult ¶
type GetSecretArgs ¶ added in v0.6.0
type GetSecretReply ¶ added in v0.6.0
type GetSecretReply struct {
Result GetSecretResult
Err *APIError
}
type GetSecretResult ¶ added in v0.6.0
GetSecretResult carries the metadata-only view of a Secret. Secret.Spec.Data is never populated — the bytes do not traverse this RPC (issue #619/#622).
type GetSpaceArgs ¶
type GetSpaceReply ¶
type GetSpaceReply struct {
Result GetSpaceResult
Err *APIError
}
type GetSpaceResult ¶
type GetStackArgs ¶
type GetStackReply ¶
type GetStackReply struct {
Result GetStackResult
Err *APIError
}
type GetStackResult ¶
type ImageInfo ¶ added in v0.3.0
type ImageInfo struct {
Name string `json:"name" yaml:"name"`
Size int64 `json:"size" yaml:"size"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
Digest string `json:"digest" yaml:"digest"`
MediaType string `json:"mediaType" yaml:"mediaType"`
Labels map[string]string `json:"labels" yaml:"labels"`
}
ImageInfo is the rendered view of one containerd image. Size is best- effort: -1 is emitted when containerd cannot resolve the size locally so the CLI renders "-" rather than "0 B".
type KillCellArgs ¶
type KillCellReply ¶
type KillCellReply struct {
Result KillCellResult
Err *APIError
}
type KillCellResult ¶
type ListBlueprintsArgs ¶ added in v0.6.0
type ListBlueprintsReply ¶ added in v0.6.0
type ListBlueprintsReply struct {
Blueprints []v1beta1.CellBlueprintDoc
Err *APIError
}
ListBlueprintsReply carries metadata-only CellBlueprintDocs — the spec (cell template, parameters, slots) is never populated for a list (issue #643).
type ListCellsArgs ¶
type ListCellsReply ¶
type ListConfigsArgs ¶ added in v0.6.0
type ListConfigsReply ¶ added in v0.6.0
type ListConfigsReply struct {
Configs []v1beta1.CellConfigDoc
Err *APIError
}
ListConfigsReply carries metadata-only CellConfigDocs — the spec (blueprint ref, values, slot fills) is never populated for a list (issue #644).
type ListContainersArgs ¶
type ListContainersReply ¶
type ListContainersReply struct {
Containers []v1beta1.ContainerSpec
Err *APIError
}
type ListImagesResult ¶ added in v0.3.0
ListImagesResult lists the images present in a realm's containerd namespace.
type ListRealmsArgs ¶
type ListRealmsArgs struct{}
type ListRealmsReply ¶
type ListSecretsArgs ¶ added in v0.6.0
type ListSecretsReply ¶ added in v0.6.0
ListSecretsReply carries metadata-only SecretDocs — Spec.Data is never set.
type ListSpacesArgs ¶
type ListSpacesArgs struct {
RealmName string
}
type ListSpacesReply ¶
type ListStacksArgs ¶
type ListStacksReply ¶
type LoadImageResult ¶ added in v0.3.0
LoadImageResult reports the outcome of a `kuke image load` import: the realm/namespace it landed in and the canonical image refs containerd recorded.
type LogContainerArgs ¶ added in v0.3.0
type LogContainerArgs struct {
Doc v1beta1.ContainerDoc
}
LogContainerArgs identifies the target container for a log request.
type LogContainerReply ¶ added in v0.3.0
type LogContainerReply struct {
Result LogContainerResult
Err *APIError
}
type LogContainerResult ¶ added in v0.3.0
type LogContainerResult struct {
// HostCapturePath is the host path of the per-container sbsh capture
// file. Inside the container the same inode is reachable at
// /run/kukeon/tty/capture via the tty directory bind mount. Set only
// when the target container has Attachable=true.
HostCapturePath string
// HostLogPath is the host path of the per-container log file written
// by the containerd runtime shim (cio.LogFile mode). Set only for
// non-Attachable containers; the file is shim-owned, kuke only reads.
HostLogPath string
}
LogContainerResult carries the host-side coordinates the `kuke log` client needs to read the per-container output stream. Bytes never traverse this RPC — the client opens the returned host path directly.
Exactly one of HostCapturePath or HostLogPath is non-empty:
- Attachable containers route stdout/stderr through the sbsh terminal wrapper, which writes a tty byte stream to HostCapturePath.
- Non-Attachable containers (including kukeond) have the runtime shim append stdout/stderr to HostLogPath via cio.LogFile.
type MaterializeCellArgs ¶ added in v0.6.0
MaterializeCellArgs is the wire request for MaterializeCell. The same CellDoc shape as CreateCellArgs — the difference is purely server-side (the daemon skips the StartCell step). Kept as a distinct type so the wire-method dispatch stays unambiguous and the JSON-RPC server's reflection-based registration picks it up alongside the other methods.
type MaterializeCellReply ¶ added in v0.6.0
type MaterializeCellReply struct {
Result CreateCellResult
Err *APIError
}
MaterializeCellReply is the wire response for MaterializeCell. Mirrors CreateCellReply so the same printer renders the outcome.
type PingReply ¶
PingReply carries the daemon's ack plus the daemon build version. Clients use Ping to confirm the RPC handler is serving (not just that the socket exists).
type PruneImagesResult ¶ added in v0.6.0
type PruneImagesResult struct {
Realm string
Namespace string
LeasesDeleted int
LeasesRetained int
}
PruneImagesResult reports the outcome of a `kuke image prune`: the realm / namespace it ran against and the count of leases released vs. retained.
type PurgeCellReply ¶
type PurgeCellReply struct {
Result PurgeCellResult
Err *APIError
}
type PurgeCellResult ¶
type PurgeRealmReply ¶
type PurgeRealmReply struct {
Result PurgeRealmResult
Err *APIError
}
type PurgeRealmResult ¶
type PurgeSpaceReply ¶
type PurgeSpaceReply struct {
Result PurgeSpaceResult
Err *APIError
}
type PurgeSpaceResult ¶
type PurgeStackReply ¶
type PurgeStackReply struct {
Result PurgeStackResult
Err *APIError
}
type PurgeStackResult ¶
type RefreshAllArgs ¶
type RefreshAllArgs struct{}
type RefreshAllReply ¶
type RefreshAllReply struct {
Result RefreshAllResult
Err *APIError
}
type RefreshAllResult ¶
type StartCellArgs ¶
type StartCellReply ¶
type StartCellReply struct {
Result StartCellResult
Err *APIError
}
type StartCellResult ¶
type StopCellArgs ¶
type StopCellReply ¶
type StopCellReply struct {
Result StopCellResult
Err *APIError
}
type StopCellResult ¶
type UnixClient ¶
type UnixClient struct {
// contains filtered or unexported fields
}
UnixClient is a Client backed by a persistent net/rpc connection over a unix socket using the JSON-RPC codec. The connection is lazily established on first call and reused for subsequent calls on the same instance.
func NewUnixClient ¶
func NewUnixClient(sockPath string, opts ...UnixOption) *UnixClient
NewUnixClient returns a ctx-aware Client that dials the given unix socket path on first use and reuses the connection for subsequent calls.
func (*UnixClient) ApplyDocuments ¶
func (c *UnixClient) ApplyDocuments(ctx context.Context, rawYAML []byte) (ApplyDocumentsResult, error)
ApplyDocuments implements Client.
func (*UnixClient) ApplyDocumentsForTeam ¶ added in v0.6.0
func (c *UnixClient) ApplyDocumentsForTeam( ctx context.Context, rawYAML []byte, team string, ) (ApplyDocumentsResult, error)
ApplyDocumentsForTeam implements Client.
func (*UnixClient) AttachContainer ¶ added in v0.2.0
func (c *UnixClient) AttachContainer( ctx context.Context, doc v1beta1.ContainerDoc, ) (AttachContainerResult, error)
AttachContainer implements Client.
func (*UnixClient) Close ¶
func (c *UnixClient) Close() error
Close terminates the underlying rpc.Client connection if open. Safe to call multiple times.
func (*UnixClient) CreateCell ¶
func (c *UnixClient) CreateCell(ctx context.Context, doc v1beta1.CellDoc) (CreateCellResult, error)
CreateCell implements Client.
func (*UnixClient) CreateConfig ¶ added in v0.6.0
func (c *UnixClient) CreateConfig( ctx context.Context, doc v1beta1.CellConfigDoc, ) (CreateConfigResult, error)
CreateConfig implements Client (#839).
func (*UnixClient) CreateRealm ¶
func (c *UnixClient) CreateRealm(ctx context.Context, doc v1beta1.RealmDoc) (CreateRealmResult, error)
CreateRealm implements Client.
func (*UnixClient) CreateSecret ¶ added in v0.6.0
func (c *UnixClient) CreateSecret( ctx context.Context, doc v1beta1.SecretDoc, ) (CreateSecretResult, error)
CreateSecret implements Client (#815).
func (*UnixClient) CreateSpace ¶
func (c *UnixClient) CreateSpace(ctx context.Context, doc v1beta1.SpaceDoc) (CreateSpaceResult, error)
CreateSpace implements Client.
func (*UnixClient) CreateStack ¶
func (c *UnixClient) CreateStack(ctx context.Context, doc v1beta1.StackDoc) (CreateStackResult, error)
CreateStack implements Client.
func (*UnixClient) DeleteBlueprint ¶ added in v0.6.0
func (c *UnixClient) DeleteBlueprint( ctx context.Context, doc v1beta1.CellBlueprintDoc, ) (DeleteBlueprintResult, error)
DeleteBlueprint implements Client.
func (*UnixClient) DeleteCell ¶
func (c *UnixClient) DeleteCell(ctx context.Context, doc v1beta1.CellDoc) (DeleteCellResult, error)
DeleteCell implements Client.
func (*UnixClient) DeleteConfig ¶ added in v0.6.0
func (c *UnixClient) DeleteConfig( ctx context.Context, doc v1beta1.CellConfigDoc, ) (DeleteConfigResult, error)
DeleteConfig implements Client.
func (*UnixClient) DeleteDocuments ¶ added in v0.6.0
func (c *UnixClient) DeleteDocuments( ctx context.Context, rawYAML []byte, cascade, force bool, ) (DeleteDocumentsResult, error)
DeleteDocuments implements Client.
func (*UnixClient) DeleteRealm ¶
func (c *UnixClient) DeleteRealm( ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool, ) (DeleteRealmResult, error)
DeleteRealm implements Client.
func (*UnixClient) DeleteSecret ¶ added in v0.6.0
func (c *UnixClient) DeleteSecret(ctx context.Context, doc v1beta1.SecretDoc) (DeleteSecretResult, error)
DeleteSecret implements Client.
func (*UnixClient) DeleteSpace ¶
func (c *UnixClient) DeleteSpace( ctx context.Context, doc v1beta1.SpaceDoc, force, cascade bool, ) (DeleteSpaceResult, error)
DeleteSpace implements Client.
func (*UnixClient) DeleteStack ¶
func (c *UnixClient) DeleteStack( ctx context.Context, doc v1beta1.StackDoc, force, cascade bool, ) (DeleteStackResult, error)
DeleteStack implements Client.
func (*UnixClient) GetBlueprint ¶ added in v0.6.0
func (c *UnixClient) GetBlueprint( ctx context.Context, doc v1beta1.CellBlueprintDoc, ) (GetBlueprintResult, error)
GetBlueprint implements Client.
func (*UnixClient) GetCell ¶
func (c *UnixClient) GetCell(ctx context.Context, doc v1beta1.CellDoc) (GetCellResult, error)
GetCell implements Client.
func (*UnixClient) GetConfig ¶ added in v0.6.0
func (c *UnixClient) GetConfig( ctx context.Context, doc v1beta1.CellConfigDoc, ) (GetConfigResult, error)
GetConfig implements Client.
func (*UnixClient) GetContainer ¶
func (c *UnixClient) GetContainer(ctx context.Context, doc v1beta1.ContainerDoc) (GetContainerResult, error)
GetContainer implements Client.
func (*UnixClient) GetRealm ¶
func (c *UnixClient) GetRealm(ctx context.Context, doc v1beta1.RealmDoc) (GetRealmResult, error)
GetRealm implements Client.
func (*UnixClient) GetSecret ¶ added in v0.6.0
func (c *UnixClient) GetSecret(ctx context.Context, doc v1beta1.SecretDoc) (GetSecretResult, error)
GetSecret implements Client.
func (*UnixClient) GetSpace ¶
func (c *UnixClient) GetSpace(ctx context.Context, doc v1beta1.SpaceDoc) (GetSpaceResult, error)
GetSpace implements Client.
func (*UnixClient) GetStack ¶
func (c *UnixClient) GetStack(ctx context.Context, doc v1beta1.StackDoc) (GetStackResult, error)
GetStack implements Client.
func (*UnixClient) KillCell ¶
func (c *UnixClient) KillCell(ctx context.Context, doc v1beta1.CellDoc) (KillCellResult, error)
KillCell implements Client.
func (*UnixClient) ListBlueprints ¶ added in v0.6.0
func (c *UnixClient) ListBlueprints( ctx context.Context, realmName, spaceName, stackName string, ) ([]v1beta1.CellBlueprintDoc, error)
ListBlueprints implements Client.
func (*UnixClient) ListCells ¶
func (c *UnixClient) ListCells(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellDoc, error)
ListCells implements Client.
func (*UnixClient) ListConfigs ¶ added in v0.6.0
func (c *UnixClient) ListConfigs( ctx context.Context, realmName, spaceName, stackName string, ) ([]v1beta1.CellConfigDoc, error)
ListConfigs implements Client.
func (*UnixClient) ListContainers ¶
func (c *UnixClient) ListContainers( ctx context.Context, realmName, spaceName, stackName, cellName string, ) ([]v1beta1.ContainerSpec, error)
ListContainers implements Client.
func (*UnixClient) ListRealms ¶
ListRealms implements Client.
func (*UnixClient) ListSecrets ¶ added in v0.6.0
func (c *UnixClient) ListSecrets( ctx context.Context, realmName, spaceName, stackName, cellName string, ) ([]v1beta1.SecretDoc, error)
ListSecrets implements Client.
func (*UnixClient) ListSpaces ¶
ListSpaces implements Client.
func (*UnixClient) ListStacks ¶
func (c *UnixClient) ListStacks(ctx context.Context, realmName, spaceName string) ([]v1beta1.StackDoc, error)
ListStacks implements Client.
func (*UnixClient) LogContainer ¶ added in v0.3.0
func (c *UnixClient) LogContainer( ctx context.Context, doc v1beta1.ContainerDoc, ) (LogContainerResult, error)
LogContainer implements Client.
func (*UnixClient) MaterializeCell ¶ added in v0.6.0
func (c *UnixClient) MaterializeCell(ctx context.Context, doc v1beta1.CellDoc) (CreateCellResult, error)
MaterializeCell implements Client.
func (*UnixClient) Ping ¶
func (c *UnixClient) Ping(ctx context.Context) error
Ping implements Client.
func (*UnixClient) PingVersion ¶ added in v0.6.0
func (c *UnixClient) PingVersion(ctx context.Context) (string, error)
PingVersion returns the daemon's reported build version. The wire reply has carried Version since the RPC's introduction; the helper exposes it to callers (notably `kuke status`) without forcing them to hand-roll the Ping wire.
func (*UnixClient) PurgeCell ¶
func (c *UnixClient) PurgeCell(ctx context.Context, doc v1beta1.CellDoc, force, cascade bool) (PurgeCellResult, error)
PurgeCell implements Client.
func (*UnixClient) PurgeRealm ¶
func (c *UnixClient) PurgeRealm( ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool, ) (PurgeRealmResult, error)
PurgeRealm implements Client.
func (*UnixClient) PurgeSpace ¶
func (c *UnixClient) PurgeSpace( ctx context.Context, doc v1beta1.SpaceDoc, force, cascade bool, ) (PurgeSpaceResult, error)
PurgeSpace implements Client.
func (*UnixClient) PurgeStack ¶
func (c *UnixClient) PurgeStack( ctx context.Context, doc v1beta1.StackDoc, force, cascade bool, ) (PurgeStackResult, error)
PurgeStack implements Client.
func (*UnixClient) RefreshAll ¶
func (c *UnixClient) RefreshAll(ctx context.Context) (RefreshAllResult, error)
RefreshAll implements Client.
func (*UnixClient) StartCell ¶
func (c *UnixClient) StartCell(ctx context.Context, doc v1beta1.CellDoc) (StartCellResult, error)
StartCell implements Client.
func (*UnixClient) StopCell ¶
func (c *UnixClient) StopCell(ctx context.Context, doc v1beta1.CellDoc) (StopCellResult, error)
StopCell implements Client.
type UnixOption ¶
type UnixOption func(*UnixClient)
UnixOption configures a UnixClient.
func WithDialTimeout ¶
func WithDialTimeout(d time.Duration) UnixOption
WithDialTimeout overrides the dial timeout for NewUnixClient.