store

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const SharedNydusDaemonID = "shared_daemon"

Variables

This section is empty.

Functions

func RedirectInstanceConfig added in v0.4.1

func RedirectInstanceConfig(new, old string) error

Snapshotter v0.3.0 and lower store nydusd and rafs instance configurations in the different folders.

Types

type CompatDaemon added in v0.4.0

type CompatDaemon struct {
	ID               string
	SnapshotID       string
	ConfigDir        string
	SocketDir        string
	LogDir           string
	LogLevel         string
	LogToStdout      bool
	SnapshotDir      string
	Pid              int
	ImageID          string
	FsDriver         string
	APISock          *string
	RootMountPoint   *string
	CustomMountPoint *string
}

type DaemonStore

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

func NewDaemonStore

func NewDaemonStore(db *Database) (*DaemonStore, error)

func (*DaemonStore) AddDaemon added in v0.4.0

func (s *DaemonStore) AddDaemon(d *daemon.Daemon) error

If the daemon is inserted to DB before, return error ErrAlreadyExisted.

func (*DaemonStore) AddInstance added in v0.4.0

func (s *DaemonStore) AddInstance(r *daemon.Rafs) error

func (*DaemonStore) CleanupDaemons

func (s *DaemonStore) CleanupDaemons(ctx context.Context) error

func (*DaemonStore) DeleteDaemon added in v0.4.0

func (s *DaemonStore) DeleteDaemon(id string) error

func (*DaemonStore) DeleteInstance added in v0.4.0

func (s *DaemonStore) DeleteInstance(snapshotID string) error

func (*DaemonStore) NextInstanceSeq added in v0.4.0

func (s *DaemonStore) NextInstanceSeq() (uint64, error)

func (*DaemonStore) UpdateDaemon added in v0.4.0

func (s *DaemonStore) UpdateDaemon(d *daemon.Daemon) error

func (*DaemonStore) WalkDaemons

func (s *DaemonStore) WalkDaemons(ctx context.Context, cb func(d *daemon.States) error) error

func (*DaemonStore) WalkInstances added in v0.4.0

func (s *DaemonStore) WalkInstances(ctx context.Context, cb func(*daemon.Rafs) error) error

type Database

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

Database keeps infos that need to survive among snapshotter restart

func NewDatabase

func NewDatabase(rootDir string) (*Database, error)

NewDatabase creates a new or open existing database file

func (*Database) AddInstance added in v0.4.0

func (db *Database) AddInstance(ctx context.Context, instance *daemon.Rafs) error

func (*Database) CleanupDaemons

func (db *Database) CleanupDaemons(ctx context.Context) error

Cleanup deletes all daemon records

func (*Database) Close

func (db *Database) Close() error

func (*Database) DeleteDaemon

func (db *Database) DeleteDaemon(ctx context.Context, id string) error

func (*Database) DeleteInstance added in v0.4.0

func (db *Database) DeleteInstance(ctx context.Context, snapshotID string) error

func (*Database) NextInstanceSeq added in v0.4.0

func (db *Database) NextInstanceSeq() (uint64, error)

func (*Database) SaveDaemon

func (db *Database) SaveDaemon(ctx context.Context, d *daemon.Daemon) error

func (*Database) UpdateDaemon

func (db *Database) UpdateDaemon(ctx context.Context, d *daemon.Daemon) error

func (*Database) WalkCompatDaemons added in v0.4.0

func (db *Database) WalkCompatDaemons(ctx context.Context, handler func(cd *CompatDaemon) error) error

func (*Database) WalkDaemons

func (db *Database) WalkDaemons(ctx context.Context, cb func(info *daemon.States) error) error

func (*Database) WalkInstances added in v0.4.0

func (db *Database) WalkInstances(ctx context.Context, cb func(r *daemon.Rafs) error) error

WalkDaemons iterates all daemon records and invoke callback on each

Jump to

Keyboard shortcuts

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