daemon

package
v0.0.0-...-ba854f2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DaemonLog        = "/tmp/pouchd.log"
	PouchdBin        = "pouchd"
	HomeDir          = "/tmp/test/pouch"
	Listen           = "unix:///tmp/test/pouch/pouchd.sock"
	StreamServerPort = "10020"
	ContainerdAdd    = "/tmp/test/pouch/containerd.sock"
	Pidfile          = "/tmp/test/pouch/pouch.pid"
	ConfigFile       = "/tmp/test-config.json"
)

For pouch daemon test, we launched another pouch daemon.

Variables

This section is empty.

Functions

func CreateConfigFile

func CreateConfigFile(path string, cfg interface{}) error

CreateConfigFile create configuration file and marshal cfg. Merge the default config to it if the default config exists.

Types

type Config

type Config struct {
	LogPath string
	LogFile *os.File

	// Daemon startup arguments.
	Args []string

	// Daemon startup config.
	Cfg map[string]interface{}

	// pouchd binary location
	Bin string

	// The following args are all MUST required,
	// in case the new daemon conflicts with existing ones.
	Listen           string
	StreamServerPort string
	HomeDir          string
	ContainerdAddr   string
	Pidfile          string

	// pid of pouchd
	Pid int

	// if Debug=true, dump daemon log when daemon failed to start
	Debug bool
	// contains filtered or unexported fields
}

Config is the configuration of pouch daemon.

func NewConfig

func NewConfig() Config

NewConfig initialize the DConfig with default value.

func (*Config) DumpLog

func (d *Config) DumpLog()

DumpLog prints the daemon log

func (*Config) IsDaemonUp

func (d *Config) IsDaemonUp() bool

IsDaemonUp checks if the pouchd is launched.

func (*Config) KillDaemon

func (d *Config) KillDaemon()

KillDaemon kill pouchd.

func (*Config) StartDaemon

func (d *Config) StartDaemon() error

StartDaemon starts pouchd

Jump to

Keyboard shortcuts

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