state

package
v0.0.0-...-23e6066 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package state provides high-level state wrappers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrStateFile

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

ErrStateFile is returned when the state file cannot be opened.

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(k *kernel.Kernel, p platform.Platform, n inet.Stack) 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

	// CompressionLevel is the compression level to use.
	//
	// See statefile.NewWriter for details.
	CompressionLevel int

	// 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(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