noop

package
v1.6.5 Latest Latest
Warning

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

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

Documentation

Overview

Package noop implements a no-operation executor for testing hibernation workflows without external dependencies. It simulates realistic operations with configurable delays and failure modes, making it ideal for local development and testing.

Index

Constants

View Source
const ExecutorType = "noop"

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct{}

Executor implements the NoOp hibernation logic.

func New

func New() *Executor

New creates a new NoOp executor.

func (*Executor) Shutdown

func (e *Executor) Shutdown(ctx context.Context, log logr.Logger, spec executor.Spec) (*executor.Result, error)

Shutdown simulates hibernation with configurable delay and failure modes.

func (*Executor) Type

func (e *Executor) Type() string

Type returns the executor type.

func (*Executor) Validate

func (e *Executor) Validate(spec executor.Spec) error

Validate validates the executor spec.

func (*Executor) WakeUp

func (e *Executor) WakeUp(ctx context.Context, log logr.Logger, spec executor.Spec, restore executor.RestoreData) (*executor.Result, error)

WakeUp simulates restoration using saved restore data.

type Parameters

type Parameters = executorparams.NoOpParameters

Parameters is an alias for the shared NoOp parameter type.

type RestoreState

type RestoreState struct {
	// Parameters are the original parameters passed to the executor
	Parameters Parameters `json:"parameters"`
	// OperationTime records when the shutdown operation was performed
	OperationTime time.Time `json:"operationTime"`
	// GeneratedID is a unique identifier for this operation
	GeneratedID string `json:"generatedId"`
	// TargetName echoes back the target name for verification
	TargetName string `json:"targetName"`
}

RestoreState holds NoOp restore data that echoes back parameters and operation metadata.

Jump to

Keyboard shortcuts

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