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 CreateContainerArgs
- type CreateContainerReply
- type CreateContainerResult
- type CreateRealmArgs
- type CreateRealmReply
- type CreateRealmResult
- type CreateSpaceArgs
- type CreateSpaceReply
- type CreateSpaceResult
- type CreateStackArgs
- type CreateStackReply
- type CreateStackResult
- type DeleteCellArgs
- type DeleteCellReply
- type DeleteCellResult
- type DeleteContainerArgs
- type DeleteContainerReply
- type DeleteContainerResult
- type DeleteImageArgs
- type DeleteImageReply
- type DeleteImageResult
- type DeleteRealmArgs
- type DeleteRealmReply
- type DeleteRealmResult
- type DeleteSpaceArgs
- type DeleteSpaceReply
- type DeleteSpaceResult
- type DeleteStackArgs
- type DeleteStackReply
- type DeleteStackResult
- type FakeClient
- func (FakeClient) ApplyDocuments(context.Context, []byte) (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) CreateContainer(context.Context, v1beta1.ContainerDoc) (CreateContainerResult, error)
- func (FakeClient) CreateRealm(context.Context, v1beta1.RealmDoc) (CreateRealmResult, error)
- func (FakeClient) CreateSpace(context.Context, v1beta1.SpaceDoc) (CreateSpaceResult, error)
- func (FakeClient) CreateStack(context.Context, v1beta1.StackDoc) (CreateStackResult, error)
- func (FakeClient) DeleteCell(context.Context, v1beta1.CellDoc) (DeleteCellResult, error)
- func (FakeClient) DeleteContainer(context.Context, v1beta1.ContainerDoc) (DeleteContainerResult, error)
- func (FakeClient) DeleteImage(context.Context, string, string) (DeleteImageResult, error)
- func (FakeClient) DeleteRealm(context.Context, v1beta1.RealmDoc, bool, bool) (DeleteRealmResult, 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) GetCell(context.Context, v1beta1.CellDoc) (GetCellResult, error)
- func (FakeClient) GetContainer(context.Context, v1beta1.ContainerDoc) (GetContainerResult, error)
- func (FakeClient) GetImage(context.Context, string, string) (GetImageResult, error)
- func (FakeClient) GetRealm(context.Context, v1beta1.RealmDoc) (GetRealmResult, 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) KillContainer(context.Context, v1beta1.ContainerDoc) (KillContainerResult, error)
- func (FakeClient) ListCells(context.Context, string, string, string) ([]v1beta1.CellDoc, error)
- func (FakeClient) ListContainers(context.Context, string, string, string, string) ([]v1beta1.ContainerSpec, error)
- func (FakeClient) ListImages(context.Context, string) (ListImagesResult, error)
- func (FakeClient) ListRealms(context.Context) ([]v1beta1.RealmDoc, error)
- func (FakeClient) ListSpaces(context.Context, string) ([]v1beta1.SpaceDoc, error)
- func (FakeClient) ListStacks(context.Context, string, string) ([]v1beta1.StackDoc, error)
- func (FakeClient) LoadImage(context.Context, string, []byte) (LoadImageResult, error)
- func (FakeClient) LogContainer(context.Context, v1beta1.ContainerDoc) (LogContainerResult, error)
- func (FakeClient) Ping(context.Context) error
- func (FakeClient) PurgeCell(context.Context, v1beta1.CellDoc, bool, bool) (PurgeCellResult, error)
- func (FakeClient) PurgeContainer(context.Context, v1beta1.ContainerDoc) (PurgeContainerResult, 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) StartContainer(context.Context, v1beta1.ContainerDoc) (StartContainerResult, error)
- func (FakeClient) StopCell(context.Context, v1beta1.CellDoc) (StopCellResult, error)
- func (FakeClient) StopContainer(context.Context, v1beta1.ContainerDoc) (StopContainerResult, error)
- type GetCellArgs
- type GetCellReply
- type GetCellResult
- type GetContainerArgs
- type GetContainerReply
- type GetContainerResult
- type GetImageArgs
- type GetImageReply
- type GetImageResult
- type GetRealmArgs
- type GetRealmReply
- type GetRealmResult
- type GetSpaceArgs
- type GetSpaceReply
- type GetSpaceResult
- type GetStackArgs
- type GetStackReply
- type GetStackResult
- type ImageInfo
- type KillCellArgs
- type KillCellReply
- type KillCellResult
- type KillContainerArgs
- type KillContainerReply
- type KillContainerResult
- type ListCellsArgs
- type ListCellsReply
- type ListContainersArgs
- type ListContainersReply
- type ListImagesArgs
- type ListImagesReply
- type ListImagesResult
- type ListRealmsArgs
- type ListRealmsReply
- type ListSpacesArgs
- type ListSpacesReply
- type ListStacksArgs
- type ListStacksReply
- type LoadImageArgs
- type LoadImageReply
- type LoadImageResult
- type LogContainerArgs
- type LogContainerReply
- type LogContainerResult
- type PingArgs
- type PingReply
- type PurgeCellArgs
- type PurgeCellReply
- type PurgeCellResult
- type PurgeContainerArgs
- type PurgeContainerReply
- type PurgeContainerResult
- 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 StartContainerArgs
- type StartContainerReply
- type StartContainerResult
- type StopCellArgs
- type StopCellReply
- type StopCellResult
- type StopContainerArgs
- type StopContainerReply
- type StopContainerResult
- type UnixClient
- func (c *UnixClient) ApplyDocuments(ctx context.Context, rawYAML []byte) (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) CreateContainer(ctx context.Context, doc v1beta1.ContainerDoc) (CreateContainerResult, error)
- func (c *UnixClient) CreateRealm(ctx context.Context, doc v1beta1.RealmDoc) (CreateRealmResult, 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) DeleteCell(ctx context.Context, doc v1beta1.CellDoc) (DeleteCellResult, error)
- func (c *UnixClient) DeleteContainer(ctx context.Context, doc v1beta1.ContainerDoc) (DeleteContainerResult, error)
- func (c *UnixClient) DeleteImage(ctx context.Context, realm, ref string) (DeleteImageResult, error)
- func (c *UnixClient) DeleteRealm(ctx context.Context, doc v1beta1.RealmDoc, force, cascade bool) (DeleteRealmResult, 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) GetCell(ctx context.Context, doc v1beta1.CellDoc) (GetCellResult, error)
- func (c *UnixClient) GetContainer(ctx context.Context, doc v1beta1.ContainerDoc) (GetContainerResult, error)
- func (c *UnixClient) GetImage(ctx context.Context, realm, ref string) (GetImageResult, error)
- func (c *UnixClient) GetRealm(ctx context.Context, doc v1beta1.RealmDoc) (GetRealmResult, 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) KillContainer(ctx context.Context, doc v1beta1.ContainerDoc) (KillContainerResult, error)
- func (c *UnixClient) ListCells(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellDoc, error)
- func (c *UnixClient) ListContainers(ctx context.Context, realmName, spaceName, stackName, cellName string) ([]v1beta1.ContainerSpec, error)
- func (c *UnixClient) ListImages(ctx context.Context, realm string) (ListImagesResult, error)
- func (c *UnixClient) ListRealms(ctx context.Context) ([]v1beta1.RealmDoc, 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) LoadImage(ctx context.Context, realm string, tarball []byte) (LoadImageResult, error)
- func (c *UnixClient) LogContainer(ctx context.Context, doc v1beta1.ContainerDoc) (LogContainerResult, error)
- func (c *UnixClient) Ping(ctx context.Context) error
- func (c *UnixClient) PurgeCell(ctx context.Context, doc v1beta1.CellDoc, force, cascade bool) (PurgeCellResult, error)
- func (c *UnixClient) PurgeContainer(ctx context.Context, doc v1beta1.ContainerDoc) (PurgeContainerResult, 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) StartContainer(ctx context.Context, doc v1beta1.ContainerDoc) (StartContainerResult, error)
- func (c *UnixClient) StopCell(ctx context.Context, doc v1beta1.CellDoc) (StopCellResult, error)
- func (c *UnixClient) StopContainer(ctx context.Context, doc v1beta1.ContainerDoc) (StopContainerResult, error)
- type UnixOption
Constants ¶
const ( MethodCreateRealm = ServiceName + ".CreateRealm" MethodCreateSpace = ServiceName + ".CreateSpace" MethodCreateStack = ServiceName + ".CreateStack" MethodCreateCell = ServiceName + ".CreateCell" MethodCreateContainer = ServiceName + ".CreateContainer" MethodGetRealm = ServiceName + ".GetRealm" MethodGetSpace = ServiceName + ".GetSpace" MethodGetStack = ServiceName + ".GetStack" MethodGetCell = ServiceName + ".GetCell" MethodGetContainer = ServiceName + ".GetContainer" MethodListRealms = ServiceName + ".ListRealms" MethodListSpaces = ServiceName + ".ListSpaces" MethodListStacks = ServiceName + ".ListStacks" MethodListCells = ServiceName + ".ListCells" MethodListContainers = ServiceName + ".ListContainers" MethodStartCell = ServiceName + ".StartCell" MethodStartContainer = ServiceName + ".StartContainer" MethodAttachContainer = ServiceName + ".AttachContainer" MethodLogContainer = ServiceName + ".LogContainer" MethodStopCell = ServiceName + ".StopCell" MethodStopContainer = ServiceName + ".StopContainer" MethodKillCell = ServiceName + ".KillCell" MethodKillContainer = ServiceName + ".KillContainer" MethodDeleteRealm = ServiceName + ".DeleteRealm" MethodDeleteSpace = ServiceName + ".DeleteSpace" MethodDeleteStack = ServiceName + ".DeleteStack" MethodDeleteCell = ServiceName + ".DeleteCell" MethodDeleteContainer = ServiceName + ".DeleteContainer" MethodPurgeRealm = ServiceName + ".PurgeRealm" MethodPurgeSpace = ServiceName + ".PurgeSpace" MethodPurgeStack = ServiceName + ".PurgeStack" MethodPurgeCell = ServiceName + ".PurgeCell" MethodPurgeContainer = ServiceName + ".PurgeContainer" MethodRefreshAll = ServiceName + ".RefreshAll" MethodApplyDocuments = ServiceName + ".ApplyDocuments" MethodLoadImage = ServiceName + ".LoadImage" MethodListImages = ServiceName + ".ListImages" MethodGetImage = ServiceName + ".GetImage" MethodDeleteImage = ServiceName + ".DeleteImage" 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 ¶
type ApplyDocumentsArgs struct {
RawYAML []byte
}
ApplyDocumentsArgs carries a raw multi-document YAML blob. The server parses and validates; validation errors are returned in the Reply.Err.
type ApplyDocumentsReply ¶
type ApplyDocumentsReply struct {
Result ApplyDocumentsResult
Err *APIError
}
type ApplyDocumentsResult ¶
type ApplyDocumentsResult struct {
Resources []ApplyResourceResult
}
type ApplyResourceResult ¶
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; otherwise the daemon
// errors with ErrAttachNotSupported.
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)
CreateContainer(ctx context.Context, doc v1beta1.ContainerDoc) (CreateContainerResult, 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)
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)
StartCell(ctx context.Context, doc v1beta1.CellDoc) (StartCellResult, error)
StartContainer(ctx context.Context, doc v1beta1.ContainerDoc) (StartContainerResult, 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)
StopContainer(ctx context.Context, doc v1beta1.ContainerDoc) (StopContainerResult, error)
KillCell(ctx context.Context, doc v1beta1.CellDoc) (KillCellResult, error)
KillContainer(ctx context.Context, doc v1beta1.ContainerDoc) (KillContainerResult, 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)
DeleteContainer(ctx context.Context, doc v1beta1.ContainerDoc) (DeleteContainerResult, 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)
PurgeContainer(ctx context.Context, doc v1beta1.ContainerDoc) (PurgeContainerResult, error)
RefreshAll(ctx context.Context) (RefreshAllResult, error)
ApplyDocuments(ctx context.Context, rawYAML []byte) (ApplyDocumentsResult, error)
// LoadImage imports an OCI/docker image tarball into the named realm's
// containerd namespace. The tarball ships in-band; see LoadImageArgs.
LoadImage(ctx context.Context, realm string, tarball []byte) (LoadImageResult, error)
// ListImages enumerates images in the named realm's containerd
// namespace.
ListImages(ctx context.Context, realm string) (ListImagesResult, error)
// GetImage returns metadata for the named image ref in the named
// realm. errdefs.ErrImageNotFound is returned when the ref is absent.
GetImage(ctx context.Context, realm, ref string) (GetImageResult, error)
// DeleteImage removes the named image ref from the named realm's
// containerd namespace. errdefs.ErrImageNotFound is returned when
// the ref does not exist.
DeleteImage(ctx context.Context, realm, ref string) (DeleteImageResult, error)
Ping(ctx context.Context) 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 CreateContainerArgs ¶
type CreateContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type CreateContainerReply ¶
type CreateContainerReply struct {
Result CreateContainerResult
Err *APIError
}
type CreateContainerResult ¶
type CreateRealmArgs ¶
type CreateRealmReply ¶
type CreateRealmReply struct {
Result CreateRealmResult
Err *APIError
}
type CreateRealmResult ¶
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 DeleteCellArgs ¶
type DeleteCellReply ¶
type DeleteCellReply struct {
Result DeleteCellResult
Err *APIError
}
type DeleteCellResult ¶
type DeleteContainerArgs ¶
type DeleteContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type DeleteContainerReply ¶
type DeleteContainerReply struct {
Result DeleteContainerResult
Err *APIError
}
type DeleteContainerResult ¶
type DeleteContainerResult struct {
Container v1beta1.ContainerDoc
CellMetadataExists bool
ContainerExists bool
Deleted []string
}
type DeleteImageArgs ¶ added in v0.3.0
DeleteImageArgs is the wire request for DeleteImage.
type DeleteImageReply ¶ added in v0.3.0
type DeleteImageReply struct {
Result DeleteImageResult
Err *APIError
}
DeleteImageReply is the wire response for DeleteImage.
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 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) 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) CreateContainer ¶
func (FakeClient) CreateContainer(context.Context, v1beta1.ContainerDoc) (CreateContainerResult, error)
func (FakeClient) CreateRealm ¶
func (FakeClient) CreateRealm(context.Context, v1beta1.RealmDoc) (CreateRealmResult, 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) DeleteCell ¶
func (FakeClient) DeleteCell(context.Context, v1beta1.CellDoc) (DeleteCellResult, error)
func (FakeClient) DeleteContainer ¶
func (FakeClient) DeleteContainer(context.Context, v1beta1.ContainerDoc) (DeleteContainerResult, error)
func (FakeClient) DeleteImage ¶ added in v0.3.0
func (FakeClient) DeleteImage(context.Context, string, string) (DeleteImageResult, error)
func (FakeClient) DeleteRealm ¶
func (FakeClient) DeleteRealm(context.Context, v1beta1.RealmDoc, bool, bool) (DeleteRealmResult, 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) GetCell ¶
func (FakeClient) GetCell(context.Context, v1beta1.CellDoc) (GetCellResult, error)
func (FakeClient) GetContainer ¶
func (FakeClient) GetContainer(context.Context, v1beta1.ContainerDoc) (GetContainerResult, error)
func (FakeClient) GetImage ¶ added in v0.3.0
func (FakeClient) GetImage(context.Context, string, string) (GetImageResult, error)
func (FakeClient) GetRealm ¶
func (FakeClient) GetRealm(context.Context, v1beta1.RealmDoc) (GetRealmResult, 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) KillContainer ¶
func (FakeClient) KillContainer(context.Context, v1beta1.ContainerDoc) (KillContainerResult, error)
func (FakeClient) ListContainers ¶
func (FakeClient) ListContainers(context.Context, string, string, string, string) ([]v1beta1.ContainerSpec, error)
func (FakeClient) ListImages ¶ added in v0.3.0
func (FakeClient) ListImages(context.Context, string) (ListImagesResult, error)
func (FakeClient) ListRealms ¶
func (FakeClient) ListSpaces ¶
func (FakeClient) ListStacks ¶
func (FakeClient) LoadImage ¶ added in v0.3.0
func (FakeClient) LoadImage(context.Context, string, []byte) (LoadImageResult, error)
func (FakeClient) LogContainer ¶ added in v0.3.0
func (FakeClient) LogContainer(context.Context, v1beta1.ContainerDoc) (LogContainerResult, error)
func (FakeClient) PurgeCell ¶
func (FakeClient) PurgeCell(context.Context, v1beta1.CellDoc, bool, bool) (PurgeCellResult, error)
func (FakeClient) PurgeContainer ¶
func (FakeClient) PurgeContainer(context.Context, v1beta1.ContainerDoc) (PurgeContainerResult, 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) StartContainer ¶
func (FakeClient) StartContainer(context.Context, v1beta1.ContainerDoc) (StartContainerResult, error)
func (FakeClient) StopCell ¶
func (FakeClient) StopCell(context.Context, v1beta1.CellDoc) (StopCellResult, error)
func (FakeClient) StopContainer ¶
func (FakeClient) StopContainer(context.Context, v1beta1.ContainerDoc) (StopContainerResult, error)
type GetCellArgs ¶
type GetCellReply ¶
type GetCellReply struct {
Result GetCellResult
Err *APIError
}
type GetCellResult ¶
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 GetImageArgs ¶ added in v0.3.0
GetImageArgs is the wire request for GetImage.
type GetImageReply ¶ added in v0.3.0
type GetImageReply struct {
Result GetImageResult
Err *APIError
}
GetImageReply is the wire response for GetImage.
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 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
Size int64
CreatedAt time.Time
Digest string
MediaType string
Labels map[string]string
}
ImageInfo is the wire view of one containerd image. Size is best-effort: the daemon emits -1 when containerd cannot resolve the size locally so the CLI can render "-" rather than "0 B".
type KillCellArgs ¶
type KillCellReply ¶
type KillCellReply struct {
Result KillCellResult
Err *APIError
}
type KillCellResult ¶
type KillContainerArgs ¶
type KillContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type KillContainerReply ¶
type KillContainerReply struct {
Result KillContainerResult
Err *APIError
}
type KillContainerResult ¶
type KillContainerResult struct {
Container v1beta1.ContainerDoc
Killed bool
}
type ListCellsArgs ¶
type ListCellsReply ¶
type ListContainersArgs ¶
type ListContainersReply ¶
type ListContainersReply struct {
Containers []v1beta1.ContainerSpec
Err *APIError
}
type ListImagesArgs ¶ added in v0.3.0
type ListImagesArgs struct {
Realm string
}
ListImagesArgs is the wire request for ListImages.
type ListImagesReply ¶ added in v0.3.0
type ListImagesReply struct {
Result ListImagesResult
Err *APIError
}
ListImagesReply is the wire response for ListImages.
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 ListSpacesArgs ¶
type ListSpacesArgs struct {
RealmName string
}
type ListSpacesReply ¶
type ListStacksArgs ¶
type ListStacksReply ¶
type LoadImageArgs ¶ added in v0.3.0
LoadImageArgs carries an OCI/docker image tarball plus the target realm. The tarball ships as a byte slice (mirroring ApplyDocumentsArgs.RawYAML); phase 1 sizes are bounded by the dev loop (≈100MB), so JSON-RPC roundtrip cost is acceptable. Larger payloads will move to a streaming endpoint when the multi-host story arrives.
type LoadImageReply ¶ added in v0.3.0
type LoadImageReply struct {
Result LoadImageResult
Err *APIError
}
type LoadImageResult ¶ added in v0.3.0
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 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 PurgeCellReply ¶
type PurgeCellReply struct {
Result PurgeCellResult
Err *APIError
}
type PurgeCellResult ¶
type PurgeContainerArgs ¶
type PurgeContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type PurgeContainerReply ¶
type PurgeContainerReply struct {
Result PurgeContainerResult
Err *APIError
}
type PurgeContainerResult ¶
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 StartContainerArgs ¶
type StartContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type StartContainerReply ¶
type StartContainerReply struct {
Result StartContainerResult
Err *APIError
}
type StartContainerResult ¶
type StartContainerResult struct {
Container v1beta1.ContainerDoc
Started bool
}
type StopCellArgs ¶
type StopCellReply ¶
type StopCellReply struct {
Result StopCellResult
Err *APIError
}
type StopCellResult ¶
type StopContainerArgs ¶
type StopContainerArgs struct {
Doc v1beta1.ContainerDoc
}
type StopContainerReply ¶
type StopContainerReply struct {
Result StopContainerResult
Err *APIError
}
type StopContainerResult ¶
type StopContainerResult struct {
Container v1beta1.ContainerDoc
Stopped bool
}
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) 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) CreateContainer ¶
func (c *UnixClient) CreateContainer(ctx context.Context, doc v1beta1.ContainerDoc) (CreateContainerResult, error)
CreateContainer implements Client.
func (*UnixClient) CreateRealm ¶
func (c *UnixClient) CreateRealm(ctx context.Context, doc v1beta1.RealmDoc) (CreateRealmResult, error)
CreateRealm implements Client.
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) DeleteCell ¶
func (c *UnixClient) DeleteCell(ctx context.Context, doc v1beta1.CellDoc) (DeleteCellResult, error)
DeleteCell implements Client.
func (*UnixClient) DeleteContainer ¶
func (c *UnixClient) DeleteContainer(ctx context.Context, doc v1beta1.ContainerDoc) (DeleteContainerResult, error)
DeleteContainer implements Client.
func (*UnixClient) DeleteImage ¶ added in v0.3.0
func (c *UnixClient) DeleteImage(ctx context.Context, realm, ref string) (DeleteImageResult, error)
DeleteImage 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) 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) GetCell ¶
func (c *UnixClient) GetCell(ctx context.Context, doc v1beta1.CellDoc) (GetCellResult, error)
GetCell implements Client.
func (*UnixClient) GetContainer ¶
func (c *UnixClient) GetContainer(ctx context.Context, doc v1beta1.ContainerDoc) (GetContainerResult, error)
GetContainer implements Client.
func (*UnixClient) GetImage ¶ added in v0.3.0
func (c *UnixClient) GetImage(ctx context.Context, realm, ref string) (GetImageResult, error)
GetImage implements Client.
func (*UnixClient) GetRealm ¶
func (c *UnixClient) GetRealm(ctx context.Context, doc v1beta1.RealmDoc) (GetRealmResult, error)
GetRealm 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) KillContainer ¶
func (c *UnixClient) KillContainer(ctx context.Context, doc v1beta1.ContainerDoc) (KillContainerResult, error)
KillContainer implements Client.
func (*UnixClient) ListCells ¶
func (c *UnixClient) ListCells(ctx context.Context, realmName, spaceName, stackName string) ([]v1beta1.CellDoc, error)
ListCells 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) ListImages ¶ added in v0.3.0
func (c *UnixClient) ListImages(ctx context.Context, realm string) (ListImagesResult, error)
ListImages implements Client.
func (*UnixClient) ListRealms ¶
ListRealms 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) LoadImage ¶ added in v0.3.0
func (c *UnixClient) LoadImage(ctx context.Context, realm string, tarball []byte) (LoadImageResult, error)
LoadImage 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) Ping ¶
func (c *UnixClient) Ping(ctx context.Context) error
Ping implements Client.
func (*UnixClient) PurgeCell ¶
func (c *UnixClient) PurgeCell(ctx context.Context, doc v1beta1.CellDoc, force, cascade bool) (PurgeCellResult, error)
PurgeCell implements Client.
func (*UnixClient) PurgeContainer ¶
func (c *UnixClient) PurgeContainer(ctx context.Context, doc v1beta1.ContainerDoc) (PurgeContainerResult, error)
PurgeContainer 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) StartContainer ¶
func (c *UnixClient) StartContainer(ctx context.Context, doc v1beta1.ContainerDoc) (StartContainerResult, error)
StartContainer implements Client.
func (*UnixClient) StopCell ¶
func (c *UnixClient) StopCell(ctx context.Context, doc v1beta1.CellDoc) (StopCellResult, error)
StopCell implements Client.
func (*UnixClient) StopContainer ¶
func (c *UnixClient) StopContainer(ctx context.Context, doc v1beta1.ContainerDoc) (StopContainerResult, error)
StopContainer 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.