store

package
v0.13.11 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 14 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 DaemonRafsStore added in v0.12.0

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

func NewDaemonRafsStore added in v0.12.0

func NewDaemonRafsStore(db *Database) (*DaemonRafsStore, error)

func (*DaemonRafsStore) AddDaemon added in v0.12.0

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

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

func (*DaemonRafsStore) AddRafsInstance added in v0.12.0

func (s *DaemonRafsStore) AddRafsInstance(r *rafs.Rafs) error

func (*DaemonRafsStore) CleanupDaemons added in v0.12.0

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

func (*DaemonRafsStore) DeleteDaemon added in v0.12.0

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

func (*DaemonRafsStore) DeleteRafsInstance added in v0.12.0

func (s *DaemonRafsStore) DeleteRafsInstance(snapshotID string) error

func (*DaemonRafsStore) NextInstanceSeq added in v0.12.0

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

func (*DaemonRafsStore) UpdateDaemon added in v0.12.0

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

func (*DaemonRafsStore) WalkDaemons added in v0.12.0

func (s *DaemonRafsStore) WalkDaemons(ctx context.Context, cb func(d *daemon.ConfigState) error) error

func (*DaemonRafsStore) WalkRafsInstances added in v0.12.0

func (s *DaemonRafsStore) WalkRafsInstances(ctx context.Context, cb func(*rafs.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) AddRafsInstance added in v0.12.0

func (db *Database) AddRafsInstance(_ context.Context, instance *rafs.Rafs) error

func (*Database) CleanupDaemons

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

Cleanup deletes all daemon records

func (*Database) Close

func (db *Database) Close() error

func (*Database) DeleteDaemon

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

func (*Database) DeleteRafsInstance added in v0.12.0

func (db *Database) DeleteRafsInstance(_ 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(_ context.Context, d *daemon.Daemon) error

func (*Database) UpdateDaemon

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

func (*Database) WalkCompatDaemons added in v0.4.0

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

func (*Database) WalkDaemons

func (db *Database) WalkDaemons(_ context.Context, cb func(info *daemon.ConfigState) error) error

func (*Database) WalkRafsInstances added in v0.12.0

func (db *Database) WalkRafsInstances(_ context.Context, cb func(r *rafs.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