snapshot

package
v0.0.0-...-4ed146b Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package snapshot is used to create and read byte dumps of objects. This package was created to improve startup times, for example the whole VM, which takes time to create. With this package, the VM can be snapshotted and restored to a certain state easily.

Index

Constants

View Source
const Nested_TypeID = 0x9a2e520f421c93df

Nested_TypeID is the unique identifier for the type Nested.

View Source
const Pointer_TypeID = 0xea00f2587b64b8bb

Pointer_TypeID is the unique identifier for the type Pointer.

View Source
const Snapshot_TypeID = 0xc499a1c127bebec9

Snapshot_TypeID is the unique identifier for the type Snapshot.

Variables

This section is empty.

Functions

func Load

func Load(b []byte, v interface{}, size uintptr) error

Load unsafely loads the given bytes into the memory location of v. size must be equal to the result of

unsafe.Sizeof(v)

func Store

func Store(w io.Writer, v interface{}) error

Store stores the given interface to a writer in a proprietary, GOARCH and GOOS dependent format, that will not be documented further.

Types

type Nested

type Nested struct{ capnp.Struct }

func NewNested

func NewNested(s *capnp.Segment) (Nested, error)

func NewRootNested

func NewRootNested(s *capnp.Segment) (Nested, error)

func ReadRootNested

func ReadRootNested(msg *capnp.Message) (Nested, error)

func (Nested) Data

func (s Nested) Data() ([]byte, error)

func (Nested) HasData

func (s Nested) HasData() bool

func (Nested) HasPointers

func (s Nested) HasPointers() bool

func (Nested) Len

func (s Nested) Len() int64

func (Nested) NewPointers

func (s Nested) NewPointers(n int32) (Pointer_List, error)

NewPointers sets the pointers field to a newly allocated Pointer_List, preferring placement in s's segment.

func (Nested) Pointers

func (s Nested) Pointers() (Pointer_List, error)

func (Nested) SetData

func (s Nested) SetData(v []byte) error

func (Nested) SetLen

func (s Nested) SetLen(v int64)

func (Nested) SetPointers

func (s Nested) SetPointers(v Pointer_List) error

func (Nested) String

func (s Nested) String() string

type Nested_List

type Nested_List struct{ capnp.List }

Nested_List is a list of Nested.

func NewNested_List

func NewNested_List(s *capnp.Segment, sz int32) (Nested_List, error)

NewNested creates a new list of Nested.

func (Nested_List) At

func (s Nested_List) At(i int) Nested

func (Nested_List) Set

func (s Nested_List) Set(i int, v Nested) error

func (Nested_List) String

func (s Nested_List) String() string

type Nested_Promise

type Nested_Promise struct{ *capnp.Pipeline }

Nested_Promise is a wrapper for a Nested promised by a client call.

func (Nested_Promise) Struct

func (p Nested_Promise) Struct() (Nested, error)

type Pointer

type Pointer struct{ capnp.Struct }

func NewPointer

func NewPointer(s *capnp.Segment) (Pointer, error)

func NewRootPointer

func NewRootPointer(s *capnp.Segment) (Pointer, error)

func ReadRootPointer

func ReadRootPointer(msg *capnp.Message) (Pointer, error)

func (Pointer) HasTarget

func (s Pointer) HasTarget() bool

func (Pointer) NewTarget

func (s Pointer) NewTarget() (Nested, error)

NewTarget sets the target field to a newly allocated Nested struct, preferring placement in s's segment.

func (Pointer) Offset

func (s Pointer) Offset() int64

func (Pointer) SetOffset

func (s Pointer) SetOffset(v int64)

func (Pointer) SetTarget

func (s Pointer) SetTarget(v Nested) error

func (Pointer) String

func (s Pointer) String() string

func (Pointer) Target

func (s Pointer) Target() (Nested, error)

type Pointer_List

type Pointer_List struct{ capnp.List }

Pointer_List is a list of Pointer.

func NewPointer_List

func NewPointer_List(s *capnp.Segment, sz int32) (Pointer_List, error)

NewPointer creates a new list of Pointer.

func (Pointer_List) At

func (s Pointer_List) At(i int) Pointer

func (Pointer_List) Set

func (s Pointer_List) Set(i int, v Pointer) error

func (Pointer_List) String

func (s Pointer_List) String() string

type Pointer_Promise

type Pointer_Promise struct{ *capnp.Pipeline }

Pointer_Promise is a wrapper for a Pointer promised by a client call.

func (Pointer_Promise) Struct

func (p Pointer_Promise) Struct() (Pointer, error)

func (Pointer_Promise) Target

func (p Pointer_Promise) Target() Nested_Promise

type Snapshot

type Snapshot struct{ capnp.Struct }

func NewRootSnapshot

func NewRootSnapshot(s *capnp.Segment) (Snapshot, error)

func NewSnapshot

func NewSnapshot(s *capnp.Segment) (Snapshot, error)

func ReadRootSnapshot

func ReadRootSnapshot(msg *capnp.Message) (Snapshot, error)

func (Snapshot) HasNested

func (s Snapshot) HasNested() bool

func (Snapshot) Nested

func (s Snapshot) Nested() (Nested, error)

func (Snapshot) NewNested

func (s Snapshot) NewNested() (Nested, error)

NewNested sets the nested field to a newly allocated Nested struct, preferring placement in s's segment.

func (Snapshot) SetNested

func (s Snapshot) SetNested(v Nested) error

func (Snapshot) String

func (s Snapshot) String() string

type Snapshot_List

type Snapshot_List struct{ capnp.List }

Snapshot_List is a list of Snapshot.

func NewSnapshot_List

func NewSnapshot_List(s *capnp.Segment, sz int32) (Snapshot_List, error)

NewSnapshot creates a new list of Snapshot.

func (Snapshot_List) At

func (s Snapshot_List) At(i int) Snapshot

func (Snapshot_List) Set

func (s Snapshot_List) Set(i int, v Snapshot) error

func (Snapshot_List) String

func (s Snapshot_List) String() string

type Snapshot_Promise

type Snapshot_Promise struct{ *capnp.Pipeline }

Snapshot_Promise is a wrapper for a Snapshot promised by a client call.

func (Snapshot_Promise) Nested

func (p Snapshot_Promise) Nested() Nested_Promise

func (Snapshot_Promise) Struct

func (p Snapshot_Promise) Struct() (Snapshot, error)

Jump to

Keyboard shortcuts

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