Documentation ¶
Index ¶
Constants ¶
const ContainerdDaemonPIDFile = "/run/bunkerd.pid"
ContainerdDaemonPIDFile is the file where pid of bunkerd daemon is kept.
const ContainerdNamespace = "bunker"
ContainerdNamespace is the namespace label used in the containerd context.
const ContainerdSocketPath = "/run/bunker/bunkerd.sock"
ContainerdSocketPath is the full path of the socket file that is used as the connection to containerd
Variables ¶
var DaemonIsRunning = false
DaemonIsRunning is a boolean value true if daemon is running.
var DaemonPID = 0
DaemonPID is the PID of the running bunkerd daemon.
var Logger *logger.Logger
Logger is a global logger instance. This is initialized once by the CLI or Daemon.
var Util util
Util is a global instance of util struct.
Functions ¶
func InitLogger ¶
InitLogger creates a new instance of logger with the given name and path of the file to log to. The instance is stored as a global logger instance.
Types ¶
type Args ¶
Args is a map of arguments that are passed to the structs that implement Command interface.
type CLI ¶
type CLI struct { }
CLI is the starting point for the bunker cli client. It takes care of argument parsing and calling of correct API methods.
type Command ¶
type Command interface { // Returns the name of the command. Name() string // Executes the command and returns error when it fails. Execute() error // Returns help information about the command as string. Help() string }
Command is an interface type for all API commands in bunker.
type Containerd ¶
type Containerd struct { // Client is the initialied containerd client. Client *containerd.Client // Context is the containerd context with a separate namespace for bunker. Context context.Context }
Containerd is a wrapper over containerd client library. It is takes care of storing a containerd client instance which is used by the CLI.
func NewContainerd ¶
func NewContainerd() (*Containerd, error)
NewContainerd return a new initialized instance of containerd client
type Containers ¶
type Containers struct {
// contains filtered or unexported fields
}
Containers implements Command interface. It is responsible to list containers that exist locally.
func NewContainersCommand ¶
func NewContainersCommand(rawArgs *[]string) (*Containers, error)
NewContainersCommand returns an instance of the command. It takes os arguments and parses them to create the command which can be executed.
func (*Containers) Execute ¶
func (cmd *Containers) Execute() error
Execute runs the command and returns error upon failure.
func (*Containers) Help ¶
func (cmd *Containers) Help() string
Help returns the help information about the command.
func (*Containers) Name ¶
func (cmd *Containers) Name() string
Name returns the name of the command.
type Daemon ¶
type Daemon struct { }
Daemon is the starting point for the bunkerd daemon. It is responsible for starting a new containerd instance.
func (*Daemon) Help ¶
func (daemon *Daemon) Help()
Help prints the help information on how to use bunkerd daemon.
type Images ¶
type Images struct {
// contains filtered or unexported fields
}
Images implements Command interface. It list the images pulled from the registry that exist locally.
func NewImagesCommand ¶
NewImagesCommand returns an instance of the command. It takes os arguments and parses them to create the command which can be executed.
type Pull ¶
type Pull struct {
// contains filtered or unexported fields
}
Pull implements Command interface. It takes care of pulling and image from the registry.
func NewPullCommand ¶
NewPullCommand returns an instance of the command. It takes os arguments and parses them to create the command which can be executed.
type Rm ¶
type Rm struct {
// contains filtered or unexported fields
}
Rm implements Command interface. It takes care of removing a container locally.
func NewRmCommand ¶
NewRmCommand returns an instance of the command. It takes os arguments and parses them to create the command which can be executed.
type Run ¶
type Run struct {
// contains filtered or unexported fields
}
Run implements Command interface. It takes care of running a task in a new or existing container.
func NewRunCommand ¶
NewRunCommand returns an instance of the command. It takes os arguments and parses them to create the command which can be executed.