lib

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SdNotifyReady     = "READY=1"
	SdNotifyStopping  = "STOPPING=1"
	SdNotifyReloading = "RELOADING=1"
	SdNotifyWatchdog  = "WATCHDOG=1"
)

Variables

View Source
var (
	SYSFS       string = "/sys/fs/cgroup"
	PROCS       string = "cgroup.procs"
	CGROUP_PROC string = "/proc/%d/cgroup"
)

Functions

func ContainerLogs

func ContainerLogs(c *Context, Id string) error

func CreateContainer

func CreateContainer(c *Context) (types.Container, error)

func CreatePidFile

func CreatePidFile(pidfile string, pid int) error

func IsPidRunning

func IsPidRunning(pid int) bool

func MoveCgroups

func MoveCgroups(c *Context) (bool, error)

func NewLogger

func NewLogger() *logger

func Notify

func Notify(c *Context) error

func PidFile

func PidFile(c *Context) error

func RunContainer

func RunContainer(c *Context) error

func StopContainer

func StopContainer(c *Context) error

func WaitFinished

func WaitFinished(c *Context) error

func Watchdog

func Watchdog(c *Context) error

Types

type Context

type Context struct {
	Args       []string
	Cgroups    []string
	AllCgroups bool
	Logs       bool
	Notify     bool
	Name       string
	Env        bool
	Rm         bool
	Id         string
	Cmd        *exec.Cmd
	Pid        int
	PidFile    string
	Notifier   *Notifier
	Client     *client.Client
	Monitor    *Monitor
	Log        *logger
}

func (*Context) GetClient

func (c *Context) GetClient() (*client.Client, error)

type Monitor

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

func NewMonitor

func NewMonitor() *Monitor

func (*Monitor) RunMonitor

func (m *Monitor) RunMonitor(c *Context)

func (*Monitor) StopMonitor

func (m *Monitor) StopMonitor()

type Notifier

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

func AddNotify

func AddNotify(c *Context) (*Notifier, error)

func Open

func Open(sock string) (*Notifier, error)

func (*Notifier) Close

func (n *Notifier) Close() error

func (*Notifier) Send

func (n *Notifier) Send(s ...string) error

Jump to

Keyboard shortcuts

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