state

package
v0.0.0-...-9ec6d29 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Overview

Package state provides high-level state wrappers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUTime

func CPUTime() (time.Duration, error)

CPUTime returns the CPU time usage by Sentry and app.

Types

type ErrStateFile

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

ErrStateFile is returned when an error is encountered writing the statefile (which may occur during open or close calls in addition to write).

func (ErrStateFile) Error

func (e ErrStateFile) Error() string

Error implements error.Error().

type LoadOpts

type LoadOpts struct {
	// Destination is the load source.
	Source io.Reader

	// Key is used for state integrity check.
	Key []byte
}

LoadOpts contains load-related options.

func (LoadOpts) Load

func (opts LoadOpts) Load(ctx context.Context, k *kernel.Kernel, timeReady chan struct{}, n inet.Stack, clocks time.Clocks, vfsOpts *vfs.CompleteRestoreOptions) error

Load loads the given kernel, setting the provided platform and stack.

type SaveOpts

type SaveOpts struct {
	// Destination is the save target.
	Destination io.Writer

	// Key is used for state integrity check.
	Key []byte

	// Metadata is save metadata.
	Metadata map[string]string

	// Callback is called prior to unpause, with any save error.
	Callback func(err error)
}

SaveOpts contains save-related options.

func (SaveOpts) Save

func (opts SaveOpts) Save(ctx context.Context, k *kernel.Kernel, w *watchdog.Watchdog) error

Save saves the system state.

Jump to

Keyboard shortcuts

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