Documentation
¶
Index ¶
- func CommandFunc(...) inject.ExecFunc
- func Deliver(ctx context.Context, strategy AgentDelivery, preOpts *PreStartOptions, ...) error
- func ExecFuncFromDriver(...) inject.ExecFuncdeprecated
- type AgentDelivery
- type BinarySourceFunc
- type DeliveryPhase
- type FactoryOptions
- type KubernetesDelivery
- func (d *KubernetesDelivery) Cleanup(_ context.Context, _ string) error
- func (d *KubernetesDelivery) DeliverPostStart(ctx context.Context, opts PostStartOptions) error
- func (d *KubernetesDelivery) DeliverPreStart(_ context.Context, _ PreStartOptions) error
- func (d *KubernetesDelivery) Phase() DeliveryPhase
- type LegacyShellDeliverydeprecated
- func (d *LegacyShellDelivery) Cleanup(_ context.Context, _ string) errordeprecated
- func (d *LegacyShellDelivery) DeliverPostStart(ctx context.Context, opts PostStartOptions) errordeprecated
- func (d *LegacyShellDelivery) DeliverPreStart(_ context.Context, _ PreStartOptions) errordeprecated
- func (d *LegacyShellDelivery) Phase() DeliveryPhasedeprecated
- type LocalDockerDelivery
- func (d *LocalDockerDelivery) Cleanup(ctx context.Context, workspaceID string) error
- func (d *LocalDockerDelivery) DeliverPostStart(_ context.Context, _ PostStartOptions) error
- func (d *LocalDockerDelivery) DeliverPreStart(ctx context.Context, opts PreStartOptions) error
- func (d *LocalDockerDelivery) Phase() DeliveryPhase
- type PostStartOptions
- type PreStartOptions
- type RemoteDockerDelivery
- func (d *RemoteDockerDelivery) Cleanup(_ context.Context, _ string) error
- func (d *RemoteDockerDelivery) DeliverPostStart(ctx context.Context, opts PostStartOptions) error
- func (d *RemoteDockerDelivery) DeliverPreStart(_ context.Context, _ PreStartOptions) error
- func (d *RemoteDockerDelivery) Phase() DeliveryPhase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandFunc ¶
func CommandFunc( driverCmd func( ctx context.Context, workspaceID, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer, ) error, workspaceID string, ) inject.ExecFunc
CommandFunc adapts a driver's command function to inject.ExecFunc.
func Deliver ¶
func Deliver( ctx context.Context, strategy AgentDelivery, preOpts *PreStartOptions, postOpts *PostStartOptions, ) error
Deliver calls the appropriate delivery method based on the strategy's phase.
func ExecFuncFromDriver
deprecated
func ExecFuncFromDriver( cmdFn func(ctx context.Context, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error, user string, ) inject.ExecFunc
ExecFuncFromDriver creates an inject.ExecFunc that routes commands through the provided driver command function. This adapts the driver's CommandDevContainer signature for use with the legacy injection path.
Deprecated: Platform-native AgentDelivery implementations (LocalDockerDelivery, RemoteDockerDelivery, KubernetesDelivery) are the replacements.
Types ¶
type AgentDelivery ¶
type AgentDelivery interface {
Phase() DeliveryPhase
DeliverPreStart(ctx context.Context, opts PreStartOptions) error
DeliverPostStart(ctx context.Context, opts PostStartOptions) error
Cleanup(ctx context.Context, workspaceID string) error
}
func NewAgentDelivery ¶
func NewAgentDelivery(opts FactoryOptions) AgentDelivery
type BinarySourceFunc ¶
type DeliveryPhase ¶
type DeliveryPhase int
const ( PhasePreStart DeliveryPhase = iota PhasePostStart )
func (DeliveryPhase) String ¶
func (p DeliveryPhase) String() string
type FactoryOptions ¶
type KubernetesDelivery ¶
type KubernetesDelivery struct {
ExecFunc inject.ExecFunc //nolint:staticcheck // K8s exec routing requires this type
}
func (*KubernetesDelivery) Cleanup ¶
func (d *KubernetesDelivery) Cleanup(_ context.Context, _ string) error
func (*KubernetesDelivery) DeliverPostStart ¶
func (d *KubernetesDelivery) DeliverPostStart(ctx context.Context, opts PostStartOptions) error
func (*KubernetesDelivery) DeliverPreStart ¶
func (d *KubernetesDelivery) DeliverPreStart(_ context.Context, _ PreStartOptions) error
func (*KubernetesDelivery) Phase ¶
func (d *KubernetesDelivery) Phase() DeliveryPhase
type LegacyShellDelivery
deprecated
type LegacyShellDelivery struct {
ExecFunc inject.ExecFunc //nolint:staticcheck // deprecated injection path
DownloadURL string
Timeout func() *agent.InjectOptions
}
Deprecated: LegacyShellDelivery is deprecated. Platform-native AgentDelivery implementations (LocalDockerDelivery, RemoteDockerDelivery, KubernetesDelivery) are the replacements.
func (*LegacyShellDelivery) DeliverPostStart
deprecated
func (d *LegacyShellDelivery) DeliverPostStart(ctx context.Context, opts PostStartOptions) error
Deprecated: DeliverPostStart is part of LegacyShellDelivery which is deprecated.
func (*LegacyShellDelivery) DeliverPreStart
deprecated
func (d *LegacyShellDelivery) DeliverPreStart(_ context.Context, _ PreStartOptions) error
Deprecated: DeliverPreStart is part of LegacyShellDelivery which is deprecated.
func (*LegacyShellDelivery) Phase
deprecated
func (d *LegacyShellDelivery) Phase() DeliveryPhase
Deprecated: Phase is part of LegacyShellDelivery which is deprecated.
type LocalDockerDelivery ¶
type LocalDockerDelivery struct {
DockerCommand string
Environment []string
HelperImage string
ExpectedVersion string
}
func (*LocalDockerDelivery) Cleanup ¶
func (d *LocalDockerDelivery) Cleanup(ctx context.Context, workspaceID string) error
func (*LocalDockerDelivery) DeliverPostStart ¶
func (d *LocalDockerDelivery) DeliverPostStart(_ context.Context, _ PostStartOptions) error
func (*LocalDockerDelivery) DeliverPreStart ¶
func (d *LocalDockerDelivery) DeliverPreStart(ctx context.Context, opts PreStartOptions) error
func (*LocalDockerDelivery) Phase ¶
func (d *LocalDockerDelivery) Phase() DeliveryPhase
type PostStartOptions ¶
type PostStartOptions struct {
WorkspaceID string
ContainerDetails *config.ContainerDetails
BinarySource BinarySourceFunc
Arch string
}
type PreStartOptions ¶
type PreStartOptions struct {
WorkspaceID string
RunOptions *driver.RunOptions
BinarySource BinarySourceFunc
Arch string
}
type RemoteDockerDelivery ¶
func (*RemoteDockerDelivery) Cleanup ¶
func (d *RemoteDockerDelivery) Cleanup(_ context.Context, _ string) error
func (*RemoteDockerDelivery) DeliverPostStart ¶
func (d *RemoteDockerDelivery) DeliverPostStart(ctx context.Context, opts PostStartOptions) error
func (*RemoteDockerDelivery) DeliverPreStart ¶
func (d *RemoteDockerDelivery) DeliverPreStart(_ context.Context, _ PreStartOptions) error
func (*RemoteDockerDelivery) Phase ¶
func (d *RemoteDockerDelivery) Phase() DeliveryPhase