recording

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package recording provides utilities for recording and replaying.

Index

Constants

This section is empty.

Variables

View Source
var ResourcePatchType = metav1.TypeMeta{
	Kind:       v1alpha1.ResourcePatchKind,
	APIVersion: v1alpha1.GroupVersion.String(),
}

ResourcePatchType is the type of the ResourcePatch.

Functions

func NewReadHook

func NewReadHook(r io.Reader, hook func([]byte) []byte) io.Reader

NewReadHook creates a new read hook.

func NewWriteHook

func NewWriteHook(w io.Writer, hook func([]byte) []byte) io.Writer

NewWriteHook creates a new write hook.

func ReplaceTimeToRelative

func ReplaceTimeToRelative(baseTime time.Time, data []byte) []byte

ReplaceTimeToRelative replaces the time to relative.

func RevertTimeFromRelative

func RevertTimeFromRelative(baseTime time.Time, data []byte) []byte

RevertTimeFromRelative reverts the time from relative to absolute.

Types

type Handle

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

Handle is a struct that represents a handle with pause and Speed properties.

func NewHandle

func NewHandle() *Handle

NewHandle creates a new handle.

func (*Handle) Continue

func (h *Handle) Continue()

Continue is continues the handle.

func (*Handle) Info

func (h *Handle) Info(ctx context.Context)

Info is logs the instructions for the user.

func (*Handle) Input

func (h *Handle) Input(ctx context.Context)

Input is handles the input from the user.

func (*Handle) IsPause

func (h *Handle) IsPause() bool

IsPause is returns whether the handle is paused or not.

func (*Handle) Pause

func (h *Handle) Pause()

Pause is pauses the handle.

func (*Handle) Speed

func (h *Handle) Speed() Speed

Speed is returns the speed of the handle.

func (*Handle) SpeedDown

func (h *Handle) SpeedDown() Speed

SpeedDown is decreases the speed of the handle.

func (*Handle) SpeedUp

func (h *Handle) SpeedUp() Speed

SpeedUp is increases the speed of the handle.

type ResourcePatch

type ResourcePatch v1alpha1.ResourcePatch

ResourcePatch is the patch of the resource.

func (*ResourcePatch) DeepCopyObject

func (r *ResourcePatch) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

func (*ResourcePatch) GetDuration

func (r *ResourcePatch) GetDuration() time.Duration

GetDuration returns the duration of the ResourcePatch.

func (*ResourcePatch) GetTargetGroupVersionResource

func (r *ResourcePatch) GetTargetGroupVersionResource() schema.GroupVersionResource

GetTargetGroupVersionResource returns the target group version resource of the ResourcePatch.

func (*ResourcePatch) GetTargetName

func (r *ResourcePatch) GetTargetName() (string, string)

GetTargetName returns the target name of the ResourcePatch.

func (*ResourcePatch) SetContent

func (r *ResourcePatch) SetContent(obj metav1.Object, track map[log.ObjectRef]json.RawMessage, patchMeta strategicpatch.LookupPatchMeta) error

SetContent sets the content of the ResourcePatch.

func (*ResourcePatch) SetDelete

func (r *ResourcePatch) SetDelete(obj metav1.Object, track map[log.ObjectRef]json.RawMessage)

SetDelete sets the delete of the ResourcePatch.

func (*ResourcePatch) SetDuration

func (r *ResourcePatch) SetDuration(dur time.Duration)

SetDuration sets the duration of the ResourcePatch.

func (*ResourcePatch) SetTargetGroupVersionResource

func (r *ResourcePatch) SetTargetGroupVersionResource(gvr schema.GroupVersionResource)

SetTargetGroupVersionResource sets the target group version resource of the ResourcePatch.

func (*ResourcePatch) SetTargetName

func (r *ResourcePatch) SetTargetName(name, namespace string)

SetTargetName sets the target name of the ResourcePatch.

type Speed

type Speed float64

Speed represents the speed of a recording.

func (Speed) Down

func (s Speed) Down() Speed

func (Speed) Up

func (s Speed) Up() Speed

Jump to

Keyboard shortcuts

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